
openai-gpt-image-mcp
MCP server for OpenAI GPT-4o / gpt-image-1 image generation and editing.
Add to your client
Copy the config for your MCP client and paste it into its config file.
git clone https://github.com/SureScaleAI/openai-gpt-image-mcp.git && cd openai-gpt-image-mcp && yarn install && yarn buildPaste into ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"openai-gpt-image-mcp": {
"command": "node",
"args": [
"/absolute/path/to/dist/index.js"
],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Step-by-step guides: Add to Claude Desktop · Add to Cursor · Add to Windsurf
Before you start
- Node.js (to run the built dist/index.js)
- Yarn (for install and build)
- An OpenAI API key with image API access (OPENAI_API_KEY), or Azure OpenAI credentials (AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, OPENAI_API_VERSION)
- A verified OpenAI organization (image API access can take 15–20 minutes to activate after verification)
About openai-gpt-image-mcp
openai-gpt-image-mcp exposes OpenAI's GPT-4o / gpt-image-1 image generation and editing capabilities as MCP tools. It provides a create-image tool for generating images from text prompts (with options like size, quality, background, and batching up to 10 images) and an edit-image tool for inpainting, outpainting, and compositing using a prompt plus an optional mask. Images can be returned as base64 or saved to disk; the server auto-switches to file output when responses would exceed the 1MB MCP payload limit. It supports both standard OpenAI and Azure OpenAI deployments and runs over stdio for clients such as Claude Desktop, Cursor, VSCode, and Windsurf.
Tools & capabilities (2)
create-imageGenerate images from a text prompt, with advanced options (size, quality, background, etc). Set n to generate up to 10 images at once. Output can be returned as base64 or saved to disk.
edit-imageEdit or extend images using a prompt and an optional mask (inpainting, outpainting, compositing). Supports both file path and base64 input; provide a mask image to control where edits are applied.
What this server can do
openai-gpt-image-mcp provides tools for these capabilities — tap one to see every MCP server that does the same:
When to use it
- Generating original images from text prompts directly inside an MCP client like Claude Desktop or Cursor
- Inpainting or outpainting existing images using a mask to control edited regions
- Compositing or extending images via prompt-driven edits
- Batch-generating up to 10 image variations from a single prompt
- Producing large or production images saved to disk via file output to avoid the 1MB response limit
Security notes
Requires an OpenAI API key (OPENAI_API_KEY) or Azure OpenAI credentials, supplied via the client config env block or an --env-file. Your OpenAI organization must be verified to access the image API; activation can take 15–20 minutes after verification. The key grants billable access to OpenAI's image APIs, so keep it scoped and out of source control.
openai-gpt-image-mcp FAQ
Which models and providers are supported?
It targets OpenAI's GPT-4o / gpt-image-1 image generation and editing APIs, and also supports Azure OpenAI deployments by supplying AZURE_OPENAI_API_KEY, AZURE_OPENAI_ENDPOINT, and OPENAI_API_VERSION.
How are large images handled?
MCP clients have a hard 1MB limit for tool responses. If the total image size exceeds 1MB, the server automatically saves images to disk and returns the file path(s) instead of base64. Set MCP_HF_WORK_DIR to control where files are saved (defaults to /tmp).
Why can't I access the image API even with a valid key?
You must have a verified OpenAI organization. After verifying, it can take 15–20 minutes for image API access to activate. Also ensure file paths passed to the tools are absolute.
Alternatives to openai-gpt-image-mcp
Compare all alternatives →Popular community server that feeds Figma layout data to coding agents via a Figma API token.
Generate beautiful, modern UI components from natural-language descriptions inside your IDE.
Give AI assistants full access to shadcn/ui v4 components, blocks, demos, and metadata across React, Svelte, Vue, and React Native.
Compare openai-gpt-image-mcp with: