gpt-image-2-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| OPENAI_ORG_ID | No | Forwarded as organization | |
| OPENAI_API_KEY | Yes | Auth | |
| OPENAI_BASE_URL | No | Override for proxies / enterprise routes | |
| OPENAI_PROJECT_ID | No | Forwarded as project | |
| GPT_IMAGE_2_MCP_DEBUG | No | Set to '1' to emit verbose debug logs on stderr. | |
| GPT_IMAGE_2_OUTPUT_DIR | No | Global default for where images are saved. Absolute paths used as-is, relative resolved from CWD. | |
| GPT_IMAGE_2_SESSION_MAX | No | Max concurrent in-memory edit sessions, LRU-evicted beyond this (default 20; '0' = no cap). | |
| GPT_IMAGE_2_SESSION_TTL_MS | No | Idle TTL before an edit session is swept (default 3600000 = 1h; '0' = never expire). | |
| OPENAI_RESPONSES_EDIT_MODEL | No | Host model used by the Responses-API fallback edit route (default gpt-4.1-mini). | |
| OPENAI_FORCE_RESPONSES_EDITS | No | Set to '1' to pin edits to the Responses-API fallback route instead of /v1/images/edits. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| generate_imageA | Generate an image from a text prompt using OpenAI's gpt-image-2 model. The image is written to disk and also returned inline so you can see it. gpt-image-2 handles photoreal, illustrations, infographics, multilingual text (incl. CJK), and complex structured visuals. It does NOT support transparent backgrounds. Sizes accept presets or any custom "WxH" where edges are multiples of 16, max edge 3840px, aspect ratio within 1:3–3:1, total pixels 655K–8.29M. |
| edit_imageA | Edit or compose images with gpt-image-2. Give 1–8 input images plus a text prompt; optionally include a PNG mask whose transparent regions mark what to change (mask applies to the first image). Great for: swap backgrounds, retouch products, combine multiple reference images into one composition, maintain a character across scenes. gpt-image-2 always processes inputs at high fidelity (no input_fidelity knob needed). The edited image is saved to disk and returned inline. |
| start_edit_sessionA | Begin a stateful multi-turn edit session. Returns a session_id you then pass to continue_edit_session to iteratively refine the image (each turn uses the previous turn's output as the input). Use end_edit_session when done. |
| continue_edit_sessionA | Apply another edit turn to an existing session. The previous turn's output image is used as the input. Use short, focused prompts like "make the sky more orange" or "add a small boat on the horizon"; include "keep everything else the same" to limit drift. Returns the new image and the updated session. |
| end_edit_sessionA | Free an iterative-edit session. Safe to skip — sessions are in-memory only and are discarded on server restart — but calling this frees memory sooner and keeps list_edit_sessions tidy. |
| list_edit_sessionsA | List active iterative-edit sessions (in-memory only, discarded on server restart). Useful to recover a session_id after a client reconnect. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 6 tools
Each tool has a distinct purpose: generate_image for single generation, edit_image for one-shot edits, start/continue/end_edit_session for iterative multi-turn editing, and list_edit_sessions for session management. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern in snake_case (e.g., edit_image, generate_image, start_edit_session). The naming is predictable and follows the same convention throughout.
With 6 tools, the server is well-scoped for image generation and editing. It covers the core functionality without being excessive or insufficient.
The tool surface covers the full lifecycle: single generation, one-shot edit, iterative editing sessions (start, continue, end), and session listing. No obvious gaps for the domain.