Hugging Face Official Remote MCP Server
Hugging Face's hosted MCP exposes the Hub โ models, datasets, Spaces, papers โ as agent tools. Authorize by attaching a Hugging Face access token.
ไธญๆ็ฎไป
Hugging Face ๅฎๆน่ฟ็จ MCP ๆๅกๅจ๏ผhuggingface.co/mcp๏ผใไฝฟ็จ HF Access Token ๆ็ดขๆจกๅใๆฐๆฎ้ใSpaces ไธ่ฎบๆใ
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"huggingface": {
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}claude mcp add --transport http huggingface https://huggingface.co/mcp
With credential header:
claude mcp add --transport http huggingface https://huggingface.co/mcp --header "Authorization: Bearer YOUR_API_KEY"
Or add to .vscode/mcp.json:
{
"servers": {
"huggingface": {
"type": "http",
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}- Open Settings โ Connectors (Integrations) โ Add Custom Connector.
- Paste the endpoint URL:
https://huggingface.co/mcp - Provide your API key / Bearer token when prompted.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"huggingface": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://huggingface.co/mcp",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"huggingface": {
"serverUrl": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}๐งฐ Tools exposed by Hugging Face MCP (4)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| search_models | ๐ข Read | Search Hugging Face Hub models by name, task or filter. | query*: stringlimit: number |
| search_datasets | ๐ข Read | Search Hugging Face Hub datasets. | query*: stringlimit: number |
| search_spaces | ๐ข Read | Search Hugging Face Spaces (interactive ML demos). | query*: stringlimit: number |
| get_paper_details | ๐ข Read | Get details for a paper on Hugging Face Papers. | arxivId*: string |
๐ OAuth 2.1 & Security
- Auth type
- Bearer Token
- Dynamic Client Registration
- โ
- PKCE S256
- โ
- Protected resource metadata
- https://huggingface.co/.well-known/oauth-protected-resource (expected location)
๐งฉ Recommended Agent Skills
๐ Guide
Hugging Face MCP โ Remote MCP Server
Hugging Face's remote MCP is also the Gradio MCP backbone โ it can expose thousands of Gradio Spaces as tools on top of Hub search. The endpoint lives on huggingface.co itself and authorizes with a plain HF access token sent as a Bearer header โ no OAuth dance required.
Endpoint & Transport
- Endpoint URL:
https://huggingface.co/mcp - Transport: Streamable HTTP
Authentication
Hugging Face MCP uses bearer-token authentication. Create an access token in your Hugging Face account settings, then send it as Authorization: Bearer <token>. No OAuth redirect flow is involved.
Available Tools (4)
| Tool | Safety | Description |
|---|---|---|
search_models |
read | Search Hugging Face Hub models by name, task or filter. |
search_datasets |
read | Search Hugging Face Hub datasets. |
search_spaces |
read | Search Hugging Face Spaces (interactive ML demos). |
get_paper_details |
read | Get details for a paper on Hugging Face Papers. |
Connect in 30 Seconds
Claude Code โ one command:
claude mcp add --transport http huggingface https://huggingface.co/mcp
Cursor โ add to ~/.cursor/mcp.json:
{ "mcpServers": { "huggingface": { "url": "https://huggingface.co/mcp" } } }
VS Code โ add to .vscode/mcp.json:
{ "servers": { "huggingface": { "type": "http", "url": "https://huggingface.co/mcp" } } }
Claude Desktop & stdio clients โ bridge with mcp-remote:
{ "mcpServers": { "huggingface": { "command": "npx", "args": ["-y", "mcp-remote", "https://huggingface.co/mcp"] } } }
Troubleshooting
- 401/403 responses โ your credential is missing or rejected. Regenerate the key/token and make sure it is sent as an
Authorization: Bearerheader on every request, including theinitializecall. - "Session expired" / stale
Mcp-Session-Idโ just re-sendinitialize; stateless clients can ignore session headers entirely. - Send your HF access token as
Authorization: Bearer <token>โ fine-grained tokens work. - Anonymous access gives a reduced tool set; a token unlocks the full Hub tools.
๐ How to Connect
- Copy the Hugging Face MCP endpoint URLThe remote endpoint is https://huggingface.co/mcp.
- Add it to your MCP clientClaude Code:
claude mcp add --transport http huggingface https://huggingface.co/mcp. Cursor: add"huggingface": { "url": "https://huggingface.co/mcp" }undermcpServersin ~/.cursor/mcp.json. Other clients work similarly. - Configure your credentialGenerate an access token at https://huggingface.co/docs/hub/en/hf-mcp-server and add an
Authorization: Bearer <token>header to the server's config (supported by Cursor, VS Code, Windsurf and mcp-remote --header). - Verify with the online inspectorPaste https://huggingface.co/mcp into remotemcp.net/inspector, run initialize and tools/list, and confirm Hugging Face MCP's 4 tools respond.
โ FAQ
What is the Hugging Face MCP remote MCP endpoint?
The primary endpoint is https://huggingface.co/mcp. It is an official first-party server operated by Hugging Face, speaking the Streamable HTTP transport.
How do I authenticate with Hugging Face MCP?
Hugging Face MCP expects a credential sent as an Authorization: Bearer header. Generate the token in your Hugging Face account and add it to your client's headers.
I'm getting a 401 Unauthorized from Hugging Face MCP โ what's wrong?
Your Bearer credential is missing, malformed or expired. Confirm it is attached to every request โ including initialize โ and that no proxy is stripping the Authorization header.
Which MCP clients work with Hugging Face MCP?
Any client that supports remote MCP servers: Cursor, Claude Code (`claude mcp add --transport http huggingface https://huggingface.co/mcp`), VS Code Copilot, ChatGPT connectors, Windsurf, and Claude Desktop via the `mcp-remote` bridge.
What tools does Hugging Face MCP expose?
4 tools are cataloged in this directory โ including `search_models`, `search_datasets`, `search_spaces` and more. Use our online inspector to fetch the live tool list straight from the endpoint.
๐ Connect Guides
๐ Embed Status Badge in README
Related Servers
GitHub's official remote MCP server hosted at api.githubcopilot.com. Gives AI agents first-party access to repositories, issues, pull requests and code search.
Linear's official remote MCP server. Agents can search, create and update issues and query your team's workflow over Streamable HTTP or SSE.
Cognition Devin's free DeepWiki MCP. Ask questions and read AI-generated wiki documentation for any public GitHub repository โ no auth required.
Upstash Context7's free, no-auth MCP server. Fetches up-to-date, version-specific library documentation straight into your agent's context.