Generates images using Google Gemini's image models (Nano Banana Pro, Flash, Imagen 3.0) with support for photorealism, up to 4K resolution, reference images for character/style consistency, real-time data via Google Search grounding, and conversational history for iterative refinement.
Generates images using OpenAI's GPT-Image-1 model, optimized for text-heavy images like menus, infographics, comics, and diagrams with excellent text rendering capabilities.
imagen-mcp
A Model Context Protocol (MCP) server for intelligent multi-provider image generation.
Features
Auto Provider Selection - Analyzes prompts to choose the best provider
Multi-Provider Support - OpenAI GPT-Image-1 and Google Gemini
Reference Images - Up to 14 images for character/style consistency (Gemini)
Real-time Data - Google Search grounding for current info (Gemini)
Conversational History - Iteratively refine images with context (Gemini)
High Resolution - Up to 4K output (Gemini)
Flexible Storage - Save to
~/Downloads/images/or custom locations
Architecture
Provider Comparison
Feature | OpenAI GPT-Image-1 | Gemini Nano Banana Pro |
Text Rendering | Excellent | Good |
Photorealism | Good | Excellent |
Speed | ~60s | ~15s |
Max Resolution | 1536x1024 | 4K |
Sizes | 3 options | 1K, 2K, 4K |
Aspect Ratios | 3 | 10 |
Reference Images | No | Yes (up to 14) |
Real-time Data | No | Yes (Google Search) |
Use OpenAI for: Text-heavy images, menus, infographics, comics, diagrams
Use Gemini for: Portraits, product photography, 4K output, reference images
Available Models
OpenAI Models
Model ID | Description |
| Dedicated image generation model (default) |
| GPT-5 with image generation capabilities |
| Latest reasoning model (conversation orchestration) |
Gemini Models
Model ID | Description |
| Nano Banana Pro - highest quality (default) |
| Fast experimental |
| Alternative image model |
Installation
Configuration
At least one API key is required. Both are recommended for auto-selection.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
Note: Claude Desktop doesn't support
cwd, so use therun.shwrapper script which handles the directory change.
Restart Claude Desktop (Cmd+Q, then reopen) after editing.
Claude Code CLI
Use the CLI to add the server:
Then add environment variables by editing ~/.claude.json:
Verify with:
Reference: Claude Code MCP Documentation
Gemini CLI
Edit ~/.gemini/settings.json:
Reference: Gemini CLI MCP Documentation
OpenAI Codex CLI
Edit ~/.codex/config.toml:
Or use the CLI:
Reference: Codex MCP Documentation
Generic MCP Client
For any MCP-compatible client:
Setting | Value |
Command |
|
Args |
|
Environment |
|
The Wrapper Script
The run.sh script handles the working directory requirement:
This is necessary because the server runs as a Python module (-m src.server) which requires being in the project directory.
Usage
Auto Provider Selection
The server analyzes your prompt and selects the best provider:
Manual Provider Selection
Override auto-selection with the provider parameter:
Save Location
Specify a custom save path (directory or filename) with output_path:
If output_path is omitted, images are saved to ~/Downloads/images/{provider} by default
(openai or gemini). Override the base directory with the OUTPUT_DIR environment variable
(supports ~ and env vars).
Logs are written to ~/Downloads/images/logs/ by default (or OUTPUT_DIR/logs/ when OUTPUT_DIR
is set).
Gemini-Specific Features
MCP Tools
Tool | Description |
| Main tool with auto provider selection |
| Multi-turn refinement with history |
| List active conversations and their history |
| Show available providers and capabilities |
| Query available Gemini image models |
Development
Project Structure
Environment Variables
Variable | Description | Required |
| OpenAI API key | One of these |
| Google Gemini API key | required |
| Alias for GEMINI_API_KEY | |
| Default: "auto" | No |
| Default: "1024x1024" | No |
| Default: "2K" | No |
| Default: "false" | No |
| Default directory for saved images | No |
| Log directory override | No |
| Log level (e.g. INFO, DEBUG) | No |
| Log prompts (default: false) | No |
Requirements
License
MIT