Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Claude Code Image Generator

БесплатноНе проверен

MCP server that lets Claude Code generate and edit images with ChatGPT's image model using your ChatGPT subscription. No API key needed.

GitHubEmbed

Описание

MCP server that lets Claude Code generate and edit images with ChatGPT's image model using your ChatGPT subscription. No API key needed.

README

An MCP server that lets Claude Code (and Claude Desktop) generate and edit images with ChatGPT's image model, using your ChatGPT subscription. No OpenAI API key needed.

Unofficial community project. Not affiliated with or endorsed by Anthropic or OpenAI.

Tool What it does
generate_image Text → image. Shape (square / landscape / portrait), quality, 1–4 images, transparent background, png / jpeg / webp.
edit_image Edit a picture, or combine up to 16 reference images into one.

Every image is saved to disk at full size, and Claude gets the file path plus a small preview so it can see the result and refine it.

Examples

All made from Claude Code with a ChatGPT Plus account. Each took 25–45 seconds.

Cartoon shark wearing headphones, flat vector style, teal and navy
generate_image
"a cute cartoon shark wearing headphones, flat vector style, teal and navy, white background"
The same shark recolored purple with small golden stars around it
edit_image with the image on the left as input
"make the shark purple and add small golden stars around it, keep the same style"
Shark DJ sticker with sunglasses and turntables on a transparent background
generate_image with background: "transparent"
"a die-cut sticker of a cool cartoon shark DJ wearing sunglasses and headphones, bold outlines, vibrant purple and teal"
M5SHARK army-style badge logo with a helmeted shark on camo, transparent background
generate_image with background: "transparent"
"M5SHARK logo in a military army style: a shark in a combat helmet on a camo badge, stencil lettering"

The checkerboard shows where the background is transparent. Previews are scaled down; real outputs are 1254×1254 to 1536×1024.

How it works

Claude ──MCP──▶ server.py ──▶ Codex CLI (signed in with ChatGPT) ──▶ GPT Image

OpenAI's Codex CLI has a built-in image generator that works with a ChatGPT login. This server runs codex exec in the background (read-only sandbox, no shell commands, nothing saved to your Codex history), asks it for the image, then picks the file up from ~/.codex/generated_images/ and saves it where you want.

  • Images count against your ChatGPT plan's limits (Plus, Pro, Business…), not API billing. The Free plan can't generate images in Codex.
  • Each image takes about 20–60 seconds.
  • Transparent backgrounds: the server asks for a flat green screen (or magenta when the subject itself is green, e.g. army, camo or forest themes) and removes it itself, leaving a clean PNG cut-out.
  • Prefer pay-per-image with exact control? Set IMAGE_BACKEND=api and use an OpenAI API key instead (see below).

Requirements

  1. Codex CLI, signed in with your ChatGPT account
    • macOS: the ChatGPT desktop app already includes it. The server finds it automatically.
    • Anywhere else: install it from github.com/openai/codex, for example npm install -g @openai/codex, then run codex login and choose Sign in with ChatGPT.
    • Check it: codex login status should say Logged in using ChatGPT, and codex features list should show image_generation enabled.
  2. uv. It installs the Python dependencies automatically the first time the server starts.

Install

git clone https://github.com/M5Shark/claude-code-image-generator.git
cd claude-code-image-generator
claude mcp add chatgpt-images --scope user -- uv run --script "$PWD/server.py"

Start a new Claude Code session. claude mcp list should show chatgpt-images: ✓ Connected.

If Claude Code can't find uv, use its full path (which uv) in the command above.

Claude Desktop (chat)

Add this to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/), then restart Claude Desktop:

{
  "mcpServers": {
    "chatgpt-images": {
      "command": "/full/path/to/uv",
      "args": ["run", "--script", "/full/path/to/claude-code-image-generator/server.py"]
    }
  }
}

Usage

Just ask Claude:

  • "Generate a landscape hero image for a music producer's landing page, dark purple neon"
  • "Make a transparent sticker of a shark DJ with headphones and save it to ./assets"
  • "Make an army-style logo for my brand with no background"
  • "Edit ~/Desktop/product.jpg: put the product on a marble counter with soft morning light"
  • "Combine these three photos into one flat-lay shot: a.png, b.png, c.png"

Images go to ~/Pictures/ChatGPT Images unless you ask for another folder. In a project, Claude can save straight into it (e.g. ./assets), which is handy for websites and games.

Settings

All optional. Copy .env.example to .env (next to server.py), uncomment what you need, then restart Claude.

Variable Default Meaning
IMAGE_OUTPUT_DIR ~/Pictures/ChatGPT Images Default save folder
IMAGE_PREVIEW_MAX_PX 768 Preview size sent to Claude; 0 turns previews off
CODEX_PATH auto-detected Path to the codex binary
CODEX_MODEL Codex default Model that drives Codex (the image model itself is chosen by OpenAI)
CODEX_REASONING_EFFORT low Keeps each run quick
CODEX_TIMEOUT 600 Seconds to wait for one request
IMAGE_BACKEND chatgpt api uses the OpenAI Images API instead
OPENAI_API_KEY – Only for IMAGE_BACKEND=api
OPENAI_IMAGE_MODEL gpt-image-2 Only for IMAGE_BACKEND=api

API backend

IMAGE_BACKEND=api calls the OpenAI Images API directly with a key from platform.openai.com. It's billed per image, separately from ChatGPT plans, and gives exact pixel sizes, native transparency and masks for edit_image.

Limits of the ChatGPT backend

  • size sets the shape; ChatGPT picks the exact pixels (e.g. 1254×1254, 1536×1024).
  • No masks: describe the area to change in the prompt instead.
  • OpenAI doesn't publish an image count for Codex. If you hit your plan's limit, the tool returns ChatGPT's message and you can continue after the reset.
  • Use is subject to OpenAI's terms for your ChatGPT plan.

Troubleshooting

  • "did not return an image … sign in": run codex login status; sign in again if needed.
  • "Could not find the Codex CLI": install it (see Requirements) or set CODEX_PATH.
  • Server not connecting: run uv run --script server.py in a terminal. It should sit waiting with no error (Ctrl+C to stop).

Tests

Offline tests use a fake codex binary and a mock OpenAI API, so they need no account and use no quota:

uv run --script tests/test_server.py

License

MIT

from github.com/M5Shark/claude-code-image-generator

Установка Claude Code Image Generator

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/M5Shark/claude-code-image-generator

FAQ

Claude Code Image Generator MCP бесплатный?

Да, Claude Code Image Generator MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Claude Code Image Generator?

Нет, Claude Code Image Generator работает без API-ключей и переменных окружения.

Claude Code Image Generator — hosted или self-hosted?

Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.

Как установить Claude Code Image Generator в Claude Desktop, Claude Code или Cursor?

Открой Claude Code Image Generator на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Claude Code Image Generator with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории development