Sponsored by Deepsite.site

Hugging Face MCP Server

Created By
nikolausm10 months ago
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

  1. Clone this repository:
git clone https://github.com/nikolausm/huggingface-mcp-server.git
cd huggingface-mcp-server
  1. Install dependencies:
npm install
  1. Get your Hugging Face API token:

  2. 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

  1. Be specific: "watercolor painting of a red barn" works better than just "barn"
  2. Add style: Include art styles like "oil painting", "pencil sketch", "digital art"
  3. Use negative prompts: Tell the model what to avoid
  4. 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.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
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.
Serper MCP ServerA Serper MCP Server
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Tavily Mcp
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
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.
WindsurfThe new purpose-built IDE to harness magic
DeepChatYour AI Partner on Desktop
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Playwright McpPlaywright MCP server
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"
ChatWiseThe second fastest AI chatbot™
Amap Maps高德地图官方 MCP Server
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
RedisA Model Context Protocol server that provides access to Redis databases. This server enables LLMs to interact with Redis key-value stores through a set of standardized tools.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.