GPT Image 2 MCP Server
Generates and edits images using OpenAI's GPT Image 2 model, with support for prompt-based generation, editing with masks, configurable size, quality, output format, and compression, while enforcing workspace security and no-overwrite policies.
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., "@GPT Image 2 MCP Servergenerate an image of a futuristic city skyline at sunset"
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.
GPT Image 2 plugin for Claude Desktop Code
Generate and edit project images with OpenAI GPT Image 2 through a bundled local MCP server. The plugin writes one validated image per paid call, keeps files inside an approved project workspace, and never overwrites an existing destination.
Supported Claude surface
This plugin is for Claude Desktop Code, the project-oriented Code experience in the Claude Desktop application. Claude Desktop Chat is not supported. It is not an MCPB package and is not a remote MCP service.
Related MCP server: mcp-openai-images-audio
Install through the Claude Desktop Code GUI
GUI plugin installation is the primary path:
Open the target project in Claude Desktop Code.
Open the GUI Settings → Plugins area. Labels may vary slightly by Claude release.
Add this repository root as a local marketplace or select its repository source, then install
gpt-image-2@kpk-plugins.Enable the installed plugin for the current project. Enablement is project-specific; installing it does not grant access to every project automatically.
Open the plugin settings for configuration. Do not copy
.mcp.jsoninto ordinary settings.
The plugin root is the marketplace root, and the marketplace entry points to ./.
Runtime requirement
The only runtime dependency is Node.js 20+, available on the PATH seen by Claude Desktop Code. The installed plugin starts the prebuilt dist/server.mjs directly. At runtime, the plugin does not run npm, npx, lifecycle scripts, source compilation, or load node_modules.
The committed marketplace copy includes the standalone bundle. An installed-copy test launches only Git-tracked files and verifies that get_status works with no node_modules directory present and without an API key.
npm and development dependencies are needed only by contributors building or testing the source checkout.
Configure in the GUI
In plugin settings, enter the API key in the sensitive OpenAI API key field. Do not put it in a command line, .env, .mcp.json, ordinary settings, a README, a prompt, or a log, and do not ask Claude to display or inspect it.
The default official Base URL is:
https://api.openai.com/v1A custom Base URL receives the API key, prompts, and edit images sent by this plugin. Configure one only when you trust that endpoint and its operator. A custom endpoint should usually include /v1; the plugin does not append it automatically. The only user-facing documentation example is:
https://api.example.invalid/v1The URL must be an absolute HTTP(S) URL without credentials, a query, a fragment, control characters, or surrounding whitespace. A compatible endpoint must implement the image API used by the OpenAI client; compatibility is not implied merely by accepting a URL.
HTTP is permitted for trusted local or private-network compatible endpoints, but it sends the API key, prompts, and edit images without transport encryption. Use an http:// Base URL only on a network and endpoint you trust; prefer HTTPS otherwise.
Run /gpt-image-2:setup after installation. The command calls only get_status and makes no provider request.
Tools
get_status
Reports only safe status data: API-key configured boolean, whether a custom Base URL is configured, base_url_valid: true for the active URL of a running server, approved workspace roots, model, server version, and the default relative output directory. An invalid configured Base URL prevents server startup; correct it in plugin settings and reload or restart the plugin. get_status makes zero provider or image API requests and never returns the key or Base URL value.
generate_image
Generates one image with model gpt-image-2, fixed n: 1, and saves one new file. Main inputs are:
promptquality:auto,low,medium, orhighsizeoutput_format:png,jpeg, orwebpoptional JPEG/WebP
output_compressionfrom 0 to 100moderation:autoorlowoptional relative
output_pathand approvedworkspace_root
edit_image
Edits one to eight edit inputs in the supplied order and saves one new image. Inputs may be PNG, JPEG, or WebP. The limit is 50 MiB per input and 200 MiB aggregate across all edit images plus the optional mask.
An optional mask must be a PNG with an alpha channel, match the first input image's dimensions, and be less than 4 MiB. Transparent output backgrounds are not supported; mask alpha only identifies the edit region.
Formats, sizes, and output
Output formats: PNG, JPEG, and WebP.
The tool default size is
1024x1024.autois also accepted.A custom
WIDTHxHEIGHTmust use multiples of 16, each edge must be at most 3840 pixels, aspect ratio must be between 1:3 and 3:1, and total pixels must be between 655,360 and 8,294,400.PNG does not use output compression. JPEG and WebP accept compression values from 0 to 100.
If
output_pathis omitted, output goes under.claude/generated-images/gpt-image-2with a unique prompt-free filename.Explicit output paths are preserved, must be relative to an approved workspace root, and must use an extension matching the requested format.
Existing destinations are rejected. No-overwrite publication also prevents concurrent calls from replacing the same target.
Actual dimensions are preserved and reported after the saved image is decoded and validated. If an explicit requested size differs, the file remains saved with its actual dimensions and the result includes SIZE_MISMATCH.
Images at or below 2 MiB include an inline preview. For larger images, the inline preview is omitted; the saved file path remains authoritative. TEMP_CLEANUP_PENDING means the output was saved successfully but cleanup of a temporary publication file is still pending.
Cost, concurrency, and retries
Generation and editing are paid provider operations. The plugin fixes one output per request and permits one paid call at a time in each server process. There are no SDK retries and no application retries, so a failed paid call is not automatically repeated. Confirm prompts, edit inputs, size, format, and output path before invoking an image tool.
Workspace and security boundary
Outputs stay inside a workspace root approved by Claude Desktop Code. Output paths cannot be absolute or traverse outside the root.
Contained absolute input paths are accepted only when they already resolve inside an approved root; an input path never grants a new root.
Input files are copied through stable handles into private temporary snapshots before upload. Originals are not modified.
Provider output is strictly decoded, image-validated, flushed, and published with no-overwrite semantics.
Logs accept only bounded status codes and numeric context; prompts, API keys, Base URLs, image data, Base64, and full input paths are excluded.
Windows Node 20 Junction boundary
On Windows under Node 20, existing reparse-point/Junction escapes are rejected, and output parent paths are rechecked immediately before exclusive publication. An active directory replacement by another same-authority process between checks remains outside the threat boundary. A native Win32 handle-relative helper would be required to remove that same-authority replacement race completely.
Troubleshooting
API key not configured: open Claude Desktop Code plugin settings and populate the sensitive API-key field. Do not paste the key into chat or a shell.
Invalid or unused custom Base URL: an invalid configured Base URL prevents the server from starting. Correct it in plugin settings, confirm the setting was saved, then reload or restart the plugin. Custom endpoints should usually end in
/v1; no/v1segment is added automatically.No approved workspace root: open the project in Claude Desktop Code and enable the plugin for that project.
OUTPUT_EXISTS: choose a new relative output path. The plugin will not overwrite.SIZE_MISMATCH: use the returned actual width and height; the saved image is valid.Preview omitted: open the returned relative or absolute path; inline previews are limited to 2 MiB.
Build and test from source
Development commands may install and use development dependencies; they are not part of installed-plugin runtime behavior. The validation command disables implicit npm lifecycle hooks before checking that the approved script set is exact.
npm ci --ignore-scripts
npm run typecheck
npm test
npm run build
npm run test:dist
npm --ignore-scripts run validateThese checks use local fixtures, fakes, and protocol tests. No paid image request is required. No live provider verification has been performed or claimed.
License
MIT © 2026 KPK. See LICENSE and THIRD_PARTY_NOTICES.md.
This server cannot be installed
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
- Alicense-qualityDmaintenanceEnables image generation using OpenAI's DALL-E and GPT-Image models directly through the Model Context Protocol. It allows users to create and save images with fine-grained control over parameters like size, quality, and background transparency.46MIT
- AlicenseAqualityBmaintenanceExposes OpenAI's gpt-image-2 and gpt-image-1.5 to Claude Code as a single tool for generating, editing, or composing images with automatic model selection.11MIT
- AlicenseAqualityCmaintenanceEnables image generation and editing using OpenAI's GPT Image API (gpt-image-1, 1.5, 2) with support for multi-image generation, history management, and batch processing.121,7841MIT
- Flicense-qualityCmaintenanceEnables generating images from text prompts using OpenAI's GPT-Image-2 model within Claude Code and Codex conversations.
Related MCP Connectors
OCR, transcription, file extraction, and image generation for AI agents via MCP.
Generate images, video, and audio with Glif's media-generation agent
Generate images and video on Google Flow (Veo, Nano Banana) 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/kpkhxlgy0/claude-openai-gpt-image'
If you have feedback or need assistance with the MCP directory API, please join our Discord server