Skip to main content
Glama

MCP Server - Images

by rmrfslashbin

MCP Server - Images

A Model Context Protocol (MCP) server for AI-powered image generation using Stability AI and Black Forest Labs APIs.

Features

  • Multi-provider support: Stability AI (Stable Diffusion) and Black Forest Labs (Flux models)

  • Direct generation: Accepts optimized prompts directly from calling LLM (no dual pipes)

  • Flexible filename templates: Customizable output filenames with timestamp, provider, model, and content-based variables

  • Comprehensive metadata: Full tracking of generation parameters, checksums, and provenance

  • Professional error handling: Detailed error reporting and retry mechanisms

  • MCP standard compliance: Works with any MCP-compatible client

Quick Start

Installation

# Clone the repository git clone https://github.com/rmrfslashbin/mcp-server-images.git cd mcp-server-images # Install dependencies uv sync

Configuration

Configure via environment variables:

STABILITY_API_KEY=sk-... # Required for Stability AI BFL_API_KEY=... # Required for Black Forest Labs

Usage with MCP Client

# Run the server uv run mcp-server-images # Or via Python python -m mcp_server_images

MCP Tools

generate_image

Generate images from text prompts with AI-optimized prompting.

Parameters:

  • prompt (required): Detailed, optimized text description of the image to generate

  • negative_prompt (optional): Things to avoid in the image (Stability AI only)

  • provider (optional): "stability" or "bfl" (default: "stability")

  • model (optional): Specific model to use (e.g., "sd3.5-large", "flux-pro-1.1")

  • aspect_ratio (optional): Image aspect ratio (default: "1:1")

  • cfg_scale (optional): Classifier free guidance scale 1.0-10.0 (Stability AI only)

  • seed (optional): Seed for reproducible generation

  • output_dir (optional): Output directory (default: "./images")

  • filename_template (optional): Template for generated filenames

Example:

{ "name": "generate_image", "arguments": { "prompt": "A majestic mountain landscape at golden hour, with a pristine lake reflecting the warm sunset colors, ancient pine trees framing the composition, volumetric lighting through misty atmosphere, highly detailed digital painting style", "negative_prompt": "blurry, low quality, oversaturated, distorted, artificial", "provider": "stability", "model": "sd3.5-large", "aspect_ratio": "16:9", "cfg_scale": 7.5, "filename_template": "{{.Timestamp}}-{{.Provider}}-{{.Subject}}" } }

Filename Templates

Customize output filenames using template variables:

  • {{.Timestamp}}: mmddyy.hhmmss format

  • {{.Date}}: mmddyy format

  • {{.Time}}: hhmmss format

  • {{.Provider}}: "stability" or "bfl"

  • {{.Model}}: Model name (e.g., "sd3.5-large")

  • {{.Subject}}: Cleaned main subject from prompt

  • {{.Hash}}: Short hash of the prompt

  • {{.Counter}}: Auto-incrementing counter

Example templates:

  • "{{.Timestamp}}-{{.Subject}}"071825.143022-mountain_landscape.png

  • "{{.Date}}.{{.Time}}-{{.Provider}}-{{.Model}}"071825.143022-stability-sd35-large.png

  • "img_{{.Counter}}_{{.Hash}}"img_001_a7b2c9d8.png

Supported Providers

Stability AI

  • Models: sd3-large, sd3-large-turbo, sd3-medium, sd3.5-large, sd3.5-large-turbo, sd3.5-medium

  • Features: Negative prompts, CFG scale control, multiple aspect ratios

  • API: Stability AI REST API v2

Black Forest Labs

  • Models: flux-pro-1.1, flux-pro-1.1-ultra, flux-pro, flux-dev

  • Features: High-quality generation, fast turnaround

  • API: BFL REST API v1

Integration

With Chatterbox

Add to your config.yaml:

mcp: servers: images: command: "uv" args: ["run", "mcp-server-images"] env: STABILITY_API_KEY: "sk-..." BFL_API_KEY: "..." config: output_dir: "./images" filename_template: "{{.Timestamp}}-{{.Provider}}-{{.Subject}}"

With Other MCP Clients

This server works with any MCP-compatible client including:

  • Claude Desktop

  • Cline (VS Code extension)

  • Continue (VS Code extension)

  • Custom MCP clients

Development

# Install development dependencies uv sync --dev # Run tests uv run pytest # Format code uv run ruff format . # Lint code uv run ruff check .

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

Related Projects

  • chatterbox - AI chat interface with MCP support

  • mkimg - Original Python image generation pipeline

  • MCP Servers - Official MCP server implementations

-
security - not tested
A
license - permissive license
-
quality - not tested

Related MCP Servers

  • A
    security
    F
    license
    A
    quality
    A Model Context Protocol server that provides image generation capabilities using the Ideogram API, allowing users to create images from text prompts with customizable parameters.
    Last updated -
    34
    5
  • A
    security
    F
    license
    A
    quality
    A Model Context Protocol server that provides an image generation tool using Templated.io, allowing users to create customized images based on templates with text and image layers.
    Last updated -
    • Apple
  • A
    security
    A
    license
    A
    quality
    A Model Context Protocol server that enables generation of high-quality images using the Flux.1 Schnell model via Together AI, allowing users to create images from text prompts with customizable dimensions.
    Last updated -
    1
    16
    MIT License
    • Apple
  • -
    security
    A
    license
    -
    quality
    A server that provides AI-powered image generation, modification, and processing capabilities through the Model Context Protocol, leveraging Google Gemini models and other image services.
    Last updated -
    15
    MIT License
    • Linux
    • Apple

View all related MCP servers

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/rmrfslashbin/mcp-server-images'

If you have feedback or need assistance with the MCP directory API, please join our Discord server