|
1 | 1 | # Hugging Face Official MCP Server
|
2 | 2 |
|
3 |
| -## Getting Started |
| 3 | +Welcome to the official Hugging Face MCP Server 🤗. Connect your LLM to the Hugging Face Hub and thousands of Gradio AI Applications. |
4 | 4 |
|
5 |
| -This repository contains the offical Hugging Face MCP Server source. The server supports multiple deployment and configuration options, and is deployable locally as well as on your own infrastructure. |
| 5 | +## Installing the MCP Server |
6 | 6 |
|
7 |
| -The easiest way to access Hugging Face MCP Services is via `https://hf.co/mcp` which offers a number of Tools, Prompts and access to Gradio Spaces which are configurable at `https://hf.co/settings/mcp`. |
| 7 | +Follow the instructions below to get started: |
8 | 8 |
|
9 | 9 | 
|
10 | 10 |
|
11 |
| -Anonymous access is supported with a default set of Tools and Prompts, or use a Hugging Face READ token to customize your settings: |
| 11 | +<details> |
| 12 | +<summary>Install in <b>Claude Desktop</b> or <b>claude.ai</b></summary> |
| 13 | +<br /> |
| 14 | + |
| 15 | +Click [here](https://claude.ai/redirect/website.v1.67274164-23df-4883-8166-3c93ced276be/directory/37ed56d5-9d61-4fd4-ad00-b9134c694296) to add the Hugging Face connector to your account. |
| 16 | + |
| 17 | +Alternatively, navigate to [https://claude.ai/settings/connectors](https://claude.ai/settings/connectors), and add "Hugging Face" from the gallery. |
| 18 | + |
| 19 | +<img src='docs/claude-badge.png' /> |
| 20 | + |
| 21 | +</details> |
12 | 22 |
|
13 | 23 | <details>
|
14 |
| -<summary>Install in <b>Claude Desktop</b></summary> |
| 24 | +<summary>Install in <b>Claude Code</b></summary> |
15 | 25 | <br />
|
16 |
| -For <b>Claude Desktop</b> (via MCP Remote) (in your `mcpServers` section): |
| 26 | + |
| 27 | +Enter the command below to install in <b>Claude Code></b>: |
| 28 | + |
| 29 | +```bash |
| 30 | +claude mcp add hf-mcp-server -t http https://huggingface.co/mcp?login |
| 31 | +``` |
| 32 | + |
| 33 | +```bash |
| 34 | +claude mcp add hf-mcp-server \ |
| 35 | + -t http https://huggingface.co/mcp \ |
| 36 | + -H "Authorization: Bearer <YOUR_HF_TOKEN>" |
| 37 | +``` |
| 38 | + |
| 39 | + |
| 40 | +</details> |
| 41 | + |
| 42 | +<details> |
| 43 | + |
| 44 | +<summary>Install in <b>VSCode</b></summary> |
| 45 | +<br /> |
| 46 | + |
| 47 | +Click <a href="vscode:mcp/install?%7B%22name%22%3A%22huggingface%22%2C%22gallery%22%3Atrue%2C%22url%22%3A%22https%3A%2F%2Fhuggingface.co%2Fmcp%3Flogin%22%7D">here</a> to add the Hugging Face connector directly to VSCode. Alternatively, install from the gallery at [https://code.visualstudio.com/mcp](https://code.visualstudio.com/mcp): |
| 48 | + |
| 49 | +Alternatively, navigate to the VSCode [MCP Servers for agent mode](https://code.visualstudio.com/mcp) directory, and <a href="foo">click</a> "Install Hugging Face". |
| 50 | + |
| 51 | +If you prefer to use configure manually or prefer to use an auth token, use the snippet below in your mcp.json configuration: |
| 52 | + |
| 53 | +<img src='docs/vscode-badge.png' /> |
17 | 54 |
|
18 | 55 | ```JSON
|
19 |
| -"Hugging Face": { |
20 |
| - "command": "npx", |
21 |
| - "args": [ |
22 |
| - "-y","mcp-remote", |
23 |
| - "https://hf.co/mcp", |
24 |
| - "--header", "Authorization:${AUTH_HEADER}" |
25 |
| - ], |
26 |
| - "env": { |
27 |
| - "AUTH_HEADER": "Bearer <YOUR_HF_TOKEN>" |
| 56 | +"huggingface": { |
| 57 | + "url": "https://huggingface.co/mcp", |
| 58 | + "headers": { |
| 59 | + "Authorization": "Bearer <YOUR_HF_TOKEN>" |
28 | 60 | }
|
29 |
| -} |
30 | 61 | ```
|
| 62 | + |
31 | 63 | </details>
|
32 | 64 |
|
33 | 65 | <details>
|
34 |
| - |
35 |
| -<summary>Install in <b>VSCode</b> or <b>Cursor</b></summary> |
| 66 | +<summary>Install in <b>Cursor</b></summary> |
36 | 67 | <br />
|
37 |
| -For <b>VSCode</b> and <b>Cursor</b> (in your `mcp/servers`or `mcpServers` section respectively): |
38 | 68 |
|
39 |
| -If you prefer to use OAuth, use `https://hf.co/mcp?login` |
| 69 | +Click <a href="https://cursor.com/en/install-mcp?name=Hugging%20Face&config=eyJ1cmwiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvL21jcD9sb2dpbiJ9">here</a> to install the Hugging Face MCP Server directly in <b>Cursor</b>. |
| 70 | + |
| 71 | +If you prefer to use configure manually or specify an Authorization Token, use the snippet below: |
40 | 72 |
|
41 | 73 | ```JSON
|
42 |
| -"hf-mcp-server": { |
43 |
| - "url": "https://hf.co/mcp", |
| 74 | +"huggingface": { |
| 75 | + "url": "https://huggingface.co/mcp", |
44 | 76 | "headers": {
|
45 | 77 | "Authorization": "Bearer <YOUR_HF_TOKEN>"
|
46 | 78 | }
|
47 | 79 | ```
|
48 | 80 | </details>
|
49 | 81 |
|
50 |
| -For **claude.ai** enter `https://hf.co/mcp` from the "Add Integrations" dropdown menu. Claude does not currently support the MCP 2025-06-18 OAuth standard so is limited to anonymous access. |
| 82 | + |
| 83 | +https://cursor.com/en/install-mcp?name=Hugging%20Face&config=eyJ1cmwiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvL21jcD9sb2dpbiJ9 |
51 | 84 |
|
52 | 85 | ## Quick Guide (Repository Packages)
|
53 | 86 |
|
|
0 commit comments