{"id":33899865,"url":"https://github.com/huggingface/hf-mcp-server","last_synced_at":"2026-02-23T19:18:39.279Z","repository":{"id":292242354,"uuid":"978636614","full_name":"huggingface/hf-mcp-server","owner":"huggingface","description":"Hugging Face MCP Server","archived":false,"fork":false,"pushed_at":"2026-02-16T17:10:47.000Z","size":1845,"stargazers_count":192,"open_issues_count":9,"forks_count":53,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-02-17T00:28:38.250Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://huggingface.co/mcp","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/huggingface.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2025-05-06T09:38:37.000Z","updated_at":"2026-02-16T16:29:28.000Z","dependencies_parsed_at":"2025-05-26T20:21:17.699Z","dependency_job_id":"a87977dc-88ff-471e-b59c-77d028a8ecb3","html_url":"https://github.com/huggingface/hf-mcp-server","commit_stats":null,"previous_names":["evalstate/hf-mcp-server","huggingface/hf-mcp-server"],"tags_count":94,"template":false,"template_full_name":null,"purl":"pkg:github/huggingface/hf-mcp-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fhf-mcp-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fhf-mcp-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fhf-mcp-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fhf-mcp-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/huggingface","download_url":"https://codeload.github.com/huggingface/hf-mcp-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/huggingface%2Fhf-mcp-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29750053,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-11T22:12:51.948Z","updated_at":"2026-02-23T19:18:39.274Z","avatar_url":"https://github.com/huggingface.png","language":"TypeScript","funding_links":[],"categories":["MCP Servers for Creative Work","📚 Projects (1974 total)","Servers"],"sub_categories":["Image, Video, Audio Generation","MCP Servers","AI \u0026 ML"],"readme":"# Hugging Face Official MCP Server \n\n\u003cimg src='https://github.com/evalstate/hf-mcp-server/blob/main/hf-logo.svg' width='100'\u003e\n\nWelcome to the official Hugging Face MCP Server 🤗. Connect your LLM to the Hugging Face Hub and thousands of Gradio AI Applications.\n\n## Installing the MCP Server\n\nFollow the instructions below to get started:\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall in \u003cb\u003eClaude Desktop\u003c/b\u003e or \u003cb\u003eclaude.ai\u003c/b\u003e\u003c/summary\u003e\n\u003cbr /\u003e\n\nClick [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. \n\nAlternatively, navigate to [https://claude.ai/settings/connectors](https://claude.ai/settings/connectors), and add \"Hugging Face\" from the gallery.\n\n\u003cimg src='docs/claude-badge.png' width='50%' align='center' /\u003e\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall in \u003cb\u003eClaude Code\u003c/b\u003e\u003c/summary\u003e\n\u003cbr /\u003e\n\nEnter the command below to install in \u003cb\u003eClaude Code\u003c/b\u003e:\n\n```bash\nclaude mcp add hf-mcp-server -t http https://huggingface.co/mcp?login\n```\n\nThen start `claude` and follow the instructions to complete authentication.\n\n```bash\nclaude mcp add hf-mcp-server \\\n  -t http https://huggingface.co/mcp \\\n  -H \"Authorization: Bearer \u003cYOUR_HF_TOKEN\u003e\"\n```\n\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall in \u003cb\u003eGemini CLI\u003c/b\u003e\u003c/summary\u003e\n\u003cbr /\u003e\n\nEnter the command below to install in \u003cb\u003eGemini CLI\u003c/b\u003e:\n\n```bash\ngemini mcp add -t http huggingface https://huggingface.co/mcp?login\n```\n\nThen start `gemini` and follow the instructions to complete authentication.\n\nThere is also a HuggingFace Gemini CLI extension that bundles the MCP server\nwith a context file and custom commands, teaching Gemini how to better use\nall MCP tools.\n\n```bash\ngemini extensions install https://github.com/huggingface/hf-mcp-server\n```\n\nStart `gemini` and run `/mcp auth huggingface` to authenticate the extension.\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eInstall in \u003cb\u003eVSCode\u003c/b\u003e\u003c/summary\u003e\n\u003cbr /\u003e\n\nClick \u003ca 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\"\u003ehere\u003c/a\u003e 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): \n\n\u003cimg src='docs/vscode-badge.png' width='50%' align='center' /\u003e\n\nIf you prefer to configure manually or use an auth token, add the snippet below to your `mcp.json` configuration:\n\n\n```JSON\n\"huggingface\": {\n    \"url\": \"https://huggingface.co/mcp\",\n    \"headers\": {\n        \"Authorization\": \"Bearer \u003cYOUR_HF_TOKEN\u003e\"\n    }\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eInstall in \u003cb\u003eCursor\u003c/b\u003e\u003c/summary\u003e\n\u003cbr /\u003e\n\nClick \u003ca href=\"https://cursor.com/en/install-mcp?name=Hugging%20Face\u0026config=eyJ1cmwiOiJodHRwczovL2h1Z2dpbmdmYWNlLmNvL21jcD9sb2dpbiJ9\"\u003ehere\u003c/a\u003e to install the Hugging Face MCP Server directly in \u003cb\u003eCursor\u003c/b\u003e. \n\nIf you prefer to use configure manually or specify an Authorization Token, use the snippet below:\n\n```JSON\n\"huggingface\": {\n    \"url\": \"https://huggingface.co/mcp\",\n    \"headers\": {\n        \"Authorization\": \"Bearer \u003cYOUR_HF_TOKEN\u003e\"\n    }\n```\n\u003c/details\u003e\n\nOnce installed, navigate to https://huggingface.co/settings/mcp to configure your Tools and Spaces.\n\n\u003e [!TIP]\n\u003e Add ?no_image_content=true to the URL to remove ImageContent blocks from Gradio Servers.\n\n\n![hf_mcp_server_small](https://github.com/user-attachments/assets/d30f9f56-b08c-4dfc-a68f-a164a93db564)\n\n\n## Quick Guide (Repository Packages)\n\nThis repo contains:\n\n - (`/mcp`) MCP Implementations of Hub API and Search endpoints for integration with MCP Servers. \n - (`/app`) An MCP Server and Web Application for deploying endpoints.\n\n### MCP Server\n\nThe following transports are supported:\n\n- STDIO \n- StreamableHTTP\n- StreamableHTTP in Stateless JSON Mode (**StreamableHTTPJson**)\n\nThe Web Application and HTTP Transports start by default on Port 3000.\n\nThe StreamableHTTP service is available at `/mcp`. Although though not strictly enforced by the specification this is common convention.\n\n\u003e [!TIP]\n\u003e The Web Application allows you to switch tools on and off. For STDIO and StreamableHTTP this will send a ToolListChangedNotification to the MCP Client. In StreamableHTTPJSON mode the tool will not be listed when the client next requests the tool lists.\n\n### Running Locally\n\nYou can run the MCP Server locally with either `npx` or `docker`. \n\n```bash\nnpx @llmindset/hf-mcp-server       # Start in STDIO mode\nnpx @llmindset/hf-mcp-server-http  # Start in Streamable HTTP mode\nnpx @llmindset/hf-mcp-server-json  # Start in Streamable HTTP (JSON RPC) mode\n```\n\nTo run with docker: \n\n```bash\ndocker pull ghcr.io/evalstate/hf-mcp-server:latest\ndocker run --rm -p 3000:3000 ghcr.io/evalstate/hf-mcp-server:latest\n```\n![image](https://github.com/user-attachments/assets/2fc0ef58-2c7a-4fae-82b5-e6442bfcbd99)\n\nAll commands above start the Management Web interface on http://localhost:3000/. The Streamable HTTP server is accessible on  http://localhost:3000/mcp. See [Environment Variables](#Environment Variables) for configuration options. Docker defaults to Streamable HTTP (JSON RPC) mode.\n\n### Developing OpenAI Apps SDK Components\n\nTo build and test the Apps SDK component, run \n\n```bash\ncd packages/app\nnpm run dev:widget\n```\n\nThen open `http://localhost:5173/gradio-widget-dev.html`. This will bring up a browser with HMR where you can send Structured Content to the components for testing. \n\n![skybridge-viewer](./docs/skybridge-dev.png)\n\n\n## Development\n\nThis project uses `pnpm` for build and development. Corepack is used to ensure everyone uses the same pnpm version (10.12.3).\n\n```bash\n# Install dependencies\npnpm install\n\n# Build all packages\npnpm build\n```\n\n### Build Commands\n\n`pnpm run clean` -\u003e clean build artifacts\n\n`pnpm run build` -\u003e build packages\n\n`pnpm run start` -\u003e start the mcp server application\n\n`pnpm run buildrun` -\u003e clean, build and start\n\n`pnpm run dev` -\u003e concurrently watch `mcp` and start dev server with HMR\n\n\n## Docker Build\n\nBuild the image:\n```bash\ndocker build -t hf-mcp-server .\n```\n\nRun with default settings (Streaming HTTP JSON Mode), Dashboard on Port 3000:\n```bash\ndocker run --rm -p 3000:3000 -e DEFAULT_HF_TOKEN=hf_xxx hf-mcp-server\n```\n\nRun STDIO MCP Server:\n```bash\ndocker run -i --rm -e TRANSPORT=stdio -p 3000:3000 -e DEFAULT_HF_TOKEN=hf_xxx hf-mcp-server\n```\n\n`TRANSPORT` can be `stdio`, `streamableHttp` or `streamableHttpJson` (default).\n\n### Transport Endpoints\n\nThe different transport types use the following endpoints:\n- Streamable HTTP: `/mcp` (regular or JSON mode)\n- STDIO: Uses stdin/stdout directly, no HTTP endpoint\n\n### Stateful Connection Management\n\nThe `streamableHttp` transport is _stateful_ - it maintains a connection with the MCP Client through an SSE connection. When using this transport, the following configuration options take effect:\n\n| Environment Variable              | Default | Description |\n|-----------------------------------|---------|-------------|\n| `MCP_CLIENT_HEARTBEAT_INTERVAL`   | 30000ms | How often to check connection health |\n| `MCP_CLIENT_CONNECTION_CHECK`     | 90000ms | How often to check for stale sessions |\n| `MCP_CLIENT_CONNECTION_TIMEOUT`   | 300000ms | Remove sessions inactive for this duration |\n| `MCP_PING_ENABLED`                | true    | Enable ping keep-alive for sessions |\n| `MCP_PING_INTERVAL`               | 30000ms | Interval between ping cycles | \n\n\n### Environment Variables\n\nThe server respects the following environment variables:\n- `TRANSPORT`: The transport type to use (stdio, streamableHttp, or streamableHttpJson)\n- `DEFAULT_HF_TOKEN`: ⚠️ Requests are serviced with the HF_TOKEN received in the Authorization: Bearer header. The DEFAULT_HF_TOKEN is used if no header was sent. Only set this in Development / Test environments or for local STDIO Deployments. ⚠️\n- If running with `stdio` transport, `HF_TOKEN` is used if `DEFAULT_HF_TOKEN` is not set.\n- `HF_API_TIMEOUT`: Timeout for Hugging Face API requests in milliseconds (default: 12500ms / 12.5 seconds)\n- `USER_CONFIG_API`: URL to use for User settings (defaults to Local front-end)\n- `ALLOW_INTERNAL_ADDRESS_HOSTS`: Optional comma-separated host allowlist to permit internal/reserved DNS resolutions for trusted domains during outbound checks (supports exact hosts and `*.` wildcards, for example: `huggingface.co,*.hf.space`).\n- `MCP_STRICT_COMPLIANCE`: set to True for GET 405 rejects in JSON Mode (default serves a welcome page).\n- `AUTHENTICATE_TOOL`: whether to include an `Authenticate` tool to issue an OAuth challenge when called\n- `SEARCH_ENABLES_FETCH`: When set to `true`, automatically enables the `hf_doc_fetch` tool whenever `hf_doc_search` is enabled\n- `PROXY_TOOLS_CSV`: Optional CSV that defines Streamable HTTP proxy tool sources (see below).\n- `GRADIO_SKIP_INITIALIZE`: When set to `true`, Gradio MCP calls skip the `initialize` handshake and issue `tools/call` directly.\n\n### Proxy tools (Streamable HTTP via CSV)\n\nYou can load proxy tool definitions at startup by setting `PROXY_TOOLS_CSV` to a **HTTPS URL** or a **local file path**.\nThe server fetches each MCP endpoint once on startup, runs `initialize` + `tools/list` (10s timeout), and registers any tools returned.\nIf a source fails or returns no tools, it is skipped (no startup failure).\n\n**CSV format**\n\n```\nproxy_id,url,response_type\npapers,https://evalstate-hf-papers.hf.space/mcp,SSE\nnews,https://example.com/mcp,JSON\n```\n\n- `proxy_id`: identifier used to disambiguate tools.\n- `url`: Streamable HTTP MCP endpoint.\n- `response_type`: `SSE` (streamed response) or `JSON` (direct JSON-RPC response).\n\n**Tool naming**\n\n- Single source: tool names are **unchanged** (taken from the downstream server).\n- Multiple sources: tool names are **prefixed** with `proxy_id_` (e.g. `papers_hf-papers-search_send`).\n\nYou can include these tool names in bouquets or mixes as needed.\nUse `bouquet=proxy` or `mix=proxy` to enable all proxy tools loaded from `PROXY_TOOLS_CSV` (in addition to the base built-in tools).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Fhf-mcp-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhuggingface%2Fhf-mcp-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhuggingface%2Fhf-mcp-server/lists"}