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 "Install 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: OpenAI GPT-Image MCP Server
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 installed
Maintenance
Related MCP Servers
- Alicense-qualityDmaintenanceEnables conversational image generation, editing, and refinement through OpenAI models with session memory for iterative creative workflows.Last updated1MIT
- 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.Last updated12591MIT
- Flicense-qualityDmaintenanceProvides AI agents and coding assistants with image generation and editing capabilities using OpenAI's GPT-image-1 model, with support for local or Supabase storage.Last updated3
- Alicense-qualityCmaintenanceEnables image generation and editing using laozhang.ai's OpenAI-compatible API, with tools for text-to-image and image-to-image transformations.Last updatedMIT
Related MCP Connectors
Generate images, GIFs, and PDFs from HTML, URLs, or templates — from your AI agent.
Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.
Sync Lightroom, Figma, Dropbox & Canva assets to WordPress and Shopify via natural language.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Angelthebestone/Image-gen-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server