AI Image-Gen MCP Server
Provides tools for generating images using OpenAI's DALL·E 3, DALL·E 2, and GPT-Image-1 models, supporting features like style control, batch generation, and size selection.
Click on "Install 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., "@AI Image-Gen MCP ServerDesign a cyberpunk logo for my startup"
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.
AI Image‑Gen MCP Server
Version 0.1.0 – MVP public release
Conforms to the Model Context Protocol spec (2025‑06‑18).
What's this?
A production‑ready MCP server that transforms state‑of‑the‑art image generators into plug‑and‑play tools for any MCP‑aware client. Currently shipping with DALL·E 3, DALL·E 2, and experimental GPT‑Image‑1 – all accessible through a unified interface.
Why MCP?
MCP is the USB‑C of AI context: one protocol, endless integrations. Ship one server, hook it into Claude Desktop, Claude Code, VS Code, or your own chatbot – the host handles UI, auth, and conversation flow.
Quick examples
You ask | The server delivers |
"Design a cyberpunk logo for my startup" | High‑res PNG via DALL·E 3 with style presets |
"Generate 5 variations of this product shot" | Batch generation via DALL·E 2 (n=5 support) |
"Create concept art for a steampunk airship" | Artistic rendering with metadata and prompt history |
If you can describe it, we can render it. 💫
Related MCP server: MCP OpenAI Image Generation Server
Core MCP Concepts
This server implements all three MCP primitives:
Tools –
generate_imagewith model selection, size, and style optionsResources – Available models and their capabilities exposed as MCP resources
Prompts – Built‑in templates for
product_mockupandconcept_artworkflows
Feature Highlights
Multi‑Model Support – DALL·E 3 (default), DALL·E 2, and GPT‑Image‑1 via unified API
Smart Storage – Local cache with timestamped filenames and JSON metadata
Flexible Sizing – From 256×256 thumbnails to 1792×1024 widescreen masterpieces
Style Control –
vividornaturalrendering (DALL·E 3)Batch Generation – Create up to 10 variations per prompt (DALL·E 2)
Claude Integration – First‑class support for Desktop and Code editions
Architecture
graph TD
Client["MCP Client (Claude Desktop/Code)"] -- JSON‑RPC 2.0 --> Server["Image‑Gen MCP Server"]
Server --> Router["Model Router"]
Router -->|OpenAI API| DALLE3["DALL·E 3"]
Router -->|OpenAI API| DALLE2["DALL·E 2"]
Router -->|Responses API| GPT["GPT‑Image‑1"]
Server --> Storage["Local Storage + Metadata"]
Storage --> ClientQuickstart
Prerequisites
Python 3.11+
OpenAI API key
Claude Desktop or Claude Code (for MCP integration)
Installation
git clone https://github.com/krystian-ai/ai-image-gen-mcp.git
cd ai-image-gen-mcp
python3.11 -m venv .venv && source .venv/bin/activate
pip install -e ".[image,dev]"Configuration
cp .env.example .env
# Edit .env and add your OpenAI API keyKey settings:
OPENAI_API_KEY=sk-...
MODEL_DEFAULT=dall-e-3
CACHE_DIR=/tmp/ai-image-gen-cacheRun Standalone
# Via MCP CLI
mcp-imageserve stdio
# Direct execution
python -m ai_image_gen_mcp.server --transport=stdioClaude Desktop Integration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"ai-image-gen": {
"command": "/path/to/ai-image-gen-mcp/.venv/bin/python",
"args": ["-m", "ai_image_gen_mcp.server", "stdio"],
"transport": "STDIO",
"env": {
"PYTHONPATH": "/path/to/ai-image-gen-mcp/src",
"OPENAI_API_KEY": "your-api-key-here"
}
}
}
}Claude Code Integration
Option 1: Project‑specific .mcp.json (Recommended)
Drop this in your project root:
{
"ai-image-gen": {
"command": "python",
"args": ["-m", "ai_image_gen_mcp.server", "stdio"],
"transport": "STDIO",
"env": {
"PYTHONPATH": "src",
"OPENAI_API_KEY": "your-api-key-here"
}
}
}Claude Code auto‑detects and loads it. ✨
Option 2: Global Config
Add to ~/.config/claude-code/settings.json for system‑wide access.
Model Capabilities
Model | Sizes | Styles | Batch (n) | Speed | Notes |
DALL·E 3 | 1024×1024, 1792×1024, 1024×1792 | vivid, natural | 1 | Fast | Best quality, default model |
DALL·E 2 | 256×256, 512×512, 1024×1024 | N/A | 1-10 | Fast | Good for variations |
GPT‑Image‑1 | Fixed (model‑determined) | N/A | 1 | Slow (20s+) | Experimental, may timeout |
Usage Examples
Basic Generation
Generate a minimalist logo for a productivity appWith Parameters
Create a vivid 1792x1024 banner of a futuristic cityscape using dall-e-3Batch Creation
Generate 5 variations of a coffee cup product photo using dall-e-2Interactive HTML Demo
Explore the server's capabilities through our interactive web interface:
cd examples/html
open index.html # macOS
# or
xdg-open index.html # Linux
# or just open in your browserThe demo showcases:
Live Examples – Generated images with their prompts
Model Comparison – See outputs from DALL·E 3, DALL·E 2, and GPT-Image-1
Interactive Gallery – Carousel of stunning AI-generated artwork
Integration Guide – How to connect with Claude Desktop/Code
Perfect for visualizing what's possible before diving into the API!
Development
Testing
pytest # Full suite
pytest --cov=ai_image_gen_mcp # Coverage report
python test_dalle.py # Live API testCode Quality
black src/ # Format
ruff check src/ # Lint
mypy src/ # Type checkProject Structure
ai-image-gen-mcp/
├── src/ai_image_gen_mcp/
│ ├── server.py # FastMCP server entry
│ ├── models/ # Model implementations
│ └── config.py # Environment config
├── tests/ # Comprehensive test suite
├── examples/
│ └── html/ # Interactive web demo
├── assets/ # Logo images
└── .mcp.json # Claude Code configTroubleshooting
Issue | Solution |
MCP not detected | Ensure |
API key errors | Check |
Import errors | Verify |
GPT‑Image‑1 timeouts | Known issue – use DALL·E models for reliability |
Claude Desktop issues | Use full paths to venv Python executable |
Roadmap
Version | Focus | Status |
0.1 | MVP with 3 models, local storage | ✅ Shipped |
0.2 | S3/GCS storage, signed URLs | 🚧 Planning |
0.3 | Stable Diffusion, ComfyUI integration | 📋 Backlog |
0.4 | Inpainting, upscaling, style transfer | 💭 Ideas |
Contributing
Fork → feature branch → PR. Run pre-commit hooks. Keep the vibe technical but approachable.
License
MIT – see LICENSE.
Links
MCP Docs – modelcontextprotocol.io
FastMCP – github.com/jlowin/fastmcp
OpenAI Images – platform.openai.com/docs/guides/images
Available Tools
1 toolgenerate_imageA
Generate images from text descriptions using AI models.
Args: prompt: Text description of the desired image style: Style preset (default, photorealistic, illustration) size: Image dimensions (1024x1024, 1792x1024, 1024x1792) n: Number of images to generate (currently only 1 supported) model: Specific model to use (dalle-3, dalle-2, gpt-image-1)
Returns: ImageGenerationResponse with image URLs and metadata
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | ||
| style | No | default | |
| size | No | 1024x1024 | |
| n | No | ||
| model | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| image_urls | Yes | URLs or paths to generated images |
| prompt | Yes | The prompt used for generation |
| model | Yes | Model used for generation |
| created_at | Yes | ISO 8601 timestamp of generation |
| message | No | User-friendly message about the result |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses that only 1 image is currently supported for the 'n' parameter, which is a helpful behavioral trait. However, it omits other important details such as rate limits, content filtering, or authentication requirements. Since no annotations are provided, the description should carry more burden.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise and well-structured with Args and Returns sections. It avoids unnecessary wording, though it could be slightly more front-loaded with the main purpose before the parameter list.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the presence of an output schema, the description adequately outlines the return value. It covers all parameters and the core functionality. Minor gaps in usage guidelines and behavioral traits prevent a perfect score.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
With 0% schema description coverage, the description adds complete meaning for all parameters by providing brief explanations (e.g., 'Text description of the desired image', 'Style preset (default, photorealistic, illustration)'). This fully compensates for the missing schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool generates images from text descriptions using AI models, which is a specific verb-resource combination. There are no sibling tools, so differentiation is not required.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use or not use this tool versus alternatives. The description implies general image generation but lacks exclusions or context for when other tools might be more appropriate.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
generate_image
TDQS
With only one tool, there is no risk of ambiguity. The tool has a clear and distinct purpose.
The single tool name 'generate_image' follows a consistent verb_noun pattern, which is clear and predictable.
A single tool for an image generation server is borderline. While it covers the core function, the surface feels thin compared to typical MCP servers with 3-15 tools.
The server only provides a create operation (generate_image). Missing get, update, delete, or list capabilities for generated images, which are significant gaps for managing outputs.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Create images & video from any MCP agent — 17 models, spend limits, one URL.
Generate AI images and videos from any compatible MCP client.
Generate images with any major model — one API key, one prepaid balance, one MCP.
Generate on-brand images from your AI agent: design, edit, and render templates over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides tools for generating and editing images using OpenAI's gpt-image-1 model via an MCP interface, enabling AI assistants to create and modify images based on text prompts.15Apache 2.0
- AlicenseNot gradedqualityNot gradedmaintenanceEnables AI assistants to generate and edit images through OpenAI's DALL-E models via MCP tools. Supports text-to-image generation and image-to-image editing with configurable parameters for size, quality, and style.-
- AlicenseNot gradedqualityCmaintenanceExposes multiple image generation backends as independent MCP tools for generating images with configurable models and parameters.MIT
- AlicenseNot gradedqualityBmaintenanceGenerates and edits images using OpenAI image models via MCP tools.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/krystian-ai/ai-image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server