openai-image-mcp
Integrates with the OpenAI Images API to generate and edit images. Supports selecting OpenAI image models per call, text-to-image generation, editing and compositing with up to 16 input images, optional masks, custom sizes, quality settings, transparent backgrounds, multiple output formats, and saving generated images to disk.
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., "@openai-image-mcpGenerate a transparent-background webp logo of a fox, 1024x1024"
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.
openai-image-mcp
An MCP server for generating and editing images with the OpenAI Images API. You pick the model on each call. It works with Claude Code, Claude Desktop, Cursor, and any other MCP client.
Model choice on every call:
gpt-image-2.5-flare(the default),gpt-image-2.5-sunburst,gpt-image-2,gpt-image-1.5,chatgpt-image-latest,gpt-image-1-mini, and their dated snapshotsGeneration and editing: text-to-image; editing and compositing with up to 16 input images; optional masks
Current API features: custom sizes up to 3840x2160,
xhigh/maxquality, transparent backgrounds, png/jpeg/webp output,moderation,safety_identifierChecks before you pay: a parameter the chosen model doesn't support, or a retired model, fails locally with a clear message. Model IDs that aren't in the catalog are passed through to the API unchecked, so new models work right away.
Images saved to disk: the tool returns file paths and can also return the images inline for preview
Requires Node.js 20 or later and an OpenAI API key. Some models need organization verification.
Install
Claude Code
claude mcp add openai-image -e OPENAI_API_KEY=sk-... -- npx -y openai-image-mcpClaude Desktop / Cursor / other clients
{
"mcpServers": {
"openai-image": {
"command": "npx",
"args": ["-y", "openai-image-mcp"],
"env": {
"OPENAI_API_KEY": "sk-...",
"OPENAI_IMAGE_MODEL": "gpt-image-2.5-flare"
}
}
}
}From source
git clone https://github.com/DaniilPak/openai-image-mcp.git
cd openai-image-mcp && npm install && npm run build
claude mcp add openai-image -e OPENAI_API_KEY=sk-... -- node "$PWD/dist/index.js"Related MCP server: image2-mcp
Configuration
Env var | Default | Purpose |
| — (required) | API key |
|
| Default model when a call doesn't specify one |
|
| Where images are saved |
|
| Proxy or compatible endpoint |
| — | Sent as |
|
| Request timeout |
Tools
generate_image
Param | Notes |
| Required, up to 32,000 characters |
| Any model ID; defaults to |
|
|
|
|
|
|
|
|
| 1–10 |
|
|
| Override where and under what name images are saved |
| Also return the images inline. Off by default because the data is large. |
edit_image
Takes everything generate_image takes, plus:
Param | Notes |
| 1–16 local paths (png/jpg/webp), http(s) URLs, data URLs, or OpenAI file IDs ( |
| Optional PNG whose transparent pixels mark the area to edit |
|
|
list_models
Returns the model catalog with each model's capabilities, the default model, and the retired models.
Models
Model | Best for | Custom sizes | xhigh/max | Transparent |
| Fast everyday generation (default) | ✓ | ✓ | ✓ |
| Premium quality, precise edits | ✓ | ✓ | ✓ |
| General use, high-fidelity inputs | ✓ | — | preview |
| Fixed sizes, | — | — | ✓ |
| Lowest cost | — | — | ✓ |
Retired models are rejected with a suggested replacement: gpt-image-1 (shut down 2026-10-23), and dall-e-2 and dall-e-3 (removed 2026-05-12).
The catalog follows the Images API reference and changelog as of October 2026.
Example prompts
"Generate a 1920x1088 hero image of a misty mountain lake at dawn with gpt-image-2.5-sunburst, max quality"
"Make a transparent-background webp logo of a fox, 1024x1024"
"Edit ~/Desktop/room.jpg: replace the sofa with a green velvet one, keep everything else"
Development
npm install
npm test # build + unit tests
npm run dev # tsc --watchLicense
Available Tools
3 toolsedit_imageEdit image (OpenAI)A
Edit or combine existing images with a prompt (e.g. "put the product from image 1 on the background from image 2"). Optional mask: transparent pixels mark the area to change. Results are saved to disk.
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images (1–10). Default 1. | |
| mask | No | Mask image (same forms as images). PNG with alpha; same size as the first image. | |
| size | No | "auto", "1024x1024", "1536x1024" (landscape), "1024x1536" (portrait). gpt-image-2 and 2.5 models also accept any WIDTHxHEIGHT: multiples of 16, aspect 1:3–3:1, max 3840x2160 (e.g. "1920x1088", "3840x2160"). | |
| model | No | OpenAI image model. Known: gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1.5, chatgpt-image-latest, gpt-image-1-mini. Dated snapshots (e.g. gpt-image-2-2026-04-21) also work. Default: gpt-image-2.5-flare. Call list_models for capabilities. | gpt-image-2.5-flare |
| images | Yes | 1–16 input images: local file paths (png/jpg/webp), http(s) URLs, data URLs, or OpenAI file IDs. | |
| prompt | Yes | What to generate. Describe style in the prompt. | |
| quality | No | Default "auto". xhigh and max are only on gpt-image-2.5-flare / -sunburst. | |
| background | No | "transparent" needs output_format png or webp. | |
| moderation | No | "low" = less restrictive filtering. | |
| output_dir | No | Where to save files. Default /root/Pictures/openai-image-mcp. | |
| output_format | No | Default png. | |
| include_images | No | Also return the images inline so the client can display them. Large; off by default. | |
| input_fidelity | No | How closely to preserve input details/faces. gpt-image-1.5: low|high; gpt-image-1-mini: low; omit for gpt-image-2+. | |
| filename_prefix | No | File name prefix. Defaults to a slug of the prompt. | |
| output_compression | No | 0–100, jpeg/webp only. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=false and openWorldHint=true, so the mutation and external-call profile is known. The description adds real value with "Results are saved to disk" and the mask transparency semantics, but says nothing about cost, latency, moderation implications, or whether returned file paths are handed back to the agent.
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?
Three short sentences, front-loaded with purpose, then the optional mask caveat, then the output side effect. Nothing is padded and nothing is buried.
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?
For a 15-parameter tool with no output schema, the description covers purpose, mask behavior, and where files land, but omits what the tool actually returns (paths? inline images? count?) and how to choose between models or sizes. The rich schema carries most of the weight, leaving the description adequate but thin for this complexity.
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?
Schema coverage is 100% and every one of the 15 parameters is already documented in the schema, so the baseline is 3. The one genuine addition is the mask rule ("transparent pixels mark the area to change"), which explains effect rather than just format, but the remaining parameters (model, size, quality, n) get no guidance in the description beyond what the schema states.
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?
States a specific verb and resource ("Edit or combine existing images") and reinforces it with a concrete multi-image example, which clearly signals it operates on existing inputs rather than generating from nothing. It never names generate_image as the contrast case, so the split between the two siblings is left implicit rather than stated.
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?
The composite example ("put the product from image 1 on the background from image 2") illustrates one usage pattern, implying when to reach for this tool. However there is no explicit when-not, no prerequisites (API credentials, cost, latency), and no statement of how this differs from generate_image despite it being the obvious alternative.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageGenerate image (OpenAI)A
Generate images from a text prompt with the OpenAI Images API. Choose the model per call. Images are saved to disk and their paths returned.
| Name | Required | Description | Default |
|---|---|---|---|
| n | No | Number of images (1–10). Default 1. | |
| size | No | "auto", "1024x1024", "1536x1024" (landscape), "1024x1536" (portrait). gpt-image-2 and 2.5 models also accept any WIDTHxHEIGHT: multiples of 16, aspect 1:3–3:1, max 3840x2160 (e.g. "1920x1088", "3840x2160"). | |
| model | No | OpenAI image model. Known: gpt-image-2.5-flare, gpt-image-2.5-sunburst, gpt-image-2, gpt-image-1.5, chatgpt-image-latest, gpt-image-1-mini. Dated snapshots (e.g. gpt-image-2-2026-04-21) also work. Default: gpt-image-2.5-flare. Call list_models for capabilities. | gpt-image-2.5-flare |
| prompt | Yes | What to generate. Describe style in the prompt. | |
| quality | No | Default "auto". xhigh and max are only on gpt-image-2.5-flare / -sunburst. | |
| background | No | "transparent" needs output_format png or webp. | |
| moderation | No | "low" = less restrictive filtering. | |
| output_dir | No | Where to save files. Default /root/Pictures/openai-image-mcp. | |
| output_format | No | Default png. | |
| include_images | No | Also return the images inline so the client can display them. Large; off by default. | |
| filename_prefix | No | File name prefix. Defaults to a slug of the prompt. | |
| output_compression | No | 0–100, jpeg/webp only. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description adds meaningful behavior beyond the annotations by noting that images are saved to disk and their paths returned. However, with readOnlyHint=false and openWorldHint=true already flagging a write operation, it does not disclose overwrite behavior, permissions, cost, or rate-limit implications.
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?
Three short sentences with no wasted text: the purpose is front-loaded, then model choice, then output behavior. Every sentence contributes useful information.
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?
For a 12-parameter write tool with no output schema, the description covers the core purpose and notes that images are saved and paths returned. The schema handles parameter details. Minor gaps like overwrite behavior and cost are not critical to invoking the tool correctly.
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?
Schema description coverage is 100%, so all parameters are already documented in the schema. The description adds only 'Choose the model per call,' which is already covered by the model parameter description, so baseline 3 is appropriate.
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 states a specific verb and resource: generate images from a text prompt via the OpenAI Images API. It is clear about what the tool does, though it does not explicitly distinguish itself from the sibling edit_image tool beyond the name difference.
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?
Usage is implied by 'Generate images from a text prompt' and 'Choose the model per call,' but there is no explicit guidance on when to use this tool versus edit_image or when not to use it. Alternatives are not mentioned.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_modelsList OpenAI image modelsARead-only
List supported OpenAI image models with their capabilities, the default model, and retired models.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
readOnlyHint=true already declares the safety profile, so the description's added value is its disclosure of the payload contents (capabilities, default model, retired models) — meaningful since no output schema exists. It omits any mention of ordering, auth requirements, or whether retired models are flagged as unusable, keeping it short of a 5.
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?
A single front-loaded sentence that conveys the action, the resource, and the return contents with no filler. Every clause earns its place.
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?
For a zero-parameter, read-only tool with no output schema, the description covers the essentials: what is returned and that it includes the default and retired models. Minor gaps (e.g., whether retired models are marked deprecated or excluded from use) are unlikely to block a correct call.
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?
The tool takes zero parameters, which is the baseline-4 case; there is nothing for the description to disambiguate. The description correctly signals a no-argument call by not implying any filtering or selection options.
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 pairs a specific verb ("List") with a specific resource ("supported OpenAI image models") and enumerates what the listing contains: capabilities, the default model, and retired models. It does not explicitly name generate_image/edit_image, but the read-only "list" verb is self-evidently distinct from the sibling generation/editing tools.
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?
Usage is only implied: an agent can infer this is the discovery step before calling generate_image or edit_image. There is no explicit statement of when to call it, when not to, or a named alternative, so it sits at the minimum-viable level for guidance.
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.
3 tool updates
v1.0.0- First observed
edit_image - First observed
generate_image - First observed
list_models
TDQS
Scored across 3 tools
The three tools each target a clearly distinct action: creating new images, editing existing ones, and reading model metadata. An agent can trivially choose between generate_image and edit_image based on whether it has source images, and list_models is purely informational.
All names follow a consistent snake_case verb_noun pattern (generate_image, edit_image, list_models), with plain, predictable verbs and no style mixing.
Three tools is on the lean side but covers the core generate/edit/metadata loop without redundancy. A slightly larger surface (e.g. mask creation, result retrieval) would not feel padded.
The generate/edit/list lifecycle is covered and the descriptions clarify how results land on disk, but there is no way to fetch or clean up generated files, no variation/upscale path, and no way to inspect saved outputs after the fact.
Maintenance
Related MCP Connectors
Generate images with any major model — one API key, one prepaid balance, one MCP.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models and 10 tools: up to 4 images per call, SVG vectorization, editing and more. Remote MCP with OAuth, no API keys. Pay per image, no subscription.
Generate images, video, audio and short films with 140+ AI models from any MCP client.
Related MCP Servers
- AlicenseAqualityBmaintenanceGenerates and edits images using OpenAI GPT Image or Google Gemini models, saving every result to disk and returning local file paths so AI assistants can continue working with the images. It enables prompt-based image creation, editing, inpainting, multi-image composition, and model listing through MCP tools.117 npm1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to generate and edit images through any OpenAI-compatible image API, saving results as local files and returning absolute paths for immediate use.18 npmMIT
- AlicenseNot gradedqualityAmaintenanceEnables AI assistants and MCP clients to generate and edit images, automatically enriching prompts with visual details and quality presets across Gemini, OpenAI, and BytePlus Seedream, with results saved to disk.1,984 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents and other MCP clients to generate images from text prompts and edit, restyle, or extend existing images through an OpenAI-compatible /v1/images API. Results are returned both inline as image content blocks and as files saved to disk, so agents can view and reuse them within a normal task.25 npm1MIT