
MCP服务器可使用HuggingFace空间、简易配置和Claude桌面模式。
概览
你可以直接在 https://hf.co/mcp, 访问和配置 Hugging Face MCP 服务,包括 Gradio 空间。该项目已被官方 Hugging Face MCP 服务器和 Gradio MCP 端点取代。或者,你也可以作为本地 STDIO 服务器运行 hf-mcp-server,或支持强力支持 SSE、流式 HTTP 和流式 HTTP JSON 模式。它还运行本地界面用于选择工具和端点,并支持 ToolListChangedNotifications。 请点击这里阅读导言 llmindset.co.uk/resources/mcp-hfspace/ 只需少设置即可连接 Hugging Face Spaces——只需添加你的空间即可! 默认情况下,它连接到 black-forest-labs/FLUX.1-schnell 为 Claude Desktop 提供图像生成功能。 Gradio 5.28 现在通过 SSE 集成了 MCP 支持:https://huggingface.co/blog/gradio-mcp. 查看你的目标空间是否支持 MCP!
概述(AI 翻译)
[!提示]
你可以直接在https://hf.co/mcp,访问和配置Hugging Face MCP服务,包括Gradio空间。
该项目已被官方 Hugging Face MCP 服务器和 Gradio MCP 终端取代。
或者,您也可以将 hf-mcp-server 本地运行为 STDIO 服务器,或支持强大支持 SSE、流式 HTTP 和流式 HTTP JSON 模式。这还运行本地界面用于选择工具和端点,并支持
ToolListChangedNotifications。
hf.co/mcp
MCP-HFSPACE
请点击这里阅读导言 llmindset.co.uk/resources/mcp-hfspace/
只需少设置即可连接 Hugging Face Spaces——只需添加你的空间即可!
默认情况下,它连接到 black-forest-labs/FLUX.1-schnell,为 Claude Desktop 提供图像生成功能。
Gradio MCP 支持
[!提示] Gradio 5.28 现在通过 SSE 集成了 MCP 支持:https://huggingface.co/blog/gradio-mcp. 查看你的目标空间是否已启用 MCP!
安装
NPM包为@llmindset/mcp-hfspace。
为你的平台安装一个最新版本的NodeJS,然后在你的claude_desktop_config.json文件的mcpServers部分添加以下内容:
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
mcp-hfspace MCP Server 🤗
[!TIP]
You can access and configure Hugging Face MCP services directly at https://hf.co/mcp, including Gradio spaces.
This project has been superceded by the official Hugging Face MCP Server and Gradio MCP Endpoints.
Alternatively you can run hf-mcp-server locally as a STDIO Server, or with robust support for SSE, Streaming HTTP and Streaming HTTP JSON Mode. This also runs a local UI for selecting tools and endpoints and supports
ToolListChangedNotificationstoo.
hf.co/mcp
mcp-hfspace
Read the introduction here llmindset.co.uk/resources/mcp-hfspace/
Connect to Hugging Face Spaces with minimal setup needed - simply add your spaces and go!
By default, it connects to black-forest-labs/FLUX.1-schnell providing Image Generation capabilities to Claude Desktop.
Gradio MCP Support
[!TIP] Gradio 5.28 now has integrated MCP Support via SSE: https://huggingface.co/blog/gradio-mcp. Check out whether your target Space is MCP Enabled!
Installation
NPM Package is @llmindset/mcp-hfspace.
Install a recent version of NodeJS for your platform, then add the following to the mcpServers section of your claude_desktop_config.json file:
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace"
]
}
Please make sure you are using Claude Desktop 0.78 or greater.
This will get you started with an Image Generator.
Basic setup
Supply a list of HuggingFace spaces in the arguments. mcp-hfspace will find the most appropriate endpoint and automatically configure it for usage. An example claude_desktop_config.json is supplied below.
By default the current working directory is used for file upload/download. On Windows this is a read/write folder at \users\\AppData\Roaming\Claude\<version.number\, and on MacOS it is the is the read-only root: /.
It is recommended to override this and set a Working Directory for handling the upload and download of images and other file-based content. Specify either the --work-dir=/your_directory argument or MCP_HF_WORK_DIR environment variable.
An example configuration for using a modern image generator, vision model and text to speech, with a working directory set is below:
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace",
"--work-dir=/Users/evalstate/mcp-store",
"shuttleai/shuttle-jaguar",
"styletts2/styletts2",
"Qwen/QVQ-72B-preview"
]
}
安装
npx -y @llmindset/mcp-hfspace配置
{
"mcpServers": {
"mcp-hfspace": {
"command": "npx"
"args": [
"-y",
"@llmindset/mcp-hfspace",
"--work-dir=~/mcp-files/ or x:/temp/mcp-files/",
"--HF_TOKEN=HF_{optional token}"
"Qwen/Qwen2-72B-Instruct",
"black-forest-labs/FLUX.1-schnell",
"space/example/specific-endpint"
(... and so on)
]
}
}
}