Skip to main content
Glama

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 snapshots

  • Generation 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/max quality, transparent backgrounds, png/jpeg/webp output, moderation, safety_identifier

  • Checks 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-mcp

Claude 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

OPENAI_API_KEY

— (required)

API key

OPENAI_IMAGE_MODEL

gpt-image-2.5-flare

Default model when a call doesn't specify one

OPENAI_IMAGE_OUTPUT_DIR

~/Pictures/openai-image-mcp

Where images are saved

OPENAI_BASE_URL

https://api.openai.com/v1

Proxy or compatible endpoint

OPENAI_ORG_ID / OPENAI_PROJECT_ID

—

Sent as OpenAI-Organization / OpenAI-Project

OPENAI_IMAGE_TIMEOUT_MS

600000

Request timeout

Tools

generate_image

Param

Notes

prompt

Required, up to 32,000 characters

model

Any model ID; defaults to OPENAI_IMAGE_MODEL

size

auto, 1024x1024, 1536x1024, 1024x1536; on gpt-image-2 and the 2.5 models, any WxH with both sides multiples of 16, aspect ratio between 1:3 and 3:1, and at most 3840x2160 (sizes above 2560x1440 are experimental)

quality

auto, low, medium, high; the 2.5 models also accept xhigh and max

background

auto, opaque, transparent (transparent needs png or webp output)

output_format / output_compression

png, jpeg, webp; compression is 0–100 and applies to jpeg/webp only

n

1–10

moderation

auto or low

output_dir, filename_prefix

Override where and under what name images are saved

include_images

Also return the images inline. Off by default because the data is large.

edit_image

Takes everything generate_image takes, plus:

Param

Notes

images

1–16 local paths (png/jpg/webp), http(s) URLs, data URLs, or OpenAI file IDs (file-...)

mask

Optional PNG whose transparent pixels mark the area to edit

input_fidelity

low or high on gpt-image-1.5 and chatgpt-image-latest; only low on gpt-image-1-mini; leave it out on gpt-image-2 and newer

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

gpt-image-2.5-flare

Fast everyday generation (default)

✓

✓

✓

gpt-image-2.5-sunburst

Premium quality, precise edits

✓

✓

✓

gpt-image-2

General use, high-fidelity inputs

✓

—

preview

gpt-image-1.5 / chatgpt-image-latest

Fixed sizes, input_fidelity

—

—

✓

gpt-image-1-mini

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 --watch

License

MIT

Available Tools

3 tools
edit_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.

NameRequiredDescriptionDefault
nNoNumber of images (1–10). Default 1.
maskNoMask image (same forms as images). PNG with alpha; same size as the first image.
sizeNo"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").
modelNoOpenAI 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
imagesYes1–16 input images: local file paths (png/jpg/webp), http(s) URLs, data URLs, or OpenAI file IDs.
promptYesWhat to generate. Describe style in the prompt.
qualityNoDefault "auto". xhigh and max are only on gpt-image-2.5-flare / -sunburst.
backgroundNo"transparent" needs output_format png or webp.
moderationNo"low" = less restrictive filtering.
output_dirNoWhere to save files. Default /root/Pictures/openai-image-mcp.
output_formatNoDefault png.
include_imagesNoAlso return the images inline so the client can display them. Large; off by default.
input_fidelityNoHow closely to preserve input details/faces. gpt-image-1.5: low|high; gpt-image-1-mini: low; omit for gpt-image-2+.
filename_prefixNoFile name prefix. Defaults to a slug of the prompt.
output_compressionNo0–100, jpeg/webp only.

TDQS

A3.5/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
nNoNumber of images (1–10). Default 1.
sizeNo"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").
modelNoOpenAI 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
promptYesWhat to generate. Describe style in the prompt.
qualityNoDefault "auto". xhigh and max are only on gpt-image-2.5-flare / -sunburst.
backgroundNo"transparent" needs output_format png or webp.
moderationNo"low" = less restrictive filtering.
output_dirNoWhere to save files. Default /root/Pictures/openai-image-mcp.
output_formatNoDefault png.
include_imagesNoAlso return the images inline so the client can display them. Large; off by default.
filename_prefixNoFile name prefix. Defaults to a slug of the prompt.
output_compressionNo0–100, jpeg/webp only.

TDQS

A3.6/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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 modelsA
Read-only

List supported OpenAI image models with their capabilities, the default model, and retired models.

NameRequiredDescriptionDefault

No parameters

TDQS

A3.9/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose4/5

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.

Usage Guidelines3/5

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.

  1. 3 tool updatesv1.0.0
    • First observededit_image
    • First observedgenerate_image
    • First observedlist_models

TDQS

A3.9/5.0

Scored across 3 tools

Disambiguation5/5

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.

Naming Consistency5/5

All names follow a consistent snake_case verb_noun pattern (generate_image, edit_image, list_models), with plain, predictable verbs and no style mixing.

Tool Count4/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    A
    quality
    B
    maintenance
    Generates 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.
    1
    17 npm
    1
    Apache 2.0
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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 npm
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Enables 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 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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 npm
    1
    MIT