Skip to content
MCP server

Codex / OpenAI Image

Generate and edit images, and make style-matched sets, with Codex CLI or OpenAI Images

Runs locallyStatus and history
Install
Pricing
Open source
Platforms
CLI, macOS, Windows
Runs
Locally
Version
0.1.2
Listing updated
today

Similar MCP servers

About Codex / OpenAI Image

Codex / OpenAI Image is an open-source MCP server for design and media. It runs locally on your machine and is started by your AI client.

The point of this server is the set tool: generate_set takes one shared style and up to eight named prompts, then saves each as its own file so icons, stickers or illustrations come out consistent. Alongside it sit generate_image, with sizes from 16 to 4,096 pixels per side, 1 to 4 variants, optional transparency and up to four style references, and edit_image, which never modifies the source file.

Two backends are selectable with IMAGEGEN_PROVIDER. The codex-cli option draws on your ChatGPT plan through a signed-in Codex CLI, which the README describes as no API key and no per-image bill, at roughly 30 to 60 seconds per image. The openai-api option uses an API key and supports edit masks. A mock backend draws placeholders for testing. The README notes the API backend is tested against a mocked client and has not yet had a full live test.

Output stays inside one folder, existing files are never overwritten, and each image gets a JSON sidecar with its prompt and settings. Node.js 20.3 or newer is required.

Install

Run in a terminal

claude mcp add codex-openai-image-mcp --env IMAGEGEN_PROVIDER='<IMAGEGEN_PROVIDER>' --env OPENAI_API_KEY='<OPENAI_API_KEY>' -- npx -y codex-openai-image-mcp

Add to claude_desktop_config.json

{
  "mcpServers": {
    "codex-openai-image-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-openai-image-mcp"
      ],
      "env": {
        "IMAGEGEN_PROVIDER": "<IMAGEGEN_PROVIDER>",
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "codex-openai-image-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-openai-image-mcp"
      ],
      "env": {
        "IMAGEGEN_PROVIDER": "<IMAGEGEN_PROVIDER>",
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}

Add to .vscode/mcp.json

{
  "servers": {
    "codex-openai-image-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "codex-openai-image-mcp"
      ],
      "env": {
        "IMAGEGEN_PROVIDER": "<IMAGEGEN_PROVIDER>",
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "codex-openai-image-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-openai-image-mcp"
      ],
      "env": {
        "IMAGEGEN_PROVIDER": "<IMAGEGEN_PROVIDER>",
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "codex-openai-image-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "codex-openai-image-mcp"
      ],
      "env": {
        "IMAGEGEN_PROVIDER": "<IMAGEGEN_PROVIDER>",
        "OPENAI_API_KEY": "<OPENAI_API_KEY>"
      }
    }
  }
}

Using several servers? Build one config file with the MCP config generator.

Configuration

  • IMAGEGEN_PROVIDERImage backend: codex-cli (your ChatGPT plan via the Codex CLI), openai-api, or mockRequired
  • OPENAI_API_KEYOpenAI API key, only needed for the openai-api backend
  • IMAGEGEN_OUT_DIRFolder for generated images, relative to the working folder (default generated-images)

Tools this server provides (3)

Taken from the project documentation; the running server may differ.

generate_image
Create 1 to 4 images from a prompt, with size, transparency and style references.
edit_image
Change an existing image from a prompt, with optional references and a mask on the API backend.
generate_set
Make up to eight named images that share one style.

What it does

Matching sets
One call renders up to 8 images that share a style.
Image editing
Change an image without touching the original; masks work on the API backend.
Two backends
Switch between Codex CLI and the OpenAI Images API.
Safe file handling
Writes only in its output folder and never overwrites.
Sidecar metadata
Prompt, model, size and time saved next to each image.
Previews for the agent
Returns small previews so the assistant can look and iterate.

Good for

  • Make a consistent icon pack
  • Create sticker or illustration sets
  • Edit a photo to a night scene
  • Produce blog header images at an exact size

Pricing

Open source

MIT licence; Codex backend uses your ChatGPT plan, API backend bills per image to your OpenAI account

More servers for the same service

Codex / OpenAI Image FAQ

Do I need an API key?

Not for the Codex backend, which uses a signed-in Codex CLI and your ChatGPT plan; the API backend needs OPENAI_API_KEY.

Can it overwrite my images?

No. New files get -2, -3 and so on, and the edited input is never changed.

What Node version is needed?

Node.js 20.3 or newer.

What is the licence?

MIT.

Is Codex / OpenAI Image free?

Yes. Codex / OpenAI Image is open source, so you can use and self-host it for free.

How do I add Codex / OpenAI Image to Claude Code?

Run this command in your terminal: claude mcp add codex-openai-image-mcp --env IMAGEGEN_PROVIDER='<IMAGEGEN_PROVIDER>' --env OPENAI_API_KEY='<OPENAI_API_KEY>' -- npx -y codex-openai-image-mcp

What are the best alternatives to Codex / OpenAI Image?

The closest alternatives to Codex / OpenAI Image are HyperFrames by HeyGen, headroom, omniget, next-ai-draw-io and mcp-for-blender.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers