Codex / OpenAI Image

v0.1.2
io.github.meet30997/codex-openai-image-mcp Checked 4 days ago Published 1 month ago

Generate, edit and make matching sets of images with the Codex CLI or the OpenAI Images API

Values you need

VariableWhat it is
IMAGEGEN_PROVIDERrequired Image backend: codex-cli (your ChatGPT plan via the Codex CLI), openai-api, or mock Default: codex-cli
OPENAI_API_KEYoptional secret OpenAI API key, only needed for the openai-api backend
IMAGEGEN_OUT_DIRoptional Folder for generated images, relative to the working folder (default generated-images)

npm (npx) discovery passed

Requires Node.js 18+

Run in a terminal
claude mcp add codex-openai-image-mcp -e IMAGEGEN_PROVIDER=codex-cli -- npx -y codex-openai-image-mcp@0.1.2
Add to claude_desktop_config.json
{
  "mcpServers": {
    "codex-openai-image-mcp": {
      "args": [
        "-y",
        "codex-openai-image-mcp@0.1.2"
      ],
      "command": "npx",
      "env": {
        "IMAGEGEN_PROVIDER": "codex-cli"
      }
    }
  }
}
Add to ~/.cursor/mcp.json
{
  "mcpServers": {
    "codex-openai-image-mcp": {
      "args": [
        "-y",
        "codex-openai-image-mcp@0.1.2"
      ],
      "command": "npx",
      "env": {
        "IMAGEGEN_PROVIDER": "codex-cli"
      }
    }
  }
}
Add to .vscode/mcp.json
{
  "inputs": [
    {
      "description": "IMAGEGEN_PROVIDER",
      "id": "imagegen-provider",
      "password": true,
      "type": "promptString"
    }
  ],
  "servers": {
    "codex-openai-image-mcp": {
      "args": [
        "-y",
        "codex-openai-image-mcp@0.1.2"
      ],
      "command": "npx",
      "env": {
        "IMAGEGEN_PROVIDER": "${input:imagegen-provider}"
      },
      "type": "stdio"
    }
  }
}
Add to ~/.codex/config.toml
[mcp_servers.codex-openai-image-mcp]
command = "npx"
args = ["-y", "codex-openai-image-mcp@0.1.2"]
env = { "IMAGEGEN_PROVIDER" = "codex-cli" }

For AI agents

  1. Ask the user for: IMAGEGEN_PROVIDER. Never invent or guess these values; secrets go into the client config, not into chat logs.
  2. Pick the user's MCP client and apply the matching config from the first install method (it is the one verified by the smoke test when available).
  3. Restart or reload the client so it starts the server.
  4. Verify: the server should expose these tools: generate_image, edit_image, generate_set.
  5. If it fails, check that the required runtime is installed (Node.js 18+) and that the values above are set.

Machine-readable: install.md · manifest.json