Image Gen MCP
An MCP (Model Context Protocol) server for multi-provider image generation. Works with Claude Code, Claude Desktop, and other MCP-compatible clients.
Features
- 8 providers — OpenAI, Google Gemini, Replicate, Together AI, xAI Grok, Photoroom, fal.ai, Ideogram
- 7 tools —
generate_image, generate_batch, process_image, generate_asset, image_op, image_task, list_capabilities
- Batch generation —
generate_batch: submit an array of prompts in one tool call with per-item failure isolation and a batch run manifest
- Style anchoring — Pass
reference_image to generate_image or generate_batch to anchor scene geometry and lighting; routes transparently through edit_prompt (gpt-image-1.5)
- Goal-shaped MCP tool —
image_task: hand off a natural-language image goal, receive the final image plus a structured DAG trace
- Brand mockup template — Goal
"brand-mockup" in image_task produces a two-stage plan: AI generates a clean scene (no text), then sharp composites your SVG wordmark over it
- Routing transparency —
list_capabilities surfaces all 6 generate providers (openai, gemini, grok, replicate, together, ideogram) with cost/latency metadata so image_task can route by evidence
- Capability operations — Directly invoke
extract_subject, edit_prompt, composite_layers, generate, transform, upscale, and analysis ops through image_op
- Asset presets — One-call generation of profile pics, post images, hero photos, avatars, and scenes
- Image processing — Resize, crop, aspect crop, and circle mask operations
- Style modifiers — Prepend style directives (e.g., "watercolor painting") to any prompt
- Smart defaults — Configure a default provider, override per-request
- Persistent output — Images saved to disk with descriptive filenames, atomic writes
Supported Providers
| Provider | Models | Notes |
|---|
| OpenAI | gpt-image-1 (generation default), gpt-image-2, dall-e-3, dall-e-2; gpt-image-1.5 for image_op edits | Highest quality, supports revised prompts. gpt-image-2 requires OpenAI org verification (verify at https://platform.openai.com/settings/organization/general, wait up to 15 min for propagation), then set OPENAI_DEFAULT_MODEL=gpt-image-2. |
| Google Gemini | gemini-2.5-flash-image (default), gemini-3-pro-image | Fast default, pro for higher quality |
| Replicate | black-forest-labs/flux-1.1-pro (default), any Replicate model | Huge model variety |
| Together AI | black-forest-labs/FLUX.1-schnell (default) | Fast, affordable |
| xAI Grok | grok-imagine-image (default), grok-imagine-image-pro, grok-2-image | Aurora image generation |
| Photoroom | Remove Background API; Image Editing API | Capability-only provider for extract_subject and composite_layers with Image Editing shadows/relighting. Requires PHOTOROOM_API_KEY. |
| fal.ai | fal-ai/flux-pro/kontext | Capability-only edit_prompt mirror for Flux Kontext. Requires FAL_KEY. |
| Ideogram | ideogram-v3-0 | Capability-only generate provider for text-fidelity generation. Requires IDEOGRAM_API_KEY. |
Installation
Claude Code Plugin (Recommended)
The easiest way to install — no manual config needed:
# Add the marketplace
claude plugin marketplace add thebenlamm/image-gen-mcp
# Install the plugin
claude plugin install image-gen@image-gen-marketplace
The plugin automatically registers the MCP server. Set API keys for the remote providers you want to use. Local extract_subject works without an API key:
export OPENAI_API_KEY=sk-...
export OPENAI_DEFAULT_MODEL=gpt-image-1
export OPENAI_EDIT_MODEL=gpt-image-1.5
export ANTHROPIC_API_KEY=sk-ant-...
export GEMINI_API_KEY=...
export REPLICATE_API_TOKEN=...
export TOGETHER_API_KEY=...
export XAI_API_KEY=...
export PHOTOROOM_API_KEY=...
export FAL_KEY=...
export IDEOGRAM_API_KEY=...
export IMAGE_GEN_INPUT_ROOT=/absolute/path/to/allowed-inputs
Restart Claude Code and the tools will be available.
Manual Installation
If you prefer manual setup or want to use with other MCP clients:
git clone https://github.com/thebenlamm/image-gen-mcp.git
cd image-gen-mcp
npm install
The postinstall script builds automatically. Then configure your client (see below).
Configuration
Claude Code (Manual)
Add to ~/.claude/settings.json: