Skip to content

Commit e78a1d5

Browse files
Vaibhavs10burtenshawpcuenca
authored
[Documentation] HF MCP Server (#1938)
* [Documentation] HF MCP Server * up. * reorganise + add images. * Apply suggestions from code review Co-authored-by: burtenshaw <[email protected]> * review. * review + last edits. * Update docs/hub/hf-mcp-server.md Co-authored-by: Pedro Cuenca <[email protected]> * last edits. * Update docs/hub/hf-mcp-server.md --------- Co-authored-by: burtenshaw <[email protected]> Co-authored-by: Pedro Cuenca <[email protected]>
1 parent 9e254f9 commit e78a1d5

File tree

3 files changed

+60
-3
lines changed

3 files changed

+60
-3
lines changed

docs/hub/_toctree.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,8 @@
436436
title: "JFrog"
437437
- local: agents
438438
title: Agents on Hub
439+
- local: hf-mcp-server
440+
title: Hugging Face MCP Server
439441
- local: moderation
440442
title: Moderation
441443
- local: paper-pages

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: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Hugging Face MCP Server
2+
3+
The Hugging Face MCP (Model Context Protocol) Server connects your MCP‑compatible AI assistant (for example Codex, Cursor, VS Code extensions, Zed, ChatGPT 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, chat or CLI.
4+
5+
## What you can do
6+
7+
- Search and explore Hub resources: models, datasets, Spaces, and papers.
8+
- Run community tools via MCP‑compatible Gradio apps hosted on [Spaces](https://hf.co/spaces).
9+
- Bring results back into your assistant with metadata, links, and context.
10+
11+
## Get started
12+
13+
1. Open your MCP settings: visit https://huggingface.co/settings/mcp while logged in.
14+
15+
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.
16+
17+
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.
18+
19+
<Tip>
20+
21+
The settings page generates the exact configuration your client expects. Use it rather than writing config by hand.
22+
23+
</Tip>
24+
25+
![MCP Settings Example](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hf-mcp-settings.png)
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 Qwen 3 Quantizatizations.”
32+
- “Find a Space that can transcribe audio files.”
33+
- “Show datasets about weather time‑series.”
34+
- “Create a 1024 x 1024 image of a cat ghibli style.”
35+
36+
Your assistant will call MCP tools exposed by the Hugging Face MCP Server (including Spaces) 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+
![HF MCP with Spaces in VS Code](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hf-mcp-vscode.png)
39+
40+
## Add community tools (Spaces)
41+
42+
You can extend your setup with MCP‑compatible Gradio spaces built by the community:
43+
44+
- Explore Spaces with MCP support [here](https://huggingface.co/spaces?filter=mcp-server).
45+
- Add the relevant space in your MCP settings on Hugging Face [here](https://huggingface.co/settings/mcp).
46+
47+
Gradio MCP apps expose their functions as tools (with arguments and descriptions) so your assistant can call them directly. Please, restart or refresh your client so it picks up new tools you add.
48+
49+
## Learn more
50+
51+
- Settings and client setup: https://huggingface.co/settings/mcp
52+
- Changelog announcement: https://huggingface.co/changelog/hf-mcp-server
53+
- Hugging Face MCP Server: https://huggingface.co/mcp
54+
- Build your own MCP Server with Gradio Spaces: https://www.gradio.app/guides/building-mcp-server-with-gradio
55+

0 commit comments

Comments
 (0)