Skip to content
MCP server

codex-imagegen-mcp MCP Server

MCP server + Agent Skill that brings OpenAI Codex's image generation to your coding tools, with a one-command installer for opencode, Claude Code, Codex, Cursor, VS Code, Gemini CLI and 20 more. Runs on your ChatGPT plan with no API key.

codex-imagegen-mcp scores 51 (Fair), licensed Apache-2.0 and written in TypeScript. It installs as a local process. It declares 5 tools. Filed under Design, Version control, AI and memory. GitHub shows 12 stars. Package registries report about 156 downloads a week. Install configs are generated for 10 clients. Being listed in the registry is not the same as being vendor-official.

by shalomobongoApache-2.0TypeScript12 stars
Trust score
51Fair
Trust score 51 of 100, Fair

Fair trust

51 of 100 from six public signals. Nobody can buy a point.

  • OSI-style license: apache-2.0.
How we score trust
Scorecard

License, quality and maintenance

How grades work
Trust breakdown

Where the 51 comes from

0 + 20 + 7 + 10 + 4 + 10 = 51. Each factor is capped, so no single signal can carry a listing.

Registry0 / 30

Active in the official MCP registry, plus a known vendor namespace.

Registry: 0 of 30 points.
Maintenance20 / 20

How recently the repository saw a commit or release.

Maintenance: 20 of 20 points.
Popularity7 / 20

GitHub stars and weekly downloads, on a log scale.

Popularity: 7 of 20 points.
License10 / 10

A clear, OSI-style open-source license.

License: 10 of 10 points.
Security4 / 10

Not archived, a secure install path, a pinned version.

Security: 4 of 10 points.
Docs10 / 10

A real summary, a README with depth, listed tools.

Docs: 10 of 10 points.

Install

Pick your client, copy the config, paste it in.

Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.

~/Library/Application Support/Claude/claude_desktop_config.json
{  "mcpServers": {    "shalomobongo-codex-imagegen-mcp": {      "command": "npx",      "args": [        "-y",        "codex-imagegen-mcp@0.2.2"      ]    }  }}

Environment variables

This server does not declare environment variables.

Tools5Tool docs quality grade D

All capabilities
  • Sign-in, plan, credential source, usage windows

  • Edit images, or generate from 1–5 references

  • A new image from a prompt

  • Cut a flat backdrop out locally (no quota)

  • Start a ChatGPT sign-in and return a link or code for you

About

What it does

See it work

Two real opencode sessions in a scratch project. The images are exactly what came back:

You: I need a sticker-style illustration of a cute cartoon cactus with a transparent background for this project. Save it as assets/cactus-sticker.png.

opencode · openai/gpt-5.5 loads the skill → imagegen_generate_image with background: "transparent" → "Saved assets/cactus-sticker.png, 1254×1254 PNG with a transparent background."

You: Make a 16:9 hero banner for the Cactus Shop landing page, and a variant of the sticker where the cactus wears a tiny straw hat. Keep everything else identical.

opencode · github-copilot/claude-sonnet-5 → imagegen_auth_status → imagegen_generate_image (aspect_ratio: "16:9") and imagegen_edit_image (images: ["assets/cactus-sticker.png"]) in parallel → both saved, the edit with "transparent background (alpha verified)".

One prompt, three canvases. aspect_ratio doesn't crop. The service composes a new picture for each shape:

A green screen becomes alpha on your machine. remove_background keys out a flat backdrop locally, with no network call and no quota:

[!TIP] Every image in this repository was made with codex-imagegen-mcp itself. That covers the posters, the badges, the logo and the examples; the installer screenshots are real terminal output. The prompts and the art-direction record are in docs/assets.

Quick start

[!NOTE] You need Node.js 22+ and a ChatGPT plan that includes Codex (Plus, Pro, Business, Enterprise, Edu…). Codex image generation isn't available on the Free plan.

1 · Run the installer. npx fetches the latest release, so there's nothing to install first. The installer finds the coding tools on this machine, shows exactly which files it will create or change, and writes nothing until you confirm. Each config keeps its comments and formatting.

npx -y codex-imagegen-mcp install

The configs it writes start the server through npx as well; npm downloads it on first use and caches it. The installer also runs without questions, for scripts and dotfiles:

npx -y codex-imagegen-mcp install opencode cursor claude-code   # named tools (see --list)
npx -y codex-imagegen-mcp install --all --dry-run               # every detected tool, preview only

A global install gives you the short codex-imagegen-mcp command. The installer then writes an absolute Node path instead of npx, which starts faster and doesn't depend on npx. That suits GUI apps like Claude Desktop and Cursor best:

npm install --global codex-imagegen-mcp
codex-imagegen-mcp install

The same package is attached to every GitHub release with a signed build-provenance attestation:

npm install --global https://github.com/ShalomObongo/codex-imagegen-mcp/releases/latest/download/codex-imagegen-mcp.tgz

From source:

git clone https://github.com/ShalomObongo/codex-imagegen-mcp.git && cd codex-imagegen-mcp
npm ci && npm run build
npm link                                  # puts `codex-imagegen-mcp` on your PATH

2 · Sign in with ChatGPT. The installer offers this at the end. Skip it if Codex or opencode is already signed in with ChatGPT.

npx -y codex-imagegen-mcp login           # opens the browser; use --device on a headless machine

3 · Check, then ask for pictures

npx -y codex-imagegen-mcp doctor          # Node, credentials, quota, and every tool it's installed in
you › Make a 16:9 hero image of a lighthouse at dusk and save it to assets/hero.png

[!TIP] From here on, commands use the short codex-imagegen-mcp from a global install. Without one, run them through npx the same way, for example npx -y codex-imagegen-mcp status.

How it works

sequenceDiagram
    autonumber
    participant A as Your agent<br/>(opencode, Claude Code…)
    participant M as imagegen MCP server<br/>(local · stdio)
    participant O as auth.openai.com
    participant C as chatgpt.com<br/>/backend-api/codex
    A->>M: generate_image {prompt, aspect_ratio, background}
    M->>M: pick credentials: own sign-in → Codex → opencode
    opt token expires within 5 minutes
        M->>O: refresh (under a cross-process lock)
        O-->>M: new access token + rotated refresh token
    end
    M->>C: POST /images/generations · Bearer token · ChatGPT-Account-ID
    loop every 5 s while the image renders
        M-->>A: progress notification (keeps the client's timeout alive)
    end
    C-->>M: PNG + usage headers
    M->>M: save without overwriting · verify alpha · build preview
    M-->>A: path, size, background + a 1024 px preview

It sends the same request as the image tool built into the Codex app, byte for byte. As OpenAI improves Codex's image model on the server, this server gets the same upgrade. How that was reverse-engineered →

Signing in

You already have…What happens
Codex (CLI or desktop app) signed in with ChatGPTWorks immediately. The server borrows ~/.codex/auth.json read-only.
opencode signed in with OpenAI → ChatGPT Plus/ProWorks immediately. It borrows ~/.local/share/opencode/auth.json read-only.
Neither, or you want an independent sign-inRun codex-imagegen-mcp login, or ask your agent to call the sign_in tool.
codex-imagegen-mcp login            # browser → sign in → "You're signed in to Codex ImageGen MCP"
codex-imagegen-mcp login --device   # SSH/headless: enter a code at auth.openai.com/codex/device
codex-imagegen-mcp status           # account, plan, credential source and usage windows
codex-imagegen-mcp logout           # remove and revoke this tool's own sign-in

[!IMPORTANT] OpenAI refresh tokens are single-use. Borrowed sign-ins are therefore never refreshed or modified, so this server can't sign you out of Codex or opencode. Its own tokens are stored 0600 and refreshed under a lock shared by every server process. Authentication in depth →

Tools

ToolWhat it doesKey parameters
generate_imageA new image from a promptprompt · aspect_ratio · background · n · output_path
edit_imageEdit images, or generate from 1–5 referencesimages · prompt · same options
remove_backgroundCut a flat backdrop out locally (no quota)input_path · key_color (auto) · output_path
auth_statusSign-in, plan, credential source, usage windowscheck_usage
sign_inStart a ChatGPT sign-in and return a link or code for youmethod (browser · device)

The server also exposes the resources imagegen://history, imagegen://images/{id} and imagegen://skill/*, and the prompts generate and edit. In opencode the prompts appear as /imagegen:generate and /imagegen:edit. Full reference →

From the terminal

The CLI uses the same engine as the MCP tools:

codex-imagegen-mcp generate "a watercolor fox in a snowy forest" -a 16:9 -o art/fox.png
codex-imagegen-mcp generate "Image 1: add a tiny straw hat; keep everything else" \
  -i assets/cactus.png -b transparent -o assets/cactus-hat.png
codex-imagegen-mcp remove-bg sprite-on-green.png -o sprite.png
codex-imagegen-mcp config zed              # print a tool's config snippet to add by hand

Supported tools

Terminal agentsOpenCode · Claude Code · Codex · Gemini CLI · GitHub Copilot CLI · Amp · Goose · Factory Droid · Qwen Code · JetBrains Junie · Augment (Auggie)
Editors & IDEsCursor · VS Code, Insiders and VSCodium · Devin Desktop (formerly Windsurf) · Zed · Kiro · Google Antigravity · Visual Studio (Windows)
Desktop appsClaude Desktop, with the skill as an uploadable zip
Editor extensionsCline · Zoo Code / Roo Code · Kilo Code
By handJetBrains AI Assistant (the installer prints the JSON to paste) · anything else: codex-imagegen-mcp config <tool>

Each tool gets its own config format, timeout field and skill folder. install --list shows which ones are on your machine. Files, timeouts and skill folders per tool →

Documentation

FAQ

No extra money. Images come out of your ChatGPT plan's Codex usage limits, the same as images you make in the Codex app. codex-imagegen-mcp status (or the auth_status tool) shows the 5-hour and weekly windows, and checking them uses no quota.

Yes. The endpoint, request body and auth headers are identical to the ones the Codex desktop app sends. The service picks the model, resolution and quality itself, for Codex and for this server alike.

Not with a ChatGPT sign-in. The service ignores model, size, quality and n. That was measured, including requests for the newer gpt-image-2.5-sunburst and -flare models, and the tools deliberately don't pretend otherwise. Choose the shape with aspect_ratio; for exact pixels, resize or crop afterwards. Selecting a model explicitly requires the billed OpenAI Platform API, which is out of scope by design. The measurements →

They go to output_path, relative to your workspace, when you give one. Otherwise they land in the image library at ~/.local/share/codex-imagegen-mcp/images/<date>/. Every file is also recorded in imagegen://history. Existing files are never replaced unless you pass overwrite: true.

No. Borrowed sign-ins are read-only: they're used while their access token is valid and are never refreshed or written. Its own sign-in (login) is independent. Why that matters →

No. It's an unofficial integration that uses the same public OAuth client and internal ChatGPT endpoints as the Codex CLI, as opencode's ChatGPT sign-in also does. Those interfaces are undocumented and may change. Use it within OpenAI's Terms of Use.

Yes, and you can check. The release pipeline builds each release once, from a tagged commit on main, and tests it on Linux, macOS and Windows. It then publishes it through npm's trusted publishing, so no token is involved. The npm package and the GitHub release tarball are the same file, and both carry signed provenance that names the tag and commit:

npm audit signatures        # in a project that depends on codex-imagegen-mcp
gh attestation verify codex-imagegen-mcp-X.Y.Z.tgz --repo ShalomObongo/codex-imagegen-mcp

Release integrity →

Configuration

VariableDefaultPurpose
CODEX_IMAGEGEN_HOME~/.local/share/codex-imagegen-mcpCredentials, history, logs and the default image library
CODEX_IMAGEGEN_OUTPUT_DIR$CODEX_IMAGEGEN_HOME/imagesWhere images go when no output_path is given
CODEX_IMAGEGEN_CREDENTIALSautoauto (own → Codex → opencode), or pin own, codex or opencode
CODEX_IMAGEGEN_TIMEOUT_MS300000Per-request timeout for the image service
CODEX_IMAGEGEN_LOG_LEVELinfodebug, info, warn, error or silent; the log is $CODEX_IMAGEGEN_HOME/server.log
CODEX_IMAGEGEN_NO_BROWSERunsetNever open a browser automatically
CODEX_HOME~/.codexWhere to look for a Codex sign-in
CODEX_IMAGEGEN_ORIGINATORcodex-imagegen-mcpThe originator identifying this client to OpenAI

Test-only overrides: CODEX_IMAGEGEN_BASE_URL, CODEX_IMAGEGEN_USAGE_URL, CODEX_IMAGEGEN_AUTH_ISSUER, CODEX_IMAGEGEN_CLIENT_ID, CODEX_IMAGEGEN_OPENCODE_AUTH_FILE.

Troubleshooting

Start with codex-imagegen-mcp doctor. It checks Node, the data directory, credentials, backend reachability and quota, the sign-in ports, every tool that has imagegen configured, and the skill copies.

SymptomFix
Not signed incodex-imagegen-mcp login (or --device), or open Codex/opencode once so their sign-in refreshes
usage limit … resets in …Wait for the reset; status shows the windows
ports 1455 and 1457 are busyAnother Codex or opencode login is waiting. Finish it, or use login --device
Device-code sign-in is not enabledChatGPT → Settings → Security → allow device code authorization for Codex
Tools missing in a clientRun doctor, re-run install <tool>, then restart the tool (install --list shows the ids)
conflict in the installerAnother server already uses the name imagegen: pass --name, or --force to replace it
An opaque result despite transparentRetry, or generate on a flat #00FF00 backdrop and run remove_background
npm error ETARGET · No matching version foundThe release is minutes old: npm takes a minute or two to serve a new version to installs. Wait and retry; npx --prefer-online -y codex-imagegen-mcp install also skips npm's local metadata cache

Still stuck? See getting help.

Contributing

Bug reports, docs fixes, support for more clients and backend measurements are welcome. Start with CONTRIBUTING.md; security issues go through SECURITY.md, never public issues. Every release is listed in the changelog.


Frequently asked questions

What is codex-imagegen-mcp MCP Server?

MCP server + Agent Skill that brings OpenAI Codex's image generation to your coding tools, with a one-command installer for opencode, Claude Code, Codex, Cursor, VS Code, Gemini CLI and 20 more. Runs on your ChatGPT plan with no API key.

How do I install codex-imagegen-mcp MCP Server in Claude Desktop, Cursor, or VS Code?

Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. codex-imagegen-mcp MCP Server runs locally from the npm package codex-imagegen-mcp with the command npx -y codex-imagegen-mcp@0.2.2.

Is codex-imagegen-mcp MCP Server free and open source?

Yes. codex-imagegen-mcp MCP Server is released under the Apache-2.0 license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.

Does codex-imagegen-mcp MCP Server support remote (HTTP) connections?

No remote endpoint is listed for codex-imagegen-mcp MCP Server. It runs locally on your machine over stdio, started by your MCP client.

What tools does codex-imagegen-mcp MCP Server provide?

codex-imagegen-mcp MCP Server provides 5 tools, including auth_status, edit_image, generate_image, and remove_background. See the full tool list for descriptions and parameters.

How is codex-imagegen-mcp MCP Server's trust score calculated?

codex-imagegen-mcp MCP Server scores 51 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.

Reviews

No reviews yet

—Be the first to review

5 star0 reviews at 5 stars
4 star0 reviews at 4 stars
3 star0 reviews at 3 stars
2 star0 reviews at 2 stars
1 star0 reviews at 1 stars

No published reviews yet. Used it? Tell the next person how it went.

Add badge to your README

Paste either snippet into the repository README. The image links to this listing.

Listed on MCPpedia

Top 5 MCP servers

Daily or weekly. Confirm by email, unsubscribe any time.

How often

Manage this listing

Claim this server