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
Related MCP server: MCP TemplateIO
Quick Start
Installation
Configuration
Configure via environment variables:
Usage with MCP Client
MCP Tools
generate_image
Generate images from text prompts with AI-optimized prompting.
Parameters:
prompt(required): Detailed, optimized text description of the image to generatenegative_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 generationoutput_dir(optional): Output directory (default: "./images")filename_template(optional): Template for generated filenames
Example:
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:
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
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
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