Hugging Face MCP Server
Hugging Face Official MCP Server
Hugging Face's official MCP server: Hub search and Gradio apps from Spaces as agent tools
Install
claude mcp add hf-mcp-server -t http https://huggingface.co/mcp?loginThen start claude and complete authentication.
This is third-party code. Review the repository files before installing.
What it does
The server connects an agent to the Hugging Face Hub: search and details for model, dataset and Space repositories, plus Hub file access. Beyond built-in tools the agent can call Gradio apps from Spaces that the user picks at huggingface.co/settings/mcp. With authentication, Jobs, dynamic Spaces and a sandbox are also available. Hugging Face hosts the server, and it also runs locally via npx or Docker.
Who it is for. For ML engineers and developers who look for models and datasets or want to call AI apps from Spaces.
Good fit when
- You need a model or dataset for a task without leaving the agent
- You want to call a Gradio app, such as image generation, as a tool
- You need to look at a Hub repository's files and card
Not a fit when
- You have no Hugging Face account but need Jobs or private repos
- You need local model inference without the cloud
Example request
Find a small, openly licensed Russian speech recognition model on Hugging FaceLimitations
Some tools need an OAuth login or a Hugging Face token. Spaces run on Hugging Face and may sleep or fail, and heavy apps consume account quotas. Access to Hugging Face from Russia without a VPN is unreliable.
How to disable. Run claude mcp remove hf-mcp-server or remove the Hugging Face connector in your client settings, then revoke the token on huggingface.co.
MCP
- Transport
- http, stdio
- Authentication
- OAuth
| Environment variables | |
|---|---|
| HF_TOKEN secret | Hugging Face token for local STDIO mode |
| DEFAULT_HF_TOKEN secret | Default token for local STDIO, takes precedence over HF_TOKEN |
| TRANSPORT | stdio or streamableHttpJson |
| DISABLE_TOOLS | Tools to hide and reject |
Security check
- Calls third-party apps from Spaces
- Uses a Hugging Face token and can launch Jobs
README in short
The README starts with installing the hosted server in Claude Desktop, Claude Code, Gemini CLI, VS Code and Cursor with OAuth or a token. It then covers repository packages, STDIO and Streamable HTTP transports, and local runs via npx and Docker. Most of it deals with environment variables, CSV proxy tools, skill distribution and Space monitoring for self-hosters.
FAQ
How do I choose which Spaces the agent sees?
In your account settings at huggingface.co/settings/mcp. The tool set is resolved per request.
Can I drop images from Gradio responses?
Yes, add ?no_image_content=true to the server URL.
Related
Open-source personal AI assistant on your own machine: answers in Telegram, Slack, Discord and WhatsApp, extended with skills and plugins
A self-improving agent from Nous Research with a TUI, messaging gateway, cron jobs and skills it writes itself
An open source coding agent for the terminal and desktop with build and plan modes
Open prompt library with a Claude Code plugin, MCP server and CLI: search, fetch and improve prompts and skills from an agent