mcpField
H
Hugging Face MCP Server

Hugging Face MCP Server

Local
github.com/nikolausmAI & Agents1Updated 74w ago

About Hugging Face MCP Server

Hugging Face MCP Server connects MCP clients to Hugging Face image-generation models, including Stable Diffusion. It supports prompt controls, model listing, and API status checks.

Key features

  1. 01Generate images with several Stable Diffusion models
  2. 02Set negative prompts and guidance scale
  3. 03Save images locally or return base64
  4. 04List models and check API status

Use cases

  1. 01Create artwork from text prompts
  2. 02Generate images while excluding specified elements
  3. 03Check model options and API availability

MCP support

The MCP server exposes Hugging Face image generation and API status and model-listing capabilities to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

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

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.