Is the Hugging Face MCP server safe? What it can reach
What the Hugging Face MCP server can read, write and delete, how it signs in, and how to limit it in Claude Code and Codex.
Hugging Face runs an official hosted MCP server at huggingface.co/mcp, and the code is open source in hf-mcp-server. It signs in with OAuth or a Hugging Face token, and the token’s permissions decide what the agent can do. With a write token it can create repos, run Jobs and use sandboxes, so use a read token unless you need more.
Who maintains it
| Implementation | Kind | Status |
|---|---|---|
| Hugging Face MCP Server (Hugging Face, hosted) | Official | active |
| hf-mcp-server (Hugging Face, open source, runs locally or self-hosted) | Official | active |
It runs as a local process on your machine or as a hosted remote server. The documented endpoint is https://huggingface.co/mcp.
How it signs in
OAuth through the ?login URL, or a Hugging Face token sent as a Bearer header. Requests with no token get public read tools only, and a read-only token adds job reads. Any other verified token also gets repository writes, Jobs and sandboxes.
| Scope or permission | Access |
|---|---|
read token | read |
write token | write |
What its tools can do
| Kind | Tools |
|---|---|
| Read | hf_whoami, hf_jobs_list, hf_job_get, hf_repo_info, hf_docs_search, hf_docs_read, hf_papers_search |
| Write | none documented |
| Can’t be undone | none documented |
The docs name only some tools and give no complete list, so these lists are partial. Also named are hf_fs, the built-in Hub navigation tool, and hub_repo_search. The settings page adds optional groups called Contribute Repos, Sandboxes and Run and Manage Jobs, whose tool names are not listed. Gradio Spaces you add become extra tools.
Built-in limits
| Option | What it does |
|---|---|
MCP settings page | At huggingface.co/settings/mcp you choose the built-in tool groups (Contribute Repos, Sandboxes, Run and Manage Jobs) and which Spaces to add. |
Token permissions | The Hub checks permissions on every call. Use a read-only token to keep write tools out of reach. |
DISABLE_TOOLS | For the self-run server, a comma-separated list of tools hidden from the tool list and rejected if called. |
MCP_STRICT_TOKEN | For the self-run server, set to true to reject requests that send no token. |
Dynamic Spaces | An option in your settings that, when on, lets the agent call MCP Spaces it discovers at runtime. |
The risks
- With a write token the Jobs and sandbox tools let an agent run code on Hugging Face infrastructure, which can spend your compute credits.
- Contribute Repos lets an agent create repositories and write files to them, so an injected instruction could publish content under your account.
- Gradio Spaces you add are code run by third parties, and their outputs and the tool descriptions they provide go into your agent’s context.
- Repo, discussion and paper text the read tools return can be written by anyone, which makes it a path for prompt injection.
Limit it in Claude Code
Add it from the documented launch settings, at local or user scope so a token never lands in a shared .mcp.json:
claude mcp add --transport http hugging-face https://huggingface.co/mcpClaude Code names MCP tools mcp__hugging-face__<tool>. Once you know the tool names, deny the ones you won’t use and set the rest to ask in .claude/settings.json.
Limit it in Codex
Codex reads MCP servers from ~/.codex/config.toml. disabled_tools removes tools, and enabled_tools keeps only the ones you list:
[mcp_servers.hugging-face]
url = "https://huggingface.co/mcp"Checklist
- Start with a read-only token, not a write token.
- Turn on only the tool groups you need at the MCP settings page.
- Add Spaces you have reviewed, and keep Dynamic Spaces off.
- Set DISABLE_TOOLS if you run the server yourself.
Checked against the vendor documentation on November 25, 2026. Hugging Face MCP Server docs · hf-mcp-server README · hf-mcp-server PTC notes
What Excellent covers
Excellent doesn’t inspect MCP servers themselves. Its free scan reads supported logs on the Mac (Claude Code, Codex, Grok Build, GitHub Copilot CLI, Gemini CLI and Qwen Code) and reports findings for review, so you can see what an agent did after a session. Run the free scan · See a sample report · How to vet any MCP server
Excellent Pro adds checks before supported actions. Claude Code can display an ask prompt. With Codex, an Excellent “ask” refuses the action and tells the agent to ask you. Pro is US-only for now. Agent coverage · Pricing