mcp-hfspace MCP Server 🤗
用于使用HuggingFace空间的MCP Server,配置简单并支持Claude桌面模式。
简介
mcp-hfspace
是一个MCP服务器,让您可以轻松连接Claude Desktop与Hugging Face Spaces上的各种AI模型。
默认连接到evalstate/FLUX.1-schnell
,为Claude桌面提供图像生成功能。
安装
- 安装最新版本的NodeJS
- 将以下配置添加到
claude_desktop_config.json
的mcpServers
部分:
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace"
]
}
注意:需要Claude Desktop 0.78或更高版本
基本配置
设置工作目录(推荐)
添加--work-dir
参数指定工作目录(用于文件上传/下载):
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace",
"--work-dir=/your/directory/path"
]
}
也可通过环境变量设置:MCP_HF_WORK_DIR
连接多个模型
"mcp-hfspace": {
"command": "npx",
"args": [
"-y",
"@llmindset/mcp-hfspace",
"--work-dir=/your/directory/path",
"shuttleai/shuttle-jaguar",
"styletts2/styletts2",
"Qwen/QVQ-72B-preview"
]
}
访问私有空间
使用--hf-token
参数或HF_TOKEN
环境变量提供Hugging Face令牌。
使用方法
图像生成
使用shuttleai/shuttle-3.1-aesthetic
或FLUX.1-schnell
生成图像。
视觉模型
上传图像到工作目录并使用如merve/paligemma2-vqav2
的视觉模型分析。
文本转语音
使用styletts2/styletts2
或parler-tts/parler_tts
将文本转换为语音。
语音转文本
使用hf-audio/whisper-large-v3-turbo
将音频转换为文本。
推荐模型
- 图像生成:shuttleai/shuttle-3.1-aesthetic, black-forest-labs/FLUX.1-schnell
- 聊天:Qwen/Qwen2.5-72B-Instruct, prithivMLmods/Mistral-7B-Instruct-v0.3
- 文本转语音:fantaxy/Sound-AI-SFX, parler-tts/parler_tts
- 视觉任务:microsoft/OmniParser, merve/paligemma2-vqav2, DawnC/PawMatchAI
提示
- 指定API端点:可通过在空间名称中添加特定路径,例如
Qwen/Qwen2.5-72B-Instruct/model_chat
- 默认为Claude桌面模式,可通过
--desktop-mode=false
选项禁用 - 可直接输入URL或指定工作目录中的文件名