
How to add openai-gpt-image-mcp to Cursor
MCP server for OpenAI GPT-4o / gpt-image-1 image generation and editing. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 102★ · stdio · apikey
Cursor config for openai-gpt-image-mcp
git clone https://github.com/SureScaleAI/openai-gpt-image-mcp.git && cd openai-gpt-image-mcp && yarn install && yarn build{
"mcpServers": {
"openai-gpt-image-mcp": {
"command": "node",
"args": [
"/absolute/path/to/dist/index.js"
],
"env": {
"OPENAI_API_KEY": "sk-..."
}
}
}
}Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the openai-gpt-image-mcp config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of openai-gpt-image-mcp's tools to confirm it's connected.
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)
What openai-gpt-image-mcp can do in Cursor
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.
Security
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 + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the openai-gpt-image-mcp config there under the "mcpServers" key and restart the client.
Is openai-gpt-image-mcp safe to use with Cursor?
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.
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.