What is Hugging Face MCP Server?
Hugging Face MCP Server is a community huggingface mcp server by Shreyas Karnik that gives Claude and other MCP clients read-only access to the Hugging Face Hub: search and inspect models, datasets, Spaces, papers and collections.
It is a small Python server that runs locally over stdio and calls the public Hub API. It is not the official Hugging Face MCP server; Hugging Face runs its own hosted server at https://huggingface.co/mcp, covered in the comparison section below.
How to use Hugging Face MCP Server?
Prerequisites:
- uv and Python 3.13 or newer (the project's
pyproject.toml requires >=3.13)
- A local clone of
https://github.com/shreyaskarnik/huggingface-mcp-server
- Optional: a Hugging Face access token from
https://huggingface.co/settings/tokens, set as HF_TOKEN
No API key is required. The README lists HF_TOKEN as optional, for higher rate limits and access to private repositories.
Smithery (Claude Desktop)
The README's one-step install for Claude Desktop:
npx -y @smithery/cli install @shreyaskarnik/huggingface-mcp-server --client claude
Claude Desktop
Edit claude_desktop_config.json:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"huggingface": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/huggingface-mcp-server",
"run",
"huggingface"
],
"env": {
"HF_TOKEN": "your_token_here"
}
}
}
}
The README's sample runs huggingface_mcp_server.py, but the current repository has no file by that name. The server code is in src/huggingface/, and pyproject.toml defines a huggingface command, which is also what the Smithery config starts. That is why the example above runs huggingface. Restart Claude Desktop after saving.
Claude Code
Register the same local command over stdio:
claude mcp add huggingface -- uv --directory /absolute/path/to/huggingface-mcp-server run huggingface
Cursor and VS Code
Use the same command and args as the Claude Desktop entry in your client's MCP config file. If you want a remote server with one-click setup in Cursor or VS Code instead, use the official hosted server (see below).
Key features of Hugging Face MCP Server
- Read-only access to the Hugging Face Hub API. It cannot upload, edit or delete anything.
- Ten tools covering models, datasets, Spaces, papers and collections
- A custom
hf:// URI scheme for resources: hf://model/{model_id}, hf://dataset/{dataset_id}, hf://space/{space_id}, all returned as JSON
- Two prompt templates:
compare-models (takes comma-separated model_ids) and summarize-paper (takes arxiv_id, with an optional detail_level of brief or detailed)
- Works without any configuration, with an optional
HF_TOKEN
- Runs locally over stdio and is MIT licensed
- Install either with Smithery or with
uv
Hugging Face MCP Server tools
The tools fall into five groups:
- Models:
search-models filters by query, author, tags and limit. get-model-info returns details for one model.
- Datasets:
search-datasets and get-dataset-info do the same for datasets.
- Spaces:
search-spaces can filter by SDK type, such as Gradio. get-space-info returns details for one Space.
- Papers:
get-paper-info looks up a paper by arXiv ID together with its implementations on the Hub. get-daily-papers returns the curated daily papers list.
- Collections:
search-collections and get-collection-info browse curated collections.
None of the tools runs inference or generates content. They only return Hub metadata.
Use cases of Hugging Face MCP Server
- Model discovery: "Search for BERT models on Hugging Face with less than 100 million parameters."
- Picking between models: "Compare the Llama-3-8B and Mistral-7B models from Hugging Face." This can use the
compare-models prompt.
- Dataset research: "Find the most popular datasets for text classification on Hugging Face."
- Keeping up with research: "What are today's featured AI research papers on Hugging Face?"
- Reading a paper quickly: "Summarize the paper with arXiv ID 2307.09288 using the Hugging Face MCP server."
- Finding demos: "Show me the most popular Gradio spaces for image generation." Or: "Find collections created by TheBloke that include Mixtral models."
Hugging Face MCP Server vs alternatives
-
Official Hugging Face MCP server (https://huggingface.co/mcp, source at huggingface/hf-mcp-server). This is the hosted server that Hugging Face maintains. It connects over HTTP, so nothing runs locally. It supports sign-in via ?login or an Authorization: Bearer <YOUR_HF_TOKEN> header. You choose its tools and Spaces at https://huggingface.co/settings/mcp. Beyond Hub search it can call MCP-enabled Gradio Spaces, for example to generate images. Documented setups cover Claude Desktop/claude.ai, Claude Code, Gemini CLI, VS Code and Cursor. In Claude Code:
claude mcp add hf-mcp-server -t http https://huggingface.co/mcp?login
For Cursor or VS Code with a token, the official snippet is:
"huggingface": {
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer <YOUR_HF_TOKEN>"
}
}
-
This community server. It is a fixed, read-only toolset running on your own machine. It suits you if you want a small local process with no Hugging Face login, or if you want the hf:// resources and the two prompt templates. The repository has had no new commits since March 2025.
Most people searching for "hugging face mcp" today want the official hosted server. Use the community one when you specifically want a local, read-only Hub browser.
Troubleshooting Hugging Face MCP Server
- Server does not start in Claude Desktop: check the logs at
~/Library/Logs/Claude/mcp-server-huggingface.log (macOS) or %APPDATA%\Claude\logs\mcp-server-huggingface.log (Windows). A common cause is pointing uv run at huggingface_mcp_server.py, which is not in the repository. Run huggingface instead, and make sure --directory is an absolute path.
- Python version errors: the project requires Python 3.13 or newer. Let
uv install a matching interpreter, or upgrade the one you have.
- Rate limit errors: the README suggests adding a Hugging Face token. In the current source, Hub requests go out through a plain HTTP client without an auth header, so a token may not raise limits. Switch to the official server if you need authenticated access.
- Debugging tool calls: run the MCP Inspector against the server:
npx @modelcontextprotocol/inspector uv --directory /path/to/huggingface-mcp-server run huggingface. Then open the URL it prints.
- A tool returns nothing: check that you have internet access, then look up the same model or dataset on huggingface.co to confirm it exists.
Comments