# Repository Briefing: huggingface/hf-mcp-server
> Source: https://repoforai.com/repo/huggingface/hf-mcp-server (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/huggingface/hf-mcp-server
- **Official Docs / Website**: https://huggingface.co/mcp
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A+ (93/100 · Maintenance 35/35 · Adoption 18/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.5.3 (2026-12-02) — https://github.com/huggingface/hf-mcp-server/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Docker, Self-Hosted, MCP, CLI, API
- **Momentum**: 326 ★ total (+0 24h / +2 7d) · 110 forks
- **When to Use**: Best for: Teams that want MCP clients to discover Hub resources, invoke selected Gradio tools, or inspect Jobs with Hugging Face permissions enforced at tool registration. Skip if: You need offline inference, a general-purpose model-serving runtime, or a fixed set of Hub API calls that application code can make directly.

## Overview
```text
### Architecture & Core Mechanics
This TypeScript pnpm workspace separates Hub API and search tool implementations in packages/mcp from the MCP server and web application in packages/app. The same integration is available as a STDIO subprocess or as stateless Streamable HTTP JSON at /mcp. The web app serves /metrics, and HTTP deployments publish a server card at /mcp/server-card with ETag-based revalidation. On HTTP, tool exposure follows the caller's resolved Hugging Face token permissions rather than a process-wide default token.

The tool surface extends beyond built-in Hub operations to Gradio Spaces and upstream MCP servers. PROXY_TOOLS_CSV accepts a local path or HTTPS URL; at startup the server runs initialize and tools/list against each configured endpoint with a 10-second timeout and skips sources that fail or return no tools. The gateway can consume upstream SSE or JSON responses without changing its own direct JSON-RPC response mode. Schema discovery uses a separate optional PROXY_TOKEN; forwarding the caller's token during calls and MCP App resource reads is a per-source policy.

### Key Capabilities & Differentiators
The server gives MCP clients a tool interface to Hub search and APIs and access to Gradio applications. Anonymous callers receive read-only discovery. Authenticated callers can receive write, repository-creation, Jobs, or Sandbox tools as their scopes permit. One meaningful least-privilege distinction is Jobs: the legacy combined hf_jobs tool requires Jobs write capability, whereas ?bouquet=ptc exposes hf_jobs_list, hf_job_get, and hf_job_logs to read-only tokens.

The management UI covers server status and MCP method metrics. Its Skills tab separates metadata probes from successful reads of SKILL.md and supporting files; a read is not evidence of execution or complete installation. The live view is process-local, capped at 10,000 events and 24 hours, and currently covers Streamable HTTP JSON. A separate Events view tracks SEP-3415 capability advertisement, listing, and polling outcomes. For catalog operators, the Python 3 dynamic-Space health check inspects Hub runtime state and Gradio MCP schemas without invoking tools or waking sleeping Spaces by default.

### Trade-offs & Limitations
Compared with calling the Hub API directly, this server removes the need to build a separate tool integration for each MCP client. In exchange, integrators must account for transport compatibility, token-dependent tool discovery, and the availability of configured upstreams. Compared with the hosted Hugging Face endpoint, self-hosting gives operators control over host policy, proxy sources, and telemetry exposure, but also transfers responsibility for TLS, access control, credentials, and upgrades. It does not turn the Hub or Spaces into an offline stack.

Two defaults deserve an explicit deployment decision. HTTP allows anonymous discovery by default; MCP_STRICT_TOKEN=true requires a token, rejects invalid tokens with 401, and returns 503 when validation is unavailable. Separately, proxy token forwarding defaults to true for compatibility; disable it for any upstream that does not need the caller's Hugging Face credential. The optional metrics password is a shared gate without user roles, rate limiting, or an audit trail. Use platform or reverse-proxy controls for management access rather than relying on that password alone.

### Hardware & Deployment Guide
The lowest-maintenance path is https://huggingface.co/mcp. For a local client subprocess, use npx @llmindset/hf-mcp-server; for local stateless HTTP, use npx @llmindset/hf-mcp-server-http. Docker defaults to HTTP on port 3000, with /mcp for clients and /metrics for operators. The supplied Dockerfile uses node:24.22.3-alpine, tini, Corepack, and a frozen-lockfile pnpm install. Source builds use the Corepack-managed pnpm 10.12.3 workflow with pnpm install and pnpm build.

For shared HTTP deployments, set MCP_ALLOWED_HOSTS for the intended hostnames, decide whether anonymous discovery should be available, and protect management routes at the reverse proxy or platform. DEFAULT_HF_TOKEN and the HF_TOKEN fallback apply to STDIO only. Local hosting moves the gateway, not the Hub or remote tool execution, so plan for upstream connectivity rather than local inference hardware. Release v0.5.1 aligned Hub Link pagination, FUSE volume rules, and Job log streaming; v0.5.2 added MCP Events tracking and a dashboard tab; v0.5.3 updated the inference-provider examples for hf_models_search.
```

## Key Capabilities
```text
- Transport: STDIO and stateless Streamable HTTP JSON; HTTP uses /mcp and publishes a revalidatable server card at /mcp/server-card.
- Authorization: Anonymous callers receive read-only discovery; authenticated tool visibility follows resolved Hugging Face token scopes and permissions.
- Job inspection: The ?bouquet=ptc profile exposes hf_jobs_list, hf_job_get, and hf_job_logs to read-only tokens; the legacy combined hf_jobs tool requires Jobs write access.
- Proxy isolation: PROXY_TOKEN serves startup schema discovery, while per-source forward_hf_token controls whether the caller's credential goes upstream.
- Observability: Skills metrics distinguish metadata probes from content reads and retain at most 10,000 live events within a 24-hour window; process restart clears that view.
- Deployment: Hosted MCP, separate npx launchers for STDIO and HTTP, and a Docker image that defaults to HTTP on port 3000.
```

## Quick Start / Clone
```bash
npx @llmindset/hf-mcp-server       # Start in STDIO mode
npx @llmindset/hf-mcp-server-http  # Start in stateless Streamable HTTP JSON mode
```
