This MCP server provides read-only access to Hugging Face Hub APIs, allowing Claude and other LLMs to interact with Hugging Face's models, datasets, spaces, papers, and collections through a structured protocol interface.
The easiest way to install the Hugging Face MCP server for Claude Desktop is through Smithery:
npx -y @smithery/cli install @shreyaskarnik/huggingface-mcp-server --client claude
You can also manually configure the server in Claude Desktop:
On MacOS:
Edit the configuration file at: ~/Library/Application\ Support/Claude/claude_desktop_config.json
On Windows:
Edit the configuration file at: %APPDATA%/Claude/claude_desktop_config.json
Add the following to your configuration file:
"mcpServers": {
"huggingface": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/huggingface-mcp-server",
"run",
"huggingface_mcp_server.py"
],
"env": {
"HF_TOKEN": "your_token_here" // Optional
}
}
}
The server works without additional configuration, but you can enhance its capabilities:
Setting the HF_TOKEN
environment variable with your Hugging Face API token provides:
The server exposes Hugging Face resources through custom URIs:
hf://model/{model_id}
hf://dataset/{dataset_id}
hf://space/{space_id}
The server provides two specialized prompt templates:
Generates comparisons between multiple Hugging Face models:
model_ids
argument (comma-separated)Summarizes research papers from Hugging Face:
arxiv_id
argumentdetail_level
argument (brief/detailed)When using the server with Claude, try these example prompts:
If you encounter issues:
Check server logs:
~/Library/Logs/Claude/mcp-server-huggingface.log
%APPDATA%\Claude\logs\mcp-server-huggingface.log
API rate limiting: Consider adding a Hugging Face API token
Connectivity: Ensure your machine has internet access to reach the Hugging Face API
Verify data: If a tool fails, check if the data exists on the Hugging Face website
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.