Enables downloading and managing models from HuggingFace repositories, with support for file filtering, size limits, and selective downloads
MCP HuggingFace 下载工具
通过 MCP 协议快速下载 HuggingFace 模型的工具,支持 Claude Desktop、Claude Code、Cursor、VS Code 等客户端。
📋 快速配置
Claude Desktop
在 claude_desktop_config.json
中添加:
Claude Code
在 .claude/claude_config.json
中添加:
Cursor / VS Code (Continue 插件)
在 config.json
中添加:
🔑 获取 HuggingFace Token
- 访问 HuggingFace Settings
- 创建新的 Access Token
- 将 token 复制到上述配置中的
HUGGINGFACE_TOKEN
🛠 使用方法
配置完成后,直接在对话中请求下载模型:
📝 支持的下载选项
参数 | 类型 | 说明 | 示例 |
---|---|---|---|
repo_id | string | HuggingFace 仓库 ID | "2Noise/ChatTTS" |
download_dir | string | 下载目录 | "./models" |
files | array | 指定文件列表 | ["model.bin", "config.json"] |
file_types | array | 文件类型过滤 | [".pt", ".bin", ".safetensors"] |
include_pattern | string/array | 包含模式 | "*.json" 或 ["*.pt", "*.bin"] |
exclude_pattern | string/array | 排除模式 | "test_*" 或 ["*.onnx", "test_*"] |
max_file_size | string | 最大文件大小 | "500MB" , "1GB" |
min_file_size | string | 最小文件大小 | "1KB" , "10MB" |
revision | string | Git 分支/标签 | "main" , "v1.0" |
🔧 环境变量配置
变量 | 必需 | 默认值 | 说明 |
---|---|---|---|
HUGGINGFACE_TOKEN | ✅ | - | HuggingFace 访问令牌 |
HUGGINGFETCH_DOWNLOAD_DIR | ❌ | ~/Downloads/huggingface_models | 默认下载目录 |
HF_HOME | ❌ | ~/.cache/huggingface | 缓存目录 |
LOG_LEVEL | ❌ | info | 日志级别 (debug , info , warn , error ) |
❓ 常见问题
Q: Token 认证失败怎么办?
A: 检查 HUGGINGFACE_TOKEN
是否正确设置,确保 token 有效且有足够权限。
Q: 下载速度慢怎么办?
A: 工具支持断点续传和并发下载,网络问题可能导致速度慢,会自动重试。
Q: 如何下载私有模型?
A: 确保您的 HuggingFace 账户有访问权限,并使用有效的 token。
Q: 支持哪些文件格式?
A: 支持所有 HuggingFace 上的文件格式,包括 .pt
, .bin
, .safetensors
, .json
, .txt
等。
📖 项目地址
- GitHub: freefish1218/mcp-huggingfetch
- 问题反馈: Issues
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enables users to download HuggingFace models through natural language requests with support for file filtering, size limits, and custom download directories. Supports various AI development environments including Claude Desktop, VS Code, and Cursor.
Related MCP Servers
- AsecurityAlicenseAqualityUse HuggingFace Spaces directly from Claude. Use Open Source Image Generation, Chat, Vision tasks and more. Supports Image, Audio and text uploads/downloads.Last updated -3227347TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that generates 2D and 3D game assets from text prompts using AI models from Hugging Face Spaces, allowing developers to easily create game art through Claude Desktop or other MCP clients.Last updated -79JavaScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol server that provides Claude and other LLMs with read-only access to Hugging Face Hub APIs, enabling interaction with models, datasets, spaces, papers, and collections through natural language.Last updated -1056PythonMIT License
- AsecurityAlicenseAqualityConnects Claude Desktop to Hugging Face Spaces with minimal setup, enabling capabilities like image generation, vision tasks, text-to-speech, and chat with AI models.Last updated -3227MIT License