# Hugging Face

> Search, inspect, and run Hugging Face models and datasets from an agent.

[Canonical HTML page](https://top-mcps.com/mcp/huggingface) · [server.json](https://top-mcps.com/mcp/huggingface.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Paste under mcpServers. Fully quit and reopen Claude after editing.

```json
{
  "mcpServers": {
    "huggingface": {
      "command": "npx",
      "args": [
        "-y",
        "@huggingface/mcp-server"
      ],
      "env": {
        "HF_TOKEN": "${HF_TOKEN}"
      }
    }
  }
}
```

### Claude Code — `CLI or .mcp.json`

Run from your repo. Commit .mcp.json to share with your team.

```shell
# export HF_TOKEN=hf_your_token
claude mcp add huggingface -- npx -y @huggingface/mcp-server
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Reload window after editing.

```json
{
  "mcpServers": {
    "huggingface": {
      "command": "npx",
      "args": [
        "-y",
        "@huggingface/mcp-server"
      ],
      "env": {
        "HF_TOKEN": "${HF_TOKEN}"
      }
    }
  }
}
```

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key (not "mcpServers").

```jsonc
{
  "servers": {
    "huggingface": {
      "command": "npx",
      "args": [
        "-y",
        "@huggingface/mcp-server"
      ],
      "env": {
        "HF_TOKEN": "${HF_TOKEN}"
      }
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Open via Cascade → hammer icon → Configure.

```json
{
  "mcpServers": {
    "huggingface": {
      "command": "npx",
      "args": [
        "-y",
        "@huggingface/mcp-server"
      ],
      "env": {
        "HF_TOKEN": "${HF_TOKEN}"
      }
    }
  }
}
```

### Cline — `cline_mcp_settings.json`

Open via the Cline sidebar → MCP Servers → Edit.

```json
{
  "mcpServers": {
    "huggingface": {
      "command": "npx",
      "args": [
        "-y",
        "@huggingface/mcp-server"
      ],
      "env": {
        "HF_TOKEN": "${HF_TOKEN}"
      }
    }
  }
}
```

### Continue — `~/.continue/config.json`

Continue uses modelContextProtocolServers with a transport block.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": [
            "-y",
            "@huggingface/mcp-server"
          ],
          "env": {
            "HF_TOKEN": "${HF_TOKEN}"
          }
        }
      }
    ]
  }
}
```

### Codex CLI — `~/.codex/config.toml`

Codex uses TOML. Each server is a [mcp_servers.<name>] subtable.

```shell
# ~/.codex/config.toml
[mcp_servers.huggingface]
command = "npx"
args = [
  "-y",
  "@huggingface/mcp-server",
]
env = { HF_TOKEN = "${HF_TOKEN}" }
```

### Zed — `~/.config/zed/settings.json`

Zed calls them "context_servers". Settings live-reload on save.

```jsonc
{
  "context_servers": {
    "huggingface": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "@huggingface/mcp-server"
        ]
      },
      "env": {
        "HF_TOKEN": "${HF_TOKEN}"
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Settings → Connectors → Developer mode`

Enable Developer mode (paid plans) and enter these values in the UI.

```json
{
  "name": "Hugging Face",
  "transport": "stdio",
  "command": "npx",
  "args": [
    "-y",
    "@huggingface/mcp-server"
  ],
  "env": {
    "HF_TOKEN": "${HF_TOKEN}"
  }
}
```

## At a glance

- **Maintainer:** Hugging Face
- **Transport:** stdio
- **Auth model:** API key
- **Required secrets:** HF_TOKEN
- **Supported clients:** Claude, Cursor, Any MCP-compatible client
- **License:** Apache-2.0
- **Language:** TypeScript
- **Latest version:** latest
- **Last verified:** 2026-04-19
- **GitHub stars:** 220 (fetched 2026-04-19T20:32:56.685Z)
- **Score:** 75/100 (rubric 2026-04 — see https://top-mcps.com/about/methodology)
- **Source:** https://github.com/huggingface/hf-mcp-server

## Security & scope

- **Access scope:** network
- **Sandbox:** Public-read access to the Hugging Face Hub; optional write access to spaces/models if a token with write scope is set in env.
- **Gotchas:**
  - Gated models require the authenticated account to have accepted the gate — the MCP does not auto-click through.

## Quick answer

**What it does.** Exposes Hugging Face Hub search, model metadata, dataset info, and the Inference API as MCP tools.

**Best for:**
- Model discovery and triage
- License + card lookups
- Experimental inference
- Dataset exploration
- ML catalog summaries

**Not for:**
- Production inference traffic
- Private enterprise models without access

## Recipes

### Find candidate open-source models for a task

```
Find the 3 most-downloaded open-source text-to-image models under 10B parameters released in the last 12 months. For each return: model id, license, parameter count, and one-sentence description.
```

_Tested with: Claude Desktop, Cursor_

## Description

The Hugging Face MCP brings the Hub into the agent loop. Search the 1M+ model catalog, read model cards, run inference via the free Inference API, and explore datasets — everything you would open huggingface.co for, inside your client.

## Why it matters

Agents benefit from knowing which model to use for a task. Direct Hub access lets them research options, compare cards, and actually invoke a model without leaving the conversation.

## Key features

- Hub search across models, datasets, spaces
- Free Inference API integration
- Model-card + license reads
- Trending-models feed
- Community-maintained

## FAQ

### Is the Inference API free?

There is a free tier with rate limits suitable for experimentation. Paid Inference Endpoints provide dedicated, production-ready inference when you need throughput and latency guarantees.

### Which models can it invoke?

Any public model on the Hub that has an "Inference API" widget on its model card — roughly tens of thousands of popular models. Gated and private models require the token user to have access.

### Can agents discover the right model for a task?

Yes. The search tool supports task filters ("text-classification", "image-segmentation") and sorts by downloads/likes, which is usually a decent proxy for "known to work". Agents pick well when given the task type and a size constraint.

### Does it work with private organization models?

Yes if your token has access. The MCP inherits whatever the HF_TOKEN user can see — organization-scoped tokens with read access to private model repos are the right choice for enterprise workflows.

## Changelog

- **2026-04-19** — Refreshed install snippets and fact sheet; verified for 2026.
- **2025-04-05** — Initial directory listing.
