- Hugging Face MCP Server
Hugging Face MCP Server
MCP server for Hugging Face API integration - Access Stable Diffusion and other AI models
Content
Hugging Face MCP Server
An MCP (Model Context Protocol) server that provides access to Hugging Face's AI image generation models, including Stable Diffusion.
Features
- Generate images using multiple Stable Diffusion models
- Support for negative prompts and guidance scale
- Save images locally or return as base64
- Check API status and token validity
- Free tier available (with rate limits)
Available Models
- Stable Diffusion 2.1: High-quality general purpose model
- Stable Diffusion XL: Latest and most advanced model
- OpenJourney: Midjourney-style artistic images
- Dreamlike Diffusion: Fantasy and artistic styles
- Anything v5: Anime/manga style images
Installation
- Clone this repository:
git clone https://github.com/nikolausm/huggingface-mcp-server.git
cd huggingface-mcp-server
- Install dependencies:
npm install
-
Get your Hugging Face API token:
- Go to https://huggingface.co/settings/tokens
- Create a new token (free)
- Copy the token
-
Set up environment variable:
export HUGGINGFACE_TOKEN="your_token_here"
Configuration in Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"huggingface": {
"command": "node",
"args": ["/path/to/huggingface-mcp-server/index.js"],
"env": {
"HUGGINGFACE_TOKEN": "your_token_here"
}
}
}
}
Usage
Generate an Image
// Basic usage
generate_image({
prompt: "a cute guinea pig in a garden, children's book illustration style"
})
// Advanced usage
generate_image({
prompt: "a beautiful landscape with mountains",
model: "stable-diffusion-xl",
negative_prompt: "ugly, blurry, low quality",
guidance_scale: 10,
save_path: "/tmp/landscape.png"
})
List Available Models
list_models()
Check API Status
check_status()
Free Tier Limitations
- Rate limited to ~10-20 requests per minute
- Some models may have queue times
- For production use, consider upgrading to a paid plan
Tips for Better Results
- Be specific: "watercolor painting of a red barn" works better than just "barn"
- Add style: Include art styles like "oil painting", "pencil sketch", "digital art"
- Use negative prompts: Tell the model what to avoid
- Adjust guidance scale: Higher values (10-15) follow prompts more closely
Examples
Children's Book Illustration
prompt: "cute guinea pig eating carrots, children's book illustration, watercolor style, soft colors"
negative_prompt: "realistic, photo, dark, scary"
Educational Diagram
prompt: "simple diagram of guinea pig anatomy, educational poster, labeled parts, clean design"
model: "stable-diffusion-xl"
License
MIT
Author
Michael Nikolaus
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
CursorThe AI Code Editor
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
WindsurfThe new purpose-built IDE to harness magic
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题;
Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Amap Maps高德地图官方 MCP Server
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
ChatWiseThe second fastest AI chatbot™
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Tavily Mcp
DeepChatYour AI Partner on Desktop
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Playwright McpPlaywright MCP server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.