chatgpt-image-mcp
Enables image generation and editing through ChatGPT using the ChatGPT desktop app/Codex CLI and a ChatGPT subscription, without an API key. Supports text prompts, reference images, orientation, transparent backgrounds, multiple variants, saving outputs to disk, and returning inline previews.
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., "@chatgpt-image-mcpGenerate a minimalist flat illustration of a fox reading a book, landscape."
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.
🎨 chatgpt-image-mcp
Let Claude generate and edit images with ChatGPT, using the ChatGPT app already on your computer. No API key and no extra billing: images are generated with your ChatGPT subscription.
|
|
|
|
"a cute minimalist flat illustration of a fox reading a book", landscape | "give the fox a small pair of round glasses" |
✨ Features
🖼️ Generate images from a text prompt, optionally guided by reference images
✏️ Edit existing images (change backgrounds or colors, add or remove objects) without touching the original
🔑 No API key: uses the Codex CLI bundled with the ChatGPT desktop app, signed in with your ChatGPT account
👀 Previews: the client gets the image back inline, so Claude can look at the result and iterate
💾 Saved to disk wherever you want, with safe file names and no overwrites
🧩 Works with Claude Code, Claude Desktop and any other MCP client
New here? Jump to Getting started. You can even let your AI install it for you.
Related MCP server: Codex ImageGen MCP
⚙️ How it works
sequenceDiagram
participant C as Claude (MCP client)
participant S as chatgpt-image-mcp
participant X as codex exec (ChatGPT app)
C->>S: generate_image / edit_image
S->>X: headless, read-only run with the built-in image_gen tool
X-->>S: image saved in ~/.codex/generated_images/<thread>
S->>S: copy to output_dir
S-->>C: file path(s) + inline previewThe ChatGPT desktop app for Windows (Microsoft Store package OpenAI.Codex) ships the codex CLI.
That CLI is already signed in with your ChatGPT account and can generate images with its built-in
image_gen tool. For each request, this server runs codex exec in the background with a
locked-down configuration:
--sandbox read-onlyand--ignore-user-config, so it can't run commands and loads none of your personal plugins--ephemeral, so it leaves no chat history behind
The server then collects the resulting image from ~/.codex/generated_images/.
🚀 Getting started
Setup takes about 5 minutes. You can let your AI assistant do it for you (option A), or follow the steps yourself (option B).
Option A: let your AI set it up 🤖
Open Claude Code (or another AI coding agent that can run commands on your computer) and paste this prompt:
Install and configure the MCP server https://github.com/carellice/chatgpt-image-mcp for me.
1. Check that Node.js 18 or newer is installed (`node --version`). If it isn't, stop and tell me to install it from https://nodejs.org.
2. Find the Codex CLI. On Windows it ships with the ChatGPT desktop app:
PowerShell: (Get-AppxPackage -Name OpenAI.Codex).InstallLocation + "\app\resources\codex.exe"
On macOS/Linux, look for `codex` on the PATH.
If you can't find it, stop and tell me to install the ChatGPT desktop app from https://chatgpt.com/download and sign in.
3. Run `<codex> login status`. It must say "Logged in using ChatGPT". If it doesn't, stop and tell me to open the ChatGPT app and sign in.
4. Clone the repository into a permanent folder (for example ~/Documents/GitHub/MCPs/chatgpt-image-mcp, not a temp folder) and run `npm install` there.
5. Register it for all my projects:
claude mcp add chatgpt-image -s user -- node "<absolute path>/index.js"
(For Claude Desktop, add the equivalent entry to claude_desktop_config.json instead.)
6. Verify it with `claude mcp get chatgpt-image`: the status must be "Connected".
7. Tell me where you installed it and remind me to start a new session to use it.Then start a new session and ask for an image.
Option B: step by step 🧭
1. Install the ChatGPT desktop app and sign in
Download it from chatgpt.com/download (on Windows it is also on the Microsoft Store), open it and sign in with your ChatGPT account. Your plan needs to include image generation.
2. Check the sign-in (optional but recommended)
On Windows the app's codex CLI isn't on your PATH, so call it through its full path in PowerShell:
& "$((Get-AppxPackage -Name OpenAI.Codex).InstallLocation)\app\resources\codex.exe" login statusIt should print Logged in using ChatGPT.
🍎🐧 macOS / Linux: install the standalone Codex CLI (
npm i -g @openai/codex) and runcodex login. This hasn't been tested yet, so feedback is welcome.
3. Install Node.js 18 or newer
Check with node --version. If it's missing, install the LTS version from nodejs.org.
4. Download the server into a permanent folder
git clone https://github.com/carellice/chatgpt-image-mcp.git
cd chatgpt-image-mcp
npm install📌 Pick a folder you won't move or delete, such as
Documents/GitHub/MCPs/chatgpt-image-mcp. Your AI client starts the server from this exact path every time.
5. Register it in your AI client
claude mcp add chatgpt-image -s user -- node "C:/full/path/to/chatgpt-image-mcp/index.js"-s user makes it available in every project. Check it with claude mcp get chatgpt-image, which should report ✔ Connected.
Open Settings → Developer → Edit Config and add this to claude_desktop_config.json, then restart Claude Desktop:
{
"mcpServers": {
"chatgpt-image": {
"command": "node",
"args": ["C:/full/path/to/chatgpt-image-mcp/index.js"]
}
}
}Any client that supports stdio MCP servers works. The command is node and the only argument is the full path to index.js.
6. Try it
Start a new session and ask:
Generate an image of a red apple on a white background.
After about a minute you'll get the file path and a preview. 🎉
You never need to start the server by hand: your AI client launches it in the background when a session starts and stops it when the session ends.
💬 Usage
Just ask in plain language:
Generate a landscape hero image for the homepage: minimal, warm tones, a desk with a laptop and a plant.
Create a coffee cup icon with a transparent background and save it in
public/icons.
Edit
assets/logo.pngso the background is navy blue, keep everything else identical.
Give me 3 variants of a blog cover about remote work.
Each image takes roughly 30–90 seconds.
🛠️ Tools
generate_image
Parameter | Type | Default | Description |
| string | required | Detailed description of the image |
| string[] |
| Absolute paths of up to 10 images to use as style or composition references |
|
|
| Aspect ratio |
| boolean |
| Transparent background (PNG with alpha) |
| 1–4 |
| Number of variants |
| string |
| Where to save the files |
| string | timestamp | Base file name, without extension |
| boolean |
| Return the image inline to the client |
edit_image
Accepts the same optional parameters, plus:
Parameter | Type | Description |
| string | required. What to change, and what must stay the same |
| string | required. Absolute path of the image to edit (png, jpg or webp) |
| string[] | Up to 9 supporting images, such as a logo or an object to insert |
🔧 Configuration
Every setting is optional and is set through environment variables (in the env block of your MCP config).
Variable | Default | Description |
|
| Default output directory |
| auto-detected | Path to the |
|
| Codex home directory |
| Codex default | Model that orchestrates the |
|
| Timeout for each call |
🩺 Troubleshooting
Problem | Fix |
| Install or update the ChatGPT desktop app, or set |
| Check the sign-in (step 2 of the setup). Your plan's image limit may have been reached, or the prompt may have been refused by content policies. |
It worked, then stopped | You probably moved or renamed the server folder. Register it again with the new path. |
The tool doesn't show up | Start a new session. Check |
Previews are missing | Images over ~3.5 MB aren't sent inline, but they are still saved to disk. |
⚠️ Notes and limitations
This project relies on how the Codex CLI behaves today:
codex exec --json, the built-inimage_gentool and thegenerated_imagesfolder. A future Codex update could change any of these.Usage counts against your ChatGPT plan's limits, and each call also uses some Codex tokens (roughly 30k–100k input tokens).
Only orientation can be controlled, not exact pixel sizes. Codex picks the resolution.
The original files in
~/.codex/generated_images/are kept. Delete them yourself if you need the space.
📄 License
This is an unofficial community project. It is not affiliated with or endorsed by OpenAI or Anthropic. ChatGPT and Codex are trademarks of OpenAI.
This server cannot be deployed
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
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.
Generate AI images and videos from any compatible MCP client.
Related MCP Servers
- AlicenseAqualityCmaintenanceA local MCP server that enables Claude Code and Claude Desktop to generate and edit images via OpenAI's Images API, saving finished files into the project and returning previews for iterative refinement.3MIT
- AlicenseAqualityAmaintenanceEnables any MCP client to generate and edit images through ChatGPT's Codex backend, saving them locally with no API key or per-image billing.5150 npm8Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to generate and edit images with GPT Image by relaying prompts through a local Codex CLI signed in with a ChatGPT plan, saving results to disk and returning them inline with no OpenAI API key required.16 npm1MIT
- AlicenseAqualityBmaintenanceEnables MCP-compatible coding agents to generate and edit images from text prompts or local files, returning both a saved file path and an inline image block. Supports up to four sequential images per call, model listing, and one-command setup across OMP, Codex, Claude Code, Cursor, and opencode.30MIT

