image-generator-mcp
Provides image generation and editing through OpenAI's GPT Image models, including text-to-image generation, image editing/inpainting, multi-image composition, and model listing with automatic model fallback.
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., "@image-generator-mcpgenerate a photorealistic product shot of a ceramic mug on a wooden table"
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-generator-mcp
An MCP server that lets Claude generate and edit images with OpenAI's GPT Image models, plus a Claude skill that teaches Claude when and how to use it — which model to pick, how to prompt these models, and where to put the files.
Works with Claude Code, and with any other MCP client that speaks stdio.
What Claude gets
Tool | Does |
| Text prompt → one or more images, saved to disk, previewed inline |
| Whole-image edits, inpainting with a mask, multi-image composition |
| Which image models your API key can actually use, and what each is good for |
Claude picks the model itself. Left on auto, the server tries
gpt-image-2 and walks down gpt-image-1.5 → gpt-image-1 → gpt-image-1-mini if
your key lacks access, reporting which ones it skipped. Any model id is accepted
and passed straight through, so models released after this was written keep
working without a code change.
Related MCP server: Gemini Nanobanana MCP
Requirements
Node.js ≥ 20 (uses built-in
fetch,FormDataandFile)An OpenAI API key with access to the image models
macOS gets downscaled inline previews via the built-in
sips; other platforms still save every file correctly (see Previews)
Setup
1. Clone and install
git clone https://github.com/ChristophLabestin/image-generator-mcp.git
cd image-generator-mcp
npm install2. Store your OpenAI API key
The server reads the key from a private file, so it never has to be written into an MCP client config that might get synced or shared:
mkdir -p ~/.config/image-generator-mcp
printf 'OPENAI_API_KEY=sk-YOUR-KEY-HERE\n' > ~/.config/image-generator-mcp/.env
chmod 600 ~/.config/image-generator-mcp/.envA plain OPENAI_API_KEY in the environment also works and takes precedence.
Restricted-key permissions. If you scope the key rather than granting full
access, it needs exactly two: Images → Write (generation and edits) and
Models → Read (for list_image_models). Everything else can stay None.
Without Models → Read the image tools still work; only the live model listing
fails.
3. Register the server with Claude Code
From inside the cloned directory, so $PWD resolves to it:
claude mcp add image-generator --scope user -- node "$PWD/src/index.js"--scope user makes it available in every project. Use --scope project
instead to limit it to one repo.
Verify:
claude mcp listThen restart Claude Code — a server registered mid-session is not loaded into that session.
Any stdio MCP client works. The equivalent JSON config entry:
{
"mcpServers": {
"image-generator": {
"command": "node",
"args": ["/absolute/path/to/image-generator-mcp/src/index.js"]
}
}
}4. Install the skill
The MCP server alone lets Claude generate images. The skill is what makes it choose well — model selection, prompt craft, the cheap-draft-then-final workflow, and saving into the project's own asset folder. Install it at user scope so it applies across all projects:
mkdir -p ~/.claude/skills
cp -r skills/image-generation ~/.claude/skills/Claude loads it automatically when a request involves images; you do not invoke it by hand.
5. Check it works
npm run smokeThis speaks the MCP handshake to the server and prints the advertised tools. With the key in place it also lists the models your key can reach. It makes no image-generation calls, so it costs nothing.
Usage
Just ask in plain language — "make me an icon for X with a transparent background", "change the background in this photo to a beach". Claude selects the tool, the model and the parameters.
Where images land
Resolution order, first match wins:
output_dirpassed on the individual tool call — absolute, or relative to the server's working directoryThe
IMAGE_OUTPUT_DIRenvironment variable~/Pictures/claude-images
The skill instructs Claude to use option 1 with the project's own asset
directory for anything project-related, so generated images land in the repo
rather than in your Pictures folder. IMAGE_OUTPUT_DIR is the right lever only
if you want a different global default.
Configuration
Env var | Effect |
| Required. Falls back to |
| Default save directory. Defaults to |
| Point at a proxy or compatible endpoint. Defaults to |
Model guidance
Situation | Model |
Final artwork, text inside the image, 2K/4K, inpainting |
|
Many images, quality still matters, no 4K needed |
|
Cheap drafts, thumbnails, composition roughs |
|
Explicitly asked for DALL·E 3 |
|
Generation is billed per image and quality: "high" costs several times
"low", so the skill has Claude draft cheap, confirm the composition with you,
and only then render the final.
Verified behaviour
Checked end to end against the live API rather than read off the docs:
Generation, the multipart edit upload, and the error path all behave.
background: "transparent"produces a genuine RGBA alpha channel (corner pixels at alpha 0) on gpt-image-2, gpt-image-1.5, gpt-image-1 and gpt-image-1-mini — verified by decoding the PNG alpha channel pixel by pixel. Drafting transparent assets on the cheap model is therefore a valid workflow.dall-e-3has no transparency.
Previews
Every image is written to disk. What Claude gets back inline is a downscaled
JPEG (768px max edge) so a 4K render does not flood the context window. That
resize uses macOS sips; on other platforms the original is inlined when it is
small enough and skipped when it is not. The saved file is always the full
original either way — only the preview is affected.
Notes
dall-e-3speaks a different parameter vocabulary (quality: standard|hd,style,nforced to 1). The server translates automatically.OpenAI errors come back verbatim with status code and parameter name, so Claude can correct its own call instead of guessing.
No API key is ever stored in the repository or in your MCP client config.
Layout
src/index.js MCP server: tool definitions, model fallback, result delivery
src/openai.js OpenAI /v1/images client (generations, edits, models)
src/models.js Curated model catalog + fallback chain
src/output.js Filename building, saving, preview downscaling
src/config.js API key file loading
scripts/smoke.js MCP handshake test
skills/image-generation/SKILL.md The Claude skillLicense
MIT — see LICENSE.
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 Servers
- AlicenseAqualityDmaintenanceEnables Claude Desktop users to generate and edit high-quality images using Google's Gemini AI. Supports text-to-image generation, image transformations with text prompts, and automatic local saving with multilingual support.31MIT
- AlicenseAqualityDmaintenanceEnables AI image generation, editing, composition, and style transfer in Claude conversations using Google's Gemini 2.5 Flash model. Automatically saves generated images to a local directory.46211MIT
- FlicenseNot gradedqualityCmaintenanceEnables generating images from text prompts using OpenAI's GPT-Image-2 model within Claude Code and Codex conversations.
- FlicenseNot gradedqualityDmaintenanceEnables Claude to generate and edit images using Google Gemini AI.
Related MCP Connectors
Generate AI images, video, speech, music and presentations from Claude, ChatGPT and Cursor.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate AI images, video, music, and sound effects, and upscale them, from any MCP client.
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/ChristophLabestin/image-generator-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server