如何将 Hugging Face 远程 MCP 连接到 Kiro
约 1 分钟即可把 Hugging Face 的远程 MCP 服务端接入 Kiro。如需排查 OAuth / 401 问题,可先用 OAuth 2.1 调试器体检端点。
🔒 Client-side only — never leaves your browser.
Or add to ~/.cursor/mcp.json:
{
"mcpServers": {
"huggingface": {
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}claude mcp add --transport http huggingface https://huggingface.co/mcp
With credential header:
claude mcp add --transport http huggingface https://huggingface.co/mcp --header "Authorization: Bearer YOUR_API_KEY"
Or add to .vscode/mcp.json:
{
"servers": {
"huggingface": {
"type": "http",
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}- Open Settings → Connectors (Integrations) → Add Custom Connector.
- Paste the endpoint URL:
https://huggingface.co/mcp - Provide your API key / Bearer token when prompted.
Bridge the remote endpoint into stdio with mcp-remote in claude_desktop_config.json:
{
"mcpServers": {
"huggingface": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://huggingface.co/mcp",
"--header",
"Authorization: Bearer YOUR_API_KEY"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"huggingface": {
"serverUrl": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to ~/.kiro/settings/mcp.json (or .kiro/settings/mcp.json in your workspace), then reopen Kiro's Agent panel to pick up the server:
{
"mcpServers": {
"huggingface": {
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to ~/.codex/config.toml — Codex reads remote HTTP servers from [mcp_servers.*] tables:
[mcp_servers.huggingface] url = "https://huggingface.co/mcp" bearer_token_env_var = "HUGGINGFACE_TOKEN"
Add to cline_mcp_settings.json (Cline → MCP Servers → Configure), or paste it via Cline's MCP marketplace file:
{
"mcpServers": {
"huggingface": {
"type": "streamableHttp",
"url": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}Add to ~/.gemini/settings.json under mcpServers — httpUrl for Streamable HTTP, url for legacy SSE:
{
"mcpServers": {
"huggingface": {
"httpUrl": "https://huggingface.co/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}接入步骤
- 打开 MCP 配置 — Kiro → MCP 面板,或编辑工作区
.kiro/settings/mcp.json。 - 添加服务端 — 写入
"huggingface": { "url":https://huggingface.co/mcp}。 - 完成认证 — 在 Hugging Face 控制台获取凭据,并将其作为
Authorization: Bearer <密钥>请求头加入配置。 - 验证 — 在 在线 Inspector 中粘贴
https://huggingface.co/mcp并运行 initialize + tools/list 验证连通性。
🧰 工具预览(12)
| Tool | Safety | Description | Parameters |
|---|---|---|---|
| hf_doc_search ~31 tok | 🟢 Read | Search Hugging Face documentation. | — |
| hf_doc_fetch ~30 tok | 🟢 Read | Fetch a Hugging Face docs page. | — |
| model_search ~29 tok | 🟢 Read | Search models on the Hub. | — |
| dataset_search ~30 tok | 🟢 Read | Search datasets on the Hub. | — |
| space_search ~29 tok | 🟢 Read | Search Spaces on the Hub. | — |
| paper_search ~29 tok | 🟢 Read | Search papers on the Hub. | — |
| hub_repo_details ~31 tok | 🟢 Read | Get details of a Hub repository. | — |
| hf_whoami ~29 tok | 🟢 Read | Get the authenticated HF user. | — |
| space_info ~28 tok | 🟢 Read | Get details of a Space. | — |
| use_space ~28 tok | 🟠 Write | Call a Hugging Face Space. | — |
| model_info ~27 tok | 🟢 Read | Get model card info. | — |
| dataset_info ~28 tok | 🟢 Read | Get dataset card info. | — |