Image Generation MCP Server
Automates image generation and editing on ChatGPT web, allowing prompt-based creation and instruction-based edits with configurable output options.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Image Generation MCP Servergenerate an image of a mountain lake at sunrise"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Image Generation MCP Server
An MCP server that automates image generation on ChatGPT web, edits images by instruction, and saves them locally — no API keys, no paid OpenAI API.
Features
Generate images in ChatGPT web from a prompt
Edit images by instruction (text-based, in the conversation)
Conversation-aware: returns a
conversation_idso edits can resume the same threadFlexible output: default Downloads folder, configurable folder, or per-call
save_pathandfilenameAspect ratio hints (
cuadrada/horizontal/vertical) injected into the promptPersistent session: log in once; the server reuses the session headlessly
Policy rejection detection: fails fast with a clear message instead of waiting for timeout
Single browser tab reused across all requests
Related MCP server: ChongPlus Image MCP
Requirements
Node.js >= 18
Google Chrome installed (used headless for automation)
An OpenAI account with access to ChatGPT (login required once)
Installation
npm install
npm run buildUses the system Chrome — no
npx playwright install chromiumneeded.
Usage in an MCP client
Add the server to your MCP client config (e.g. Command Code, Claude Desktop):
{
"mcpServers": {
"image-generation": {
"command": "node",
"args": ["/path/to/image-generation/dist/index.js"],
"cwd": "/path/to/image-generation"
}
}
}For development (hot reload):
{
"mcpServers": {
"image-generation": {
"command": "npx",
"args": ["tsx", "/path/to/image-generation/src/index.ts"],
"cwd": "/path/to/image-generation"
}
}
}First run (manual login)
Start the server without a saved session (e.g.
npx tsx src/index.ts). Since no session is detected, it opens a visible window with the ChatGPT login page.Log in to ChatGPT in that window (your normal account).
The session is saved in the persistent profile
~/.image-generation/browser-profile.From then on, the server runs headless (no window) and reuses the session.
To reset the session (expired or different account), delete the profile:
rm -rf ~/.image-generation/browser-profileTools
Tool | Description |
| Generates an image and saves it. Returns the absolute path and the |
| Edits the image in the given conversation (or the most recent) and saves the result. |
| Returns the current conversation ID (to resume it when editing). |
| Returns the current output folder. |
| Changes the output folder (must exist). |
| Indicates whether the ChatGPT session is active. |
Parameters
prompt/edit_instruction: required text.conversation_id: ID returned bygenerate_image; if omitted, edits the current conversation.save_path: optional destination directory (defaults to the configured folder or Downloads).filename: optional file name; invalid characters are sanitized,.pngis added if missing, and a numeric suffix avoids overwrites.aspect_ratio:cuadrada|horizontal|vertical(optional). Injected into the prompt (e.g.(formato 16:9)) since ChatGPT does not expose a UI control for it.
Configuration
The server persists its config in ~/.image-generation/config.json:
{
"outputFolder": "C:/Users/<user>/Downloads",
"browserProfilePath": "C:/Users/<user>/.image-generation/browser-profile",
"generationTimeoutMs": 180000
}Behavior
Headless: after the initial login, no window opens; a single persistent page is reused for all requests.
Single tab: exactly one page is always kept active.
Policy rejection: if ChatGPT rejects generation (content policy message), the server fails fast with the message instead of waiting for the timeout.
Persistent session: the profile stores cookies; the session is reused across runs.
Development
npm run build # compile TypeScript
npm run typecheck # type-check without emitting
npm run dev # run with hot reloadLimitations
Requires an active ChatGPT session (manual login the first time).
Selectors target ChatGPT's current DOM; if the site changes,
src/selectors.tsmay need updates.The visual editor (brush, region selection, canvas controls) is not automated — it's a proprietary canvas without accessible controls. Editing is done via chat instruction.
Cloudflare may block headless on some networks; the real Chrome user agent mitigates this.
License
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate images with your own ChatGPT subscription (Plus, Pro or Team), without spending API credits
Generate AI images, videos, music, SFX & speech in any AI assistant. Results appear inline in chat.
Resize, convert, compress, crop, thumbnail and watermark images from your AI chat.
LLM chat, text tools, image generation, editing, batch image jobs, and asynchronous video generation
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables image generation and editing using OpenAI's GPT Image API (gpt-image-1, 1.5, 2) with support for multi-image generation, history management, and batch processing.12108 npm1MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to generate and edit images via the ChongPlus Image API, with secure API key management and local file saving.5Apache 2.0
- AlicenseAqualityBmaintenanceEnables image generation and editing through OpenAI's gpt-image-2 model, supporting text-to-image, reference-guided generation, and editing with local files or URLs.2348 npm2MIT
- FlicenseAqualityBmaintenanceEnables agents to generate images through the GPT Image Playground via a browser extension, supporting task submission, status tracking, and downloading generated images with reference image support.31-