Image Generation MCP Server
Integrates with Cloudflare Workers AI to generate images using models like SDXL, Flux, and Dreamshaper, supporting high-speed production environments.
Uses Cloudflare Workers AI as a provider for fast image generation with support for SDXL and Flux models.
Provides access to a wide variety of hosted image generation models on Hugging Face, including specialized models for pixel art and photorealistic styles.
Enables high-quality image generation through Replicate's API, supporting advanced models like Flux Pro and SDXL.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Image Generation MCP Servergenerate a 64x64 pixel art sprite of a forest spirit in NES style"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Image Generation MCP Server
Multi-provider image generation for AGI visual communication.
Features
Multi-Provider Support: Automatic fallback across 5 providers
FREE Default: Pollinations.ai requires no API key
Pixel Art Mode: Specialized generation for sprites and game assets
Auto-Save: Generated images automatically saved to disk
Cost Tracking: Monitor usage and costs per provider
Related MCP server: openai-gpt-image-1-mcp
Providers
Provider | Cost | API Key | Best For |
Pollinations.ai | FREE | None | Default, general use |
Cloudflare Workers AI | 10K neurons/day FREE | Required | Fast, production |
Together AI | ~$0.003/image | Required | Bulk generation |
Hugging Face | Free tier | Required | Model variety |
Replicate | 50/mo free | Required | High quality |
Installation
cd /mnt/agentic-system/mcp-servers/image-gen-mcp
pip install -e .Configuration
Add to ~/.claude.json:
{
"mcpServers": {
"image-gen": {
"command": "python",
"args": ["-m", "image_gen_mcp.server"],
"env": {
"CLOUDFLARE_API_TOKEN": "your-token",
"CLOUDFLARE_ACCOUNT_ID": "your-account-id",
"HUGGINGFACE_API_TOKEN": "your-hf-token",
"TOGETHER_API_KEY": "your-together-key",
"REPLICATE_API_TOKEN": "your-replicate-token",
"IMAGE_GEN_OUTPUT_DIR": "/mnt/agentic-system/generated-images"
}
}
}
}Environment Variables
Variable | Required | Description |
| No | Where to save images (default: |
| For CF | Cloudflare API token |
| For CF | Cloudflare account ID |
| For HF | Hugging Face token |
| For Together | Together AI key |
| For Replicate | Replicate token |
MCP Tools
generate_image
Generate an image from a text prompt.
{
"prompt": "A corgi wearing a space helmet, pixel art style",
"width": 1024,
"height": 1024,
"provider": "pollinations",
"model": "flux",
"seed": 42,
"save_to_file": true
}generate_pixel_art
Specialized pixel art generation.
{
"prompt": "cute corgi sprite, side view",
"style": "nes",
"size": 64,
"colors": 16
}Styles: nes, snes, gameboy, modern, isometric
list_providers
List all providers with status.
list_models
List models for a provider.
{
"provider": "huggingface"
}get_provider_status
Health check for a provider.
save_image
Save base64 image to file.
Models by Provider
Pollinations.ai
flux(default) - High qualityflux-realism- Photorealisticflux-anime- Anime styleflux-3d- 3D rendersturbo- Fast generation
Cloudflare Workers AI
sdxl- Stable Diffusion XLsdxl-lightning- Fast 4-step SDXLflux-schnell- Fast Fluxdreamshaper- Photorealistic
Hugging Face
sdxl- Stable Diffusion XLsdxl-turbo- Fast SDXLflux-dev- Flux developmentflux-schnell- Fast Fluxplayground-v2.5- Aestheticrealvisxl- Photorealisticpixel-art- Pixel art specialized
Together AI
flux-schnell- FREE tier availableflux-dev- Higher qualityflux-pro- Best qualitysd3- Stable Diffusion 3
Replicate
flux-schnell- Fast Fluxflux-dev- Higher qualityflux-pro- Best qualitysdxl- Stable Diffusion XLplayground-v2.5- Aesthetic
Usage Examples
Basic Image Generation
Generate an image of a mountain landscape at sunsetPixel Art for Sprites
Generate pixel art of a corgi walking animation, NES style, 64x64With Specific Provider
Generate a photorealistic portrait using Cloudflare's SDXL modelOutput
Images are saved to IMAGE_GEN_OUTPUT_DIR with format:
{timestamp}_{prompt_snippet}_{provider}.pngExample: 20241128_143022_mountain_landscape_pollinations.png
Error Handling
The server automatically falls back through providers if one fails:
Try requested provider (or Pollinations)
If failed, try Cloudflare
If failed, try Together AI
If failed, try Hugging Face
If failed, try Replicate
Return error with all attempted providers
Future Enhancements
Local GPU support (Flux/ComfyUI) when 12GB GPU available
Image-to-image generation
Inpainting and outpainting
Upscaling
Style transfer
Animation generation
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate reproducible image, video, and audio assets with leading models and your own provider keys.
Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables intelligent multi-provider image generation through OpenAI and Google Gemini APIs with automatic provider selection, support for reference images, real-time data grounding, and conversational refinement.8MIT
- AlicenseNot gradedqualityDmaintenanceProvides AI agents and coding assistants with image generation and editing capabilities using OpenAI's GPT-image-1 model, with support for local or Supabase storage.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables text-to-image and pixel art generation using Pollinations.ai with no API key required, and supports multiple models like Flux.-
- AlicenseAqualityBmaintenanceEnables image analysis, OCR, and text-to-image generation through OpenAI-compatible APIs. Supports local paths, URLs, or base64 images with configurable models and backup endpoints.315 npmMIT