dylanebert
MCP Serverdylanebertpublic

huggingface mcp

基于 Hugging Face Hub API 的 MCP 服务器,提供模型搜索、信息获取和元数据更新等功能。

Repository Info

0
Stars
0
Forks
0
Watchers
0
Issues
Python
Language
MIT License
License

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_download to 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_commit to update the metadata of a model on the Hugging Face Hub. Currently only supports updating library_name and pipeline_tag.

Usage

This MCP is tested using Cursor.

Run the Server

  1. Clone the repository.
  2. 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
  1. Run the MCP server.
python src/server.py

Use the Server in Cursor

  1. Press Ctrl+Shift+J -> MCP -> Add new global MCP server to open mcp.json.
  2. Add the following configuration:
{
    "mcpServers": {
        "huggingface": {
            "url": "http://127.0.0.1:8000/mcp"
        }
    }
}
  1. The server should now be available in the MCP server list, with the tools search_models, get_model_info, get_model_card, and update_metadata.
  2. Use Cursor Chat with a frontier model like claude-3.7-sonnet and 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-Instruct model
  • Find the top trending models with gguf in the name and write them to a CSV called gguf_trending_models.csv with the header model_id,pipeline_tag.
  • Read the data in gguf_trending_models.csv. Use that data to update the pipeline_tag for all models in gguf_trending_models.csv using the update_metadata tool.

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

1

Clone the repository

git clone https://github.com/dylanebert/huggingface-mcp
2

Install dependencies

cd huggingface-mcp
npm install
3

Follow the documentation

Check the repository's README.md file for specific installation and usage instructions.

Repository Details

Ownerdylanebert
Repohuggingface-mcp
LanguagePython
LicenseMIT License
Last fetched8/10/2025

Recommended MCP Servers

💬

Discord MCP

Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.

integrationsdiscordchat
🔗

Knit MCP

Connect AI agents to 200+ SaaS applications and automate workflows.

integrationsautomationsaas
🕷️

Apify MCP Server

Deploy and interact with Apify actors for web scraping and data extraction.

apifycrawlerdata
🌐

BrowserStack MCP

BrowserStack MCP Server for automated testing across multiple browsers.

testingqabrowsers

Zapier MCP

A Zapier server that provides automation capabilities for various apps.

zapierautomation