Hugging Face Hub Access
STDIORead-only server for accessing Hugging Face Hub APIs and resources.
Read-only server for accessing Hugging Face Hub APIs and resources.
A Model Context Protocol (MCP) server that provides read-only access to the Hugging Face Hub APIs. This server allows LLMs like Claude to interact with Hugging Face's models, datasets, spaces, papers, and collections.
The server exposes popular Hugging Face resources:
hf://
URI scheme for accessing resourceshf://model/{model_id}
URIshf://dataset/{dataset_id}
URIshf://space/{space_id}
URIsThe server provides two prompt templates:
compare-models
: Generates a comparison between multiple Hugging Face models
model_ids
argument (comma-separated model IDs)summarize-paper
: Summarizes a research paper from Hugging Face
arxiv_id
argument for paper identificationdetail_level
argument (brief/detailed) to control summary depthThe server implements several tool categories:
Model Tools
search-models
: Search models with filters for query, author, tags, and limitget-model-info
: Get detailed information about a specific modelDataset Tools
search-datasets
: Search datasets with filtersget-dataset-info
: Get detailed information about a specific datasetSpace Tools
search-spaces
: Search Spaces with filters including SDK typeget-space-info
: Get detailed information about a specific SpacePaper Tools
get-paper-info
: Get information about a paper and its implementationsget-daily-papers
: Get the list of curated daily papersCollection Tools
search-collections
: Search collections with various filtersget-collection-info
: Get detailed information about a specific collectionThe server does not require configuration, but supports optional Hugging Face authentication:
HF_TOKEN
environment variable with your Hugging Face API token for:
To install huggingface-mcp-server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @shreyaskarnik/huggingface-mcp-server --client claude
On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json
"mcpServers": { "huggingface": { "command": "uv", "args": [ "--directory", "/absolute/path/to/huggingface-mcp-server", "run", "huggingface_mcp_server.py" ], "env": { "HF_TOKEN": "your_token_here" // Optional } } }
To prepare the package for distribution:
uv sync
uv build
This will create source and wheel distributions in the dist/
directory.
uv publish
Note: You'll need to set PyPI credentials via environment variables or command flags:
--token
or UV_PUBLISH_TOKEN
--username
/UV_PUBLISH_USERNAME
and --password
/UV_PUBLISH_PASSWORD
Since MCP servers run over stdio, debugging can be challenging. For the best debugging experience, we strongly recommend using the MCP Inspector.
You can launch the MCP Inspector via npm
with this command:
npx @modelcontextprotocol/inspector uv --directory /path/to/huggingface-mcp-server run huggingface_mcp_server.py
Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.
When using this server with Claude, try these example prompts:
If you encounter issues with the server:
Check server logs in Claude Desktop:
~/Library/Logs/Claude/mcp-server-huggingface.log
%APPDATA%\Claude\logs\mcp-server-huggingface.log
For API rate limiting errors, consider adding a Hugging Face API token
Make sure your machine has internet connectivity to reach the Hugging Face API
If a particular tool is failing, try accessing the same data through the Hugging Face website to verify it exists