# codex-imagegen-mcp [Health: Active]

**Category:** 🎥 Multimedia Process  
**Repository:** https://github.com/ShalomObongo/codex-imagegen-mcp  
**GitHub Stars:** 12  
**npm Downloads (last month):** 556  
**Views:** 20  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/codex-imagegen-mcp

## Description
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.

## Tools
Capabilities this server exposes over MCP:

- **generate_image** — Generate a new raster image (photo, illustration, texture, sprite, mockup, icon, product shot…) from a text prompt, using the user's ChatGPT plan — the same image service as OpenAI Codex's built-in image tool, no API key. Saves the full-resolution file and returns its path plus a preview. The service chooses resolution and quality; steer orientation with aspect_ratio or in the prompt. Use background="transparent" for assets that need real alpha. Typically takes 15-60 s.
- **edit_image** — Edit or transform existing images, or create a new image guided by reference images, using the user's ChatGPT plan (no API key). Pass 1-5 images; refer to them in the prompt as Image 1, Image 2… (Image 1 is the primary edit target). State exactly what must change AND what must stay unchanged. Good for background replacement or removal, object removal/insertion, restyling, relighting, text localization, compositing and sketch-to-render. The input file is never modified; the result is saved as a new file.
- **remove_background** — Locally remove a flat, solid-color background from a PNG/JPEG and save a transparent PNG — no network, no quota. Use for images with a uniform backdrop (e.g. generated "on a flat pure #00ff00 background"), or to clean up a cutout. The key color is sampled from the image border unless key_color is given. Prefer background="transparent" on generate_image/edit_image when creating new assets.
- **auth_status** — Show whether image generation is signed in, which ChatGPT account/plan and credential source is used, and the current usage-limit windows. Costs no image quota. Call this when a tool reports an auth or quota problem, or after sign_in.
- **sign_in** — Start signing this image server in to the user's ChatGPT account (required once before generating, unless an existing Codex/opencode ChatGPT sign-in is detected). Returns a link (browser method) or a code (device method) that the USER must open or enter — relay it verbatim. Sign-in completes in the background; afterwards call auth_status to confirm.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "codex-imagegen-mcp": {
    "command": "npx",
    "args": ["-y","codex-imagegen-mcp"]
  }
}
```

## Documentation

## What codex-imagegen-mcp does

The codex-imagegen-mcp MCP server adds image-generation workflows to coding agents that support MCP. It uses a ChatGPT plan that includes Codex rather than an API key, and image usage is counted against that plan. The Free plan does not include Codex image generation.

The server can create a new image from a text prompt, edit an existing image, or generate an image using one to five reference files. Generated files can be saved into the project workspace. Existing output files are not overwritten; the server chooses a new filename such as `hero-2.png` when necessary.

It also supports transparent output, multiple canvas shapes, and up to four prompt variants in parallel. Transparent output is checked for alpha data. Flat-background removal is performed locally, so that operation does not make a network request or consume image quota.

## How it works

The agent communicates with a local MCP process over stdio. The process handles authentication and communicates with the relevant ChatGPT and Codex services when image generation or editing is requested. Background removal runs on the local machine instead.

Authentication can use a ChatGPT sign-in performed by this package, or credentials already available to Codex or opencode. The `auth_status` tool reports sign-in state, plan, credential source, and usage windows. The `sign_in` tool starts the sign-in flow and returns a browser link or device code as appropriate.

The image tools accept options such as `aspect_ratio`; the documented range includes eleven ratios from 21:9 through 9:21. Aspect selection creates a composition for the requested canvas rather than simply cropping an existing result.

## Setup and configuration

The codex-imagegen-mcp MCP server requires Node.js 22 or newer and a ChatGPT plan with Codex access. The standard installer can be run without a prior package installation:

```bash
npx -y codex-imagegen-mcp install
```

It detects supported coding tools, displays the files it will create or modify, and waits for confirmation. Named clients can be supplied for noninteractive installation, while `--all --dry-run` previews changes for every detected client. The installer edits only its own configuration entry and preserves existing comments and formatting.

After installation, authenticate with:

```bash
npx -y codex-imagegen-mcp login
```

Use `--device` for a headless machine. The installer can also be installed globally with npm, installed from a GitHub release archive, or built from a source checkout. `doctor` checks Node.js, credentials, quota, and installed client configurations.

## Tools and capabilities

- `generate_image`: creates an image from a prompt.
- `edit_image`: edits supplied images or generates from one to five references.
- `remove_background`: removes a flat backdrop locally.
- `auth_status`: reports authentication, plan, credential-source, and usage-window information.
- `sign_in`: begins ChatGPT authentication and returns a link or code.

The package also supplies an `imagegen-mcp` skill adapted from Codex's image-generation workflow. It provides guidance for prompt structure, edit invariants, and file-saving behavior.

## Limitations and notes

The codex-imagegen-mcp MCP server is a stdio service, so each coding client must be configured to launch it locally. Image generation and editing require a ChatGPT plan that includes Codex; a Free plan is not sufficient. The package does not use an OpenAI API key for this workflow.

Generated output depends on the available account usage windows. Local background removal is limited to cutting out a flat backdrop; it is not described as a general-purpose segmentation tool. The installer writes client configuration only after confirmation unless run in a noninteractive mode, and `--dry-run` does not apply changes.

_Full upstream README: https://allmcps.com/mcp/codex-imagegen-mcp/readme_

