Codex ImageGen MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| CODEX_HOME | No | Where to look for a Codex sign-in | ~/.codex |
| CODEX_IMAGEGEN_HOME | No | Credentials, history, logs and the default image library | ~/.local/share/codex-imagegen-mcp |
| CODEX_IMAGEGEN_LOG_LEVEL | No | 'debug', 'info', 'warn', 'error' or 'silent'; the log is $CODEX_IMAGEGEN_HOME/server.log | info |
| CODEX_IMAGEGEN_NO_BROWSER | No | Never open a browser automatically | |
| CODEX_IMAGEGEN_ORIGINATOR | No | The originator identifying this client to OpenAI | codex-imagegen-mcp |
| CODEX_IMAGEGEN_OUTPUT_DIR | No | Where images go when no output_path is given | $CODEX_IMAGEGEN_HOME/images |
| CODEX_IMAGEGEN_TIMEOUT_MS | No | Per-request timeout for the image service | 300000 |
| CODEX_IMAGEGEN_CREDENTIALS | No | 'auto' (own → Codex → opencode), or pin 'own', 'codex' or 'opencode' | auto |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| prompts | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| generate_imageA | 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_imageA | 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_backgroundA | 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_statusA | 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_inA | 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. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| generate | Create a new image with the imagegen tools using the recommended workflow. |
| edit | Edit an existing image with the imagegen tools, preserving everything that should not change. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| history | JSON list of the 50 most recent images generated, edited or cut out by this server (newest first), with paths and prompts. |
| skill:SKILL.md | Workflow and prompting guidance for image generation. Read this if your client does not load Agent Skills. |
| skill:references/prompting.md | Reference material for the imagegen skill. |
| skill:references/sample-prompts.md | Reference material for the imagegen skill. |
| skill:references/tools.md | Reference material for the imagegen skill. |
TDQS
Scored across 5 tools
Each tool has a unique purpose: generate_image creates new images, edit_image modifies existing ones, remove_background handles a specific transformation, auth_status checks state, and sign_in handles authentication. There is no overlap or ambiguity; an agent can reliably choose the right tool for the task.
All tool names follow a consistent snake_case verb_noun pattern: generate_image, edit_image, remove_background, auth_status, sign_in. Even though auth_status is more of a state query, it fits the pattern well. The naming is predictable and easy to infer.
Five tools is ideal for an image generation server. It covers creation, editing, a specific utility, plus auth and status checks—everything needed without unnecessary surface. The scope is clear and each tool earns its place.
The tool surface fully covers the domain: generation, editing, background removal, and authentication. There are no missing operations that would cause dead ends; users can create, modify, and manage sessions seamlessly. The lifecycle is complete for this server's intended functionality.