OpenAI Image MCP Server
Provides tools for generating, editing, and multi-turn editing images using OpenAI's gpt-image models.
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., "@OpenAI Image MCP Servergenerate an image of a sunset over the ocean"
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.
OpenAI image mcp
MCP server for OpenAI gpt-image models — generate, edit, and multi-turn edit images straight from Claude (or any MCP client).
Tools
generate_image— text → image(s)edit_image— edit / extend / compose with an optional maskedit_image_conversation— multi-turn iterative edit (Responses API)image_capabilities— discover models, params, pricing as-of date
Related MCP server: GPT Image 1 MCP
Quick start
1. Get the code & build
git clone <repo-url> openai-image-mcp
cd openai-image-mcp
npm install
npm run buildnpm run build produces dist/index.js — the entrypoint you point Claude at.
2. Register with Claude Code (one command)
claude mcp add openai-image --scope user \
--env OPENAI_API_KEY=sk-your-openai-api-key \
--env IMAGE_OUTPUT_DIR=/absolute/path/to/images \
-- node /absolute/path/to/openai-image-mcp/dist/index.jsUse an absolute path to
dist/index.js(output of step 1).IMAGE_OUTPUT_DIRis where generated images are written. Optional — defaults to~/Pictures/openai-image-mcp.--scope usermakes it available in every project. Use--scope projectto limit it to the current repo.
Verify it registered:
claude mcp list3. Use it
In Claude, just ask — e.g. "generate an image of a red bicycle on the beach".
The server writes the file under IMAGE_OUTPUT_DIR and returns the path.
Configuration (env vars)
Var | Required | Default | Purpose |
| yes | — | OpenAI API key |
| no |
| where images are saved |
| no |
| gpt-image-1 / gpt-image-1-mini / gpt-image-2 |
| no |
|
|
| no | — | reject a call whose estimate exceeds this |
| no | — | require |
| no |
| allow image inputs given as URLs (see Security) |
| no | — | append per-call cost records as JSONL |
| no |
| locally augment short prompts (no extra LLM call) |
| no | — | override API base URL |
| no |
|
|
Add any of these as extra --env KEY=value flags on the claude mcp add command.
Manual MCP config (other clients)
If your client uses a JSON config (Claude Desktop, Cursor, VSCode), add:
{
"mcpServers": {
"openai-image": {
"command": "node",
"args": ["/absolute/path/to/openai-image-mcp/dist/index.js"],
"env": {
"OPENAI_API_KEY": "sk-your-openai-api-key",
"IMAGE_OUTPUT_DIR": "/absolute/path/to/images"
}
}
}
}Security notes
URL image input is off by default. Set
ALLOW_URL_INPUT=trueto enable. When on, fetches resolve all DNS addresses and reject any private / loopback / link-local / CGNAT / IPv4-mapped target, re-validating on every redirect hop (SSRF guard).Output paths are confined to
IMAGE_OUTPUT_DIR; existing files are never overwritten (a numeric suffix is added on collision).Logs go to stderr only; stdout is reserved for the MCP protocol.
Development
npm test # run the vitest suite
npm run typecheck # tsc --noEmit
npm run build # compile to dist/Notes
Models: gpt-image-1 (deprecating 2026-10-23), gpt-image-1-mini, gpt-image-2 (default).
DALL-E was removed from the OpenAI API (2026-05-12) — not supported.
Pricing data is as of 2026-06; query the
image_capabilitiestool for details.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
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/aleslanger/OpenAI-image-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server