Enables searching for Gradio spaces for various AI applications like image generation, as part of the Hugging Face Spaces integration.
Provides comprehensive access to the Hugging Face ecosystem, enabling repository management (creating, deleting, and managing models, datasets, and spaces), file operations (reading, writing, editing, and deleting files), search and discovery capabilities, and collections management.
Allows searching for models tagged with PyTorch on Hugging Face as part of the search and discovery capabilities.
🤗 HuggingMCP - Hugging Face Model Context Protocol Server
Give Claude superpowers with Hugging Face! 🚀
HuggingMCP is a comprehensive Model Context Protocol (MCP) server that allows Claude and other MCP-compatible AI assistants to interact seamlessly with the Hugging Face ecosystem. Create models, manage datasets, edit files, organize collections, and much more - all through natural language!
✨ Features
🏗️ Repository Management
- Create repositories (models, datasets, spaces) with custom settings
- Delete repositories (admin mode required)
- Get detailed repository information and metadata
- List repository files and directory structures
🔀 Pull Requests & Collaboration
- Create pull requests on any public/private HuggingFace repository
- Upload files with PR - make changes and create PRs in one step
- Commit with PR - bundle multiple file changes into a single PR
- List pull requests with filters (status, author, repo type)
- Get PR details including comments, conflicts, and git references
- Draft mode support - PRs start in draft for safe collaboration
📝 Advanced File Operations
- Read files from any Hugging Face repository (public/private)
- Write/upload files with custom content
- Precise file editing with exact text replacement (old_text → new_text)
- Delete files from repositories
- Binary file support for non-text files
🔍 Search & Discovery
- Search models with filters (author, tags, popularity)
- Search datasets across all of Hugging Face
- Search Spaces and demo applications
- Advanced filtering by downloads, likes, creation date
- Comprehensive metadata for all results
📚 Collections Management
- Create collections to organize repositories
- Add items to collections (models, datasets, spaces, papers)
- Manage collection metadata and descriptions
- Get collection information and item lists
🔒 Security & Permissions
- Token-based authentication with Hugging Face
- Permission controls: read-only, write-only, admin modes
- File size limits to prevent abuse
- Comprehensive error handling
🚀 Quick Start
Prerequisites
- Python 3.10+ installed on your system
- Claude Desktop application (Download here)
- Hugging Face account and access token (Get token here)
Installation
- Create a project directory:
- Save the main.py file from the artifact in your project directory
- Install dependencies:
Configuration
- Open Claude Desktop settings:
- Go to Settings → Developer
- Click "Edit Config" to open
claude_desktop_config.json
- Add HuggingMCP configuration:
Important: Replace /ABSOLUTE/PATH/TO/YOUR/huggingmcp
with the actual absolute path to your project directory.
Environment Variables:
HF_TOKEN
: Your Hugging Face access token (required)HF_READ_ONLY
: Set to "true" to allow only read operations (optional)HF_WRITE_ONLY
: Set to "true" to allow only write operations (optional)HF_ADMIN_MODE
: Set to "true" to enable repository deletion (optional)HF_MAX_FILE_SIZE
: Maximum file size in bytes (optional)
- Restart Claude Desktop to load the MCP server
- Verify connection: Look for the 🔨 hammer icon in Claude Desktop, indicating MCP tools are available.
🎯 Usage Examples
Once connected, you can use natural language to interact with Hugging Face:
🏗️ Repository Operations
📝 File Management
🔍 Search & Discovery
🔀 Pull Request Operations
📚 Collections
🛡️ Security & Permissions
HuggingMCP includes comprehensive permission controls:
Permission Modes
Mode | Description | Use Case |
---|---|---|
Default | Full read/write access | Development and experimentation |
Read Only | Can only read repositories and files | Safe exploration mode |
Write Only | Can only create/modify (no deletion) | Content creation workflows |
Admin Mode | Full access including deletion | Advanced repository management |
Setting Permissions
Via Environment Variables:
Via Claude Commands:
🧩 Available Tools
HuggingMCP exposes the following tools to Claude:
Configuration & Testing
hf_test
- Test server functionality and connectionget_hf_config
- Get current configuration and capabilitieshf_whoami
- Get current authenticated user info
Repository Management
hf_create_repository
- Create new repos (models/datasets/spaces)hf_delete_repository
- Delete repos (admin mode required)hf_get_repository_info
- Get repo metadata and detailshf_list_repository_files
- List all files in a repository
File Operations
hf_read_file
- Read file content from repositorieshf_write_file
- Write/upload files to repositorieshf_edit_file
- Precise text replacement editinghf_delete_file
- Delete specific files from repositories
Search & Discovery
hf_search_models
- Search Hugging Face modelshf_search_datasets
- Search Hugging Face datasetshf_search_spaces
- Search Hugging Face Spaces
Pull Requests & Collaboration
hf_create_pull_request
- Create pull requests on repositorieshf_create_commit_pr
- Create commits with multiple files as PRhf_upload_file_pr
- Upload single file and create PRhf_list_pull_requests
- List PRs with filtering optionshf_get_pull_request_details
- Get detailed PR information
Collections
hf_collection_create
- Create new collectionshf_collection_add
- Add items to collectionshf_collection_info
- Get collection details and items
🔧 Configuration Options
Environment Variables
Variable | Default | Description |
---|---|---|
HF_TOKEN | None | Your Hugging Face access token (required) |
HF_READ_ONLY | false | Enable read-only mode |
HF_WRITE_ONLY | false | Enable write-only mode |
HF_ADMIN_MODE | false | Enable admin operations (repository deletion) |
HF_MAX_FILE_SIZE | 100000000 | Maximum file size in bytes (100MB default) |
Claude Desktop Config
Basic Configuration:
Advanced Configuration:
🐛 Troubleshooting
Common Issues
1. "Connection failed" in Claude Desktop
- Verify the absolute path in your config is correct
- Check that
main.py
exists in the specified directory - Ensure Python/uv is accessible from the command line
2. "Authentication required" errors
- Verify your HF_TOKEN is valid at https://huggingface.co/settings/tokens
- Ensure the token has appropriate permissions (read/write)
- Check that the token is correctly set in the Claude Desktop config env section
- Test with "Who am I currently logged in as?" to verify authentication
3. "Permission denied" errors
- Check your permission settings with
get_hf_config
- Verify you're not in read-only mode for write operations
- Ensure admin mode is enabled for deletion operations
4. General debugging tips
- Check the file exists and you have permissions to access it
- Verify the repository name and file path are correct
- Ensure you're not in read-only mode for write operations
Debug Logs
Check Claude Desktop MCP logs:
- macOS:
~/Library/Logs/Claude/mcp.log
- Windows:
%APPDATA%/Claude/Logs/mcp.log
Enable verbose logging in main.py:
Getting Help
- Check the logs in Claude Desktop's MCP log files
- Verify configuration using the
get_hf_config
tool - Test authentication with
hf_whoami
- Test basic functionality with
hf_test
- Start simple with read operations before trying writes
🤝 Contributing
Found a bug or want to add a feature? Here's how you can help:
- Report Issues: Open an issue describing the problem
- Feature Requests: Suggest new Hugging Face integrations
- Code Contributions: Submit pull requests with improvements
- Documentation: Help improve these docs!
📄 License
MIT License - feel free to use, modify, and distribute!
🙏 Acknowledgments
- Anthropic for creating the Model Context Protocol
- Hugging Face for their amazing platform and APIs
- FastMCP team for the excellent Python SDK
Happy prompting with HuggingMCP! 🤗✨
Now Claude can be your AI pair programmer for all things Hugging Face with 23 powerful tools including Pull Requests!
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol server that allows Claude and other MCP-compatible AI assistants to interact with the Hugging Face ecosystem, enabling repository management, file operations, search, and collections management through natural language.
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that connects Claude and other MCP clients to Aider, enabling AI assistants to efficiently edit files, create new files, and interact with git repositories through natural language.Last updated -9PythonThe Unlicense
- -securityAlicense-qualityA Model Context Protocol server that enables AI assistants like Claude to interact directly with Home Assistant, allowing them to query device states, control smart home entities, and perform automation tasks.Last updated -15PythonMIT 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 -34JavaScriptMIT License
- -securityAlicense-qualityA 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 -4PythonMIT License