Skip to content

Commit 48d4d70

Browse files
committed
[Documentation] HF MCP Server
1 parent 85662ba commit 48d4d70

File tree

2 files changed

+68
-3
lines changed

2 files changed

+68
-3
lines changed

docs/hub/agents.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Agents on the Hub
22

33
This page compiles all the libraries and tools Hugging Face offers for agentic workflows:
4-
- `HF MCP Server`: Connect your MCP-compatible AI assistant directly to the Hugging Face Hub.
4+
- [HF MCP Server](./hf-mcp-server): Connect your MCP-compatible AI assistant directly to the Hugging Face Hub.
55
- `tiny-agents`: A lightweight toolkit for MCP-powered agents, available in both JS (`@huggingface/tiny-agents`) and Python (`huggingface_hub`).
66
- `Gradio MCP Server`: Easily create MCP servers from Gradio apps and Spaces.
77
- `smolagents`: a Python library that enables you to run powerful agents in a few lines of code.
@@ -16,7 +16,7 @@ With the HF MCP Server, you can enhance your AI assistant's capabilities by conn
1616

1717
#### Getting Started
1818

19-
Visit [huggingface.co/settings/mcp](https://huggingface.co/settings/mcp) to configure your MCP client and get started.
19+
Visit [huggingface.co/settings/mcp](https://huggingface.co/settings/mcp) to configure your MCP client and get started. Read the dedicated one‑page guide: [HF MCP Server](./hf-mcp-server).
2020

2121
<Tip warning={true}>
2222

@@ -234,4 +234,4 @@ with MCPClient(server_parameters) as tools:
234234
agent.run("Please find the latest research on COVID-19 treatment.")
235235
```
236236

237-
Learn more [in the documentation](https://huggingface.co/docs/smolagents/tutorials/tools#use-mcp-tools-with-mcpclient-directly).
237+
Learn more [in the documentation](https://huggingface.co/docs/smolagents/tutorials/tools#use-mcp-tools-with-mcpclient-directly).

docs/hub/hf-mcp-server.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# HF MCP Server
2+
3+
The Hugging Face MCP (Model Context Protocol) Server connects your MCP‑compatible AI assistant (for example Cursor, VS Code extensions, Zed, or Claude Desktop) directly to the Hugging Face Hub. Once connected, your assistant can search and explore Hub resources and use community tools, all from within your editor.
4+
5+
<Tip warning={true}>
6+
This feature is experimental and will continue to evolve.
7+
</Tip>
8+
9+
## What you can do
10+
11+
- Search and explore Hub resources: models, datasets, Spaces, and papers
12+
- Run community tools via MCP‑compatible Gradio apps hosted on Spaces
13+
- Bring results back into your assistant with metadata, links, and context
14+
15+
## Get started
16+
17+
1) Open your MCP settings: visit https://huggingface.co/settings/mcp while logged in.
18+
19+
2) Pick your client: select your MCP‑compatible client (for example Cursor, VS Code, Zed, Claude Desktop). The page shows client‑specific instructions and a ready‑to‑copy configuration snippet.
20+
21+
3) Paste and restart: copy the snippet into your client’s MCP configuration, save, and restart/reload the client. You should see “Hugging Face” (or similar) listed as a connected MCP server in your client.
22+
23+
<Tip>
24+
The settings page generates the exact configuration your client expects. Use it rather than writing config by hand.
25+
</Tip>
26+
27+
## Using the server
28+
29+
After connecting, ask your assistant to use the Hugging Face tools. Example prompts:
30+
31+
- “Search Hugging Face models for Llama‑3.1 fine‑tunes for summarization.”
32+
- “Find a Space that can transcribe audio files.”
33+
- “Show datasets about weather time‑series.”
34+
- “Look up papers on diffusion transformers and list recent ones.”
35+
36+
Your assistant will call MCP tools exposed by the HF MCP Server and return results (titles, owners, downloads, links, and so on). You can then open the resource on the Hub or continue iterating in the same chat.
37+
38+
## Add community tools (Gradio MCP)
39+
40+
You can extend your setup with MCP‑compatible Gradio apps built by the community:
41+
42+
- Explore Spaces with MCP support: https://huggingface.co/spaces?filter=mcp-server
43+
- Follow your client’s instructions to add an additional MCP server by URL, or use the prompts in https://huggingface.co/settings/mcp if available in your client’s card.
44+
45+
Gradio MCP apps expose their functions as tools (with arguments and descriptions) so your assistant can call them directly.
46+
47+
## Security and permissions
48+
49+
- Scoped access: the server uses your authenticated Hugging Face account to access Hub resources. You can review or revoke access anytime from your Hugging Face settings.
50+
- Least surprise: tools only perform actions you prompt them to do in your assistant; browsing and lookups are read‑only.
51+
- Privacy: results returned to your client are based on your account’s visibility and permissions (for example, private org content remains private).
52+
53+
## Troubleshooting
54+
55+
- Not showing up in client: re‑open https://huggingface.co/settings/mcp and re‑copy the configuration for your specific client, then restart the client.
56+
- Auth or 401/403 errors: ensure you are signed in on the Hugging Face website in the same browser/profile you used to open the settings page; if your client supports tokens, update them and try again.
57+
- Enterprise network issues: some clients use Server‑Sent Events (SSE) or websockets—ensure your network/proxy allows these connections.
58+
59+
## Learn more
60+
61+
- Settings and client setup: https://huggingface.co/settings/mcp
62+
- Changelog announcement: https://huggingface.co/changelog/hf-mcp-server
63+
- Agents on the Hub overview: ./agents
64+
- MCP spec and ecosystem: https://github.com/modelcontextprotocol/spec
65+

0 commit comments

Comments
 (0)