gpt-image
Enables image generation and editing with OpenAI's GPT Image model through the local Codex CLI, using a ChatGPT login instead of an API key. Supports prompts, reference images, transparent backgrounds, multiple outputs, and background job retrieval.
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., "@gpt-imageMake a 16:9 hero image: matte black coffee grinder on a concrete counter, soft light"
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.
mcp-gpt-image
MCP server and skill that let Claude Code generate and edit images with GPT Image through your local Codex CLI. Uses your ChatGPT login. No OpenAI API key.
Claude writes the prompt. Codex passes it to its built-in image_gen tool. The image is saved to disk and returned to Claude inline. The skill makes Claude ask a short round of questions first (at most 4, only what changes the image), then review every image against a strict checklist and regenerate (up to 3 attempts) until it passes.
Requirements
Node.js 20 or newer
git (npx downloads this package from GitHub)
Claude Code
Codex CLI, signed in with a ChatGPT plan that includes image generation:
npm install -g @openai/codexcodex loginRelated MCP server: GPT Image 2 MCP Server
Install
npx -y github:Monayzera/mcp-gpt-image setupThis does three things:
Copies the skill (
SKILL.mdandstyles.md) to~/.claude/skills/gpt-image/(or$CLAUDE_CONFIG_DIR/skills/gpt-image/).Registers the MCP server in Claude Code at user scope, as
npx -y github:Monayzera/mcp-gpt-image(on Windows, wrapped incmd /c). IfCODEX_PATHis set, it is passed to the server. An existinggpt-imageentry at user scope is left unchanged; one in another scope is reported so you can remove it.Checks that Codex is installed and signed in.
Restart Claude Code afterwards. claude mcp list should show gpt-image as connected.
Running setup again replaces the skill file with the latest version, including any local edits. npx fetches the newest commit on each start, so the server updates by itself.
To register only the MCP server, without the skill:
claude mcp add --scope user gpt-image -- npx -y github:Monayzera/mcp-gpt-imageUninstall
npx -y github:Monayzera/mcp-gpt-image uninstallRemoves the skill and runs claude mcp remove gpt-image --scope user.
Use
Ask Claude for an image. The skill takes over: questions, prompt, generation, review, retries.
Questions come in one round of at most 4, each with a recommended option first. Claude skips anything your request already answers, and skips the round entirely when the request is complete or you say "no questions" / "sem perguntas".
Make a 16:9 hero image for the landing page: a matte black coffee grinder on a concrete counter, soft window light.
Edit assets/logo.png: keep the shape, make the background transparent.
To use a real logo, product or photo, paste or attach the image in the chat. Claude Code gives Claude its file path, and Claude passes it in reference_images.
styles.md holds prompt recipes for photo and illustration styles (phone snapshot, editorial, film, product, documentary, cinematic, flat vector, 3D, watercolor, comic, logo, poster, and more). Each one is tagged with how it was verified: tested here, OpenAI documentation, or community sources.
Size and aspect ratio are not parameters. They go in the prompt: "16:9" returned 1672x941 in testing.
Tools
generate_image
Parameter | Default | Description |
| required | The image prompt. |
|
| Images from the same prompt, 1 to 4. Each one uses your quota. Codex may return fewer. |
|
| Asks for a transparent background. The result reports whether the PNG has an alpha channel. |
| none | Up to 16 local images to edit or use as references (PNG, JPEG, WebP, GIF). Absolute, relative to the project, or starting with |
|
|
|
| Codex config | Codex chat model that relays the request. It does not choose the image model. |
|
| Reasoning effort for that model. |
|
| A directory, or a file path. The name is kept; the extension follows the returned format (PNG). |
|
| Return a job id at once and keep generating; collect it with |
The result lists each saved path with its size, the prompt that reached GPT Image (when Codex reports it), the alpha check when transparency was requested, and the usage limits Codex reports (5-hour and weekly windows).
get_image_result
Returns the result of a background: true job: the same text and images as a normal call, or its status while it runs. wait_seconds (0-600) waits at most that long and returns as soon as the job finishes. Images are returned on the first successful collection only. At most 4 jobs run at once; finished jobs are kept for 1 hour and are lost if the server restarts.
Claude Code can also move any long MCP call to the background by itself. To make that happen after 10 seconds instead of 2 minutes, add "CLAUDE_CODE_MCP_AUTO_BACKGROUND_MS": "10000" to the env block of ~/.claude/settings.json. In the Claude desktop app (Code tab) also add "CLAUDE_AUTO_BACKGROUND_TASKS": "1"; without it the call was not moved to the background in testing.
codex_status
Shows the Codex path and version, sign-in state, usage limits with reset times, the Codex config default model, the models with the reasoning efforts each one accepts, and the save folder.
Prompt modes
In exact mode Codex is told to call image_gen with your text, character for character. The prompt that reached GPT Image is compared with yours, and the result says whether they match.
The Codex model and reasoning effort do not draw the image. The model matters most in enhance mode, where it writes the final prompt.
Files
<project>:CLAUDE_PROJECT_DIRif set, else the workspace root reported by Claude Code, else the current directory.Default name: date, time and the first six words of the prompt, e.g.
generated-images/2026-10-14_120030_a-minimalist-flat-illustration-of-a.png.Several images get
_1,_2, ...Existing files are never overwritten. A
-2,-3, ... suffix is added.Codex also keeps its own copy in
~/.codex/generated_images/.
Settings
Variable | Purpose |
| Full path to the |
| Default Codex model for every call, e.g. |
| Default reasoning effort, e.g. |
The automatic search checks PATH, then common install folders: the official installer folder (~/.local/bin, or %LOCALAPPDATA%\Programs\OpenAI\Codex\bin on Windows), npm global, nvm, pnpm, Volta, Bun, asdf and Homebrew.
claude mcp add --scope user gpt-image -e GPT_IMAGE_MODEL=gpt-6-astra -e GPT_IMAGE_EFFORT=max -- npx -y github:Monayzera/mcp-gpt-imagesetup passes CODEX_PATH, GPT_IMAGE_MODEL and GPT_IMAGE_EFFORT to the server when they are set in your shell.
In exact mode the Codex model only relays the prompt. In testing, the same prompt with gpt-6-astra and effort max used about 4% of the 5-hour window, against about 1% with the default model and effort low, and the image was not better.
Troubleshooting
Message | Fix |
| Install Codex, or set |
| Fix the path, or remove |
| Run |
| Wait for the reset time shown by |
| The lines after it give the reason. |
| Install git. |
Tool call moved to background | Normal. Claude Code can move long MCP calls to the background and delivers the result when they finish. |
How it works
On the first call the server starts
codex app-server(JSON-RPC over stdio) and keeps it running.Each request opens an ephemeral, read-only Codex thread whose instructions are to call
image_genwith the prompt.Codex reports each
imageGenerationitem. The server writes each image to disk and returns it with the usage limits Codex reports.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
- lightgenOAuthapp.lightgen
Generate and edit images and create short videos inside Claude. Prepaid credits, no subscription.
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 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.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables generating images from text prompts using OpenAI's GPT-Image-2 model within Claude Code and Codex conversations.1-
- AlicenseNot gradedqualityAmaintenanceEnables image generation and editing using OpenAI's GPT Image 2 model within a Claude Desktop Code project workspace, with security boundaries and no-overwrite file handling.MIT
- AlicenseAqualityCmaintenanceEnables Claude to generate and edit images using OpenAI's GPT Image models, with automatic model selection and local file saving.31MIT
- AlicenseNot gradedqualityCmaintenanceEnables generating images directly from Claude Code using the ChatGPT subscription's built-in Codex CLI and gpt-image-2, with no API key or separate credits.MIT