Reverse engineer anything with agents, from app behavior down to native binaries.
Gpt Image 2 MCP
Local MCP server for ChatGPT image generation.
Install
git clone https://github.com/lownamlee/gpt-image-2-mcpInstall command taken from the project's README or registry entry. Always review code before running it.
README excerpt
Read full README on GitHub →@ramlyburger/gpt-image-2-mcp
Turn any MCP-compatible AI client into an image generator. Send a normal prompt, choose a backend mode, and get real saved image files back.
Popularity
PulseMCP: https://www.pulsemcp.com/servers/ramlyburger-gpt-image-2
🖼️ What It Does
- ✍️ Prompt in: ask for an image from your MCP client.
- ⚙️ MCP server runs:
gpt-image-2-mcphandles the image request. - 💾 Files out: every result includes
output_dir,image_path, and metadata. - 🔐 No ChatGPT API key needed in
chatgpt-webmode. You only need a ChatGPT account and a successful sign-in at chatgpt.com.
🚀 Quick Start
Add the server to your MCP client:
{
"mcpServers": {
"gpt-image-2": {
"command": "npx",
"args": ["-y", "@ramlyburger/gpt-image-2-mcp"],
"env": {
"GPT_IMAGE_BACKEND": "chatgpt-web"
}
}
}
}
That is enough for the ChatGPT website mode. The first run opens ChatGPT so you can sign in or complete verification. After that, the local profile can be reused across restarts.
For direct API generation, set OPENAI_API_KEY and change GPT_IMAGE_BACKEND to api.
🧭 Pick A Mode
| Mode | What you need | Best when | Notes |
|---|---|---|---|
chatgpt-web |
A ChatGPT account and sign-in at chatgpt.com |
You want a simple setup without a ChatGPT API key | Good beginner default |
api |
OPENAI_API_KEY |
You want the direct API path | Uses gpt-image-2 |
auto |
Preferably an API key; otherwise a usable ChatGPT website session | You want API first with fallback behavior | Tries API first, then falls back only when the API backend is unavailable |
🎬 Demo
Click the GIF to open the full MP4.
🧰 Tool Surface
generate_image(prompt, backend?, n?, size?, quality?, output_format?, conversation_mode?, timeout_seconds?)backend_status(backend?)browser_visibility(action?, start_browser?)
Backend values are api, chatgpt-web, or auto.
Use conversation_mode="new" or conversation_mode="continue" with the ChatGPT website mode.
📄 Technical Reference
The section below is the implementation-oriented view.
Figure 1. System Model
flowchart LR
A["MCP client"] --> B["gpt-image-2-mcpstdio server"]
B --> C["Input validationZod schemas"]
C --> D{"Backend selection"}
D --> E["OpenAI API mode"]
D --> F["ChatGPT website mode"]
E --> G["Saved image filesmetadata.json"]
F --> G
Abstract
gpt-image-2-mcp is a small TypeScript MCP server that exposes image generation through a narrow tool contract. The server validates MCP tool input, resolves the requested backend, persists generated artifacts to disk, and returns structured metadata plus image content to the caller.
Method
The implementation follows a five-stage pipeline:
- parse and validate MCP tool input
- resolve the backend from
api,chatgpt-web, orauto - execute the selected image-generation path
- write generated images and
metadata.jsonto a prompt-derived output directory - return
output_dir,image_path,images, and backend metadata
The auto mode attempts the API backend first and falls back to chatgpt-web only when the API backend is unavailable.
Artifact Model
Similar plugs
The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype…
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io