
huggingface mcp
基于 Hugging Face Hub API 的 MCP 服务器,提供模型搜索、信息获取和元数据更新等功能。
Repository Info
About This Server
基于 Hugging Face Hub API 的 MCP 服务器,提供模型搜索、信息获取和元数据更新等功能。
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
Hugging Face MCP
Hugging Face MCP is an MCP server on top of the Hugging Face Hub API.
Tools
- search_models: Search models on the Hugging Face Hub. Equivalent to
hf_api.list_models. - get_model_info: Get structured metadata about a model on the Hugging Face Hub. Equivalent to
hf_api.model_info. - get_model_card: Uses
hf_api.hf_hub_downloadto get the full model card (README.md) of a model on the Hugging Face Hub. - update_metadata: Opens a pull request using
hf_api.create_committo update the metadata of a model on the Hugging Face Hub. Currently only supports updatinglibrary_nameandpipeline_tag.
Usage
This MCP is tested using Cursor.
Run the Server
- Clone the repository.
- Create a virtual environment and install the dependencies.
uv venv
.venv\Scripts\activate # Windows
source .venv/bin/activate # Linux/MacOS
uv pip install fastmcp huggingface_hub
- Run the MCP server.
python src/server.py
Use the Server in Cursor
- Press
Ctrl+Shift+J->MCP->Add new global MCP serverto openmcp.json. - Add the following configuration:
{
"mcpServers": {
"huggingface": {
"url": "http://127.0.0.1:8000/mcp"
}
}
}
- The server should now be available in the MCP server list, with the tools
search_models,get_model_info,get_model_card, andupdate_metadata. - Use Cursor Chat with a frontier model like
claude-3.7-sonnetand Agent mode to use the tools.
Examples
- List the top 50 trending models on Hugging Face
- Get the model card for the
meta-llama/Meta-Llama-3-8B-Instructmodel - Find the top trending models with
ggufin the name and write them to a CSV calledgguf_trending_models.csvwith the headermodel_id,pipeline_tag. - Read the data in
gguf_trending_models.csv. Use that data to update thepipeline_tagfor all models ingguf_trending_models.csvusing theupdate_metadatatool.
Limitations
- Agents make mistakes, especially on complex operations. Break it down into simple tasks with manual verification.
- The Hugging Face Hub API has rate limits. Avoid massive-scale operations.
Quick Start
Clone the repository
git clone https://github.com/dylanebert/huggingface-mcpInstall dependencies
cd huggingface-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.