Hugging Face MCP Server

AIhttp-streamingstdiov1.0.0
代码仓库

Official Hugging Face MCP Server that connects AI assistants directly to the Hugging Face Hub ecosystem. Provides tools for searching and retrieving models, datasets, and research papers, running inference on thousands of Gradio-powered AI applications (Spaces), and accessing the full Hub API. Supports remote HTTP-streaming via https://huggingface.co/mcp with OAuth or Bearer token auth, as well as local stdio deployment. Works with Claude, Gemini CLI, VS Code, Cursor, and any MCP-compatible client.

连接

将此配置添加到 .claude/mcp.json

传输方式:
{
  "mcpServers": {
    "huggingface": {
      "url": "https://github.com/huggingface/hf-mcp-server",
      "env": {
        "HF_TOKEN": "<YOUR_HF_TOKEN>"
      }
    }
  }
}

工具 (6)

search_models

Search the Hugging Face Hub for models by task, library, language, or free-text query. Returns model IDs, download counts, and metadata.

{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "task": {
      "type": "string",
      "description": "Filter by ML task (e.g. text-generation, image-classification)"
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of results (default 10)"
    },
    "query": {
      "type": "string",
      "description": "Search query (e.g. \"text classification\", \"llama\", \"whisper\")"
    },
    "library": {
      "type": "string",
      "description": "Filter by framework (e.g. transformers, diffusers)"
    },
    "language": {
      "type": "string",
      "description": "Filter by language code (e.g. en, fr, zh)"
    }
  }
}

get_model

Retrieve detailed information about a specific Hugging Face model including its model card, tags, pipeline tag, and download statistics.

{
  "type": "object",
  "required": [
    "modelId"
  ],
  "properties": {
    "modelId": {
      "type": "string",
      "description": "Model ID in the format \"owner/model-name\" (e.g. \"meta-llama/Llama-3.1-8B\")"
    }
  }
}

search_datasets

Search the Hugging Face Hub for datasets by task, modality, or keyword.

{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "task": {
      "type": "string",
      "description": "Filter by task category"
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of results (default 10)"
    },
    "query": {
      "type": "string",
      "description": "Search query"
    }
  }
}

search_papers

Search Hugging Face Papers (daily ML paper summaries) by keyword or topic. Returns paper titles, abstracts, and links to associated models.

{
  "type": "object",
  "required": [
    "query"
  ],
  "properties": {
    "limit": {
      "type": "integer",
      "description": "Maximum number of results (default 10)"
    },
    "query": {
      "type": "string",
      "description": "Search query (e.g. \"mixture of experts\", \"RLHF\")"
    }
  }
}

run_inference

Run inference on a Hugging Face model using the Inference API. Supports text generation, classification, embeddings, image generation, and more.

{
  "type": "object",
  "required": [
    "modelId",
    "inputs"
  ],
  "properties": {
    "inputs": {
      "type": "string",
      "description": "Input text, prompt, or data for the model"
    },
    "modelId": {
      "type": "string",
      "description": "Model ID to run inference on"
    },
    "parameters": {
      "type": "object",
      "description": "Optional model-specific parameters (e.g. max_new_tokens, temperature)"
    }
  }
}

list_spaces

List or search Hugging Face Spaces (Gradio/Streamlit AI applications) by keyword, SDK, or author.

{
  "type": "object",
  "properties": {
    "sdk": {
      "type": "string",
      "description": "Filter by SDK (gradio, streamlit, docker)"
    },
    "limit": {
      "type": "integer",
      "description": "Maximum number of results (default 10)"
    },
    "query": {
      "type": "string",
      "description": "Search query for spaces"
    }
  }
}

资源

此服务器未提供任何资源。

提示词

此服务器未提供任何提示词。

服务器信息

作者
Hugging Face (@huggingface)
代码仓库
https://github.com/huggingface/hf-mcp-server
许可证
Apache-2.0
版本
1.0.0
星标
1,200
最后更新
2026年5月31日