openai-image-mcp
Provides tools for generating images through the OpenAI Images API, including configurable prompt, quality, size, background, output format, output path, and model selection. Generated images are saved to disk and the file path is returned.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
openai-image-mcp-for-claude
An MCP server that lets Claude (or any MCP client) generate images with the OpenAI Images API. Works on Windows, macOS and Linux.
Images are saved to disk and only the file path goes back to the model, so no image data ends up in the conversation. That keeps the context small and lets the model save images straight into the project it's working on.
What it does
The server gives you one tool, generate_image:
Parameter | Values | Default |
| what to draw | required |
|
|
|
|
|
|
|
|
|
|
|
|
| file or folder to save to, e.g. | your Pictures folder, as |
| any OpenAI image model |
|
Some details:
Quality defaults to
lowbecause higher quality costs a lot more. The tool description tells the model to usehighonly for final images you asked for.Transparent backgrounds switch to
gpt-image-1.5, becausegpt-image-2doesn't support them. JPEG is changed to PNG, since JPEG can't be transparent.If OpenAI returns an error, the server passes the reason back to the model as text, so it can tell you what went wrong.
Where images are saved
No
output_path: your Pictures folder. On Windows that's the real Pictures folder, also when OneDrive has moved it. On macOS it's~/Pictures. On Linux it's the folder set inXDG_PICTURES_DIR, which may have a translated name such as~/Afbeeldingen.A full path (
/Users/me/site/hero.png,C:\Users\me\site\hero.png): saved exactly there. Missing folders are created.A folder (one that exists, or a path ending in
/or\): an auto-named file inside it.A relative path (
logos/logo.png): saved inside the default folder. The server's working directory depends on the client, and on Windows it can even beC:\Windows\System32, so relative paths aren't resolved against it.~,$HOMEand%USERPROFILE%-style environment variables are expanded. If the path has no image extension, one is added, soherobecomeshero.png.
Related MCP server: imaginate-mcp
Install
Pick one. All three give you the same tool and behave the same way.
Option | You need to install first | Best for |
nothing | Claude Desktop | |
Node.js 20 or newer | Claude Code and other MCP clients | |
people who prefer Python |
You also need an OpenAI API key with access to the image models. OpenAI bills image generation per image.
Option 1: Claude Desktop extension
Download
openai-image-mcp-for-claude-<version>.mcpbfrom the latest release.Double-click it, or open Claude Desktop and go to Settings → Extensions → Advanced settings → Install Extension, then pick the file.
Enter your OpenAI API key when asked. Claude Desktop stores it in your system keychain (Keychain on macOS, Credential Manager on Windows). You can also choose a save folder there; leave it empty for your Pictures folder.
It runs on the Node.js that ships with Claude Desktop, so there's nothing else to install, and you don't need the API key file described below.
Option 2: npx (Node.js)
Save your API key first (see API key).
Claude Code on macOS and Linux:
claude mcp add openai-image --scope user -- npx -y openai-image-mcp-for-claudeClaude Code on Windows (npx needs to be started through cmd):
claude mcp add openai-image --scope user -- cmd /c npx -y openai-image-mcp-for-claudeOther clients with an mcpServers JSON config:
{
"mcpServers": {
"openai-image": {
"command": "npx",
"args": ["-y", "openai-image-mcp-for-claude"]
}
}
}The package has no dependencies (everything is bundled into one file), so npx starts it quickly.
Option 3: uvx (Python)
Save your API key first (see API key). Install uv if you don't have it:
macOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shWindows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Claude Code (all platforms):
claude mcp add openai-image --scope user -- uvx --from git+https://github.com/Ozaiy/openai-image-mcp-for-claude openai-image-mcpOther clients with an mcpServers JSON config:
{
"mcpServers": {
"openai-image": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Ozaiy/openai-image-mcp-for-claude", "openai-image-mcp"]
}
}
}Without uv:
# macOS / Linux
python3 -m venv ~/.venvs/openai-image-mcp
~/.venvs/openai-image-mcp/bin/pip install git+https://github.com/Ozaiy/openai-image-mcp-for-claude
# command: /Users/me/.venvs/openai-image-mcp/bin/openai-image-mcp# Windows
py -m venv $HOME\.venvs\openai-image-mcp
& $HOME\.venvs\openai-image-mcp\Scripts\pip install git+https://github.com/Ozaiy/openai-image-mcp-for-claude
# command: C:\Users\me\.venvs\openai-image-mcp\Scripts\openai-image-mcp.exeUse that full path as the command in your client config.
"npx/uvx not found" or the server fails to start
Desktop apps often don't see the folder Node.js or uv was installed in, especially on macOS. Use the full path as command instead. Run which npx / which uvx (macOS, Linux) or where.exe npx / where.exe uvx (Windows) to find it. In JSON on Windows, write each \ as \\, e.g. C:\\Users\\me\\.local\\bin\\uvx.exe.
Restart your client after changing its config.
API key (for options 2 and 3)
The server uses the OPENAI_API_KEY environment variable if it's set. Otherwise it reads the key from a file named api_key, in the first of these places that exists:
OS | Location |
Windows |
|
macOS |
|
Linux |
|
any OS |
|
A file keeps the key out of your MCP config. The commands below create it; paste your key when asked.
macOS / Linux (nothing is shown while you paste; press Enter after):
mkdir -p ~/.config/openai
read -s KEY && printf '%s' "$KEY" > ~/.config/openai/api_key && chmod 600 ~/.config/openai/api_keyWindows (PowerShell):
New-Item -ItemType Directory -Force "$env:APPDATA\openai" | Out-Null
Read-Host "OpenAI API key" | Set-Content -NoNewline -Encoding ascii "$env:APPDATA\openai\api_key"You can also make the file in Notepad. Any encoding works, including the UTF-16 that "sk-..." > api_key produces in Windows PowerShell 5.
If the key can't be found, the tool's error message lists the exact paths it checked on your computer.
Try it
Ask Claude something like "Generate a low-quality draft of a logo for a coffee shop called Bean There, transparent background". It replies with the path of the saved file.
Settings
Environment variable | What it does | Default |
| your OpenAI API key | read from the |
| folder for images saved without a full | your Pictures folder |
| default model |
|
In Claude Code you can set these with -e, for example claude mcp add openai-image -e OPENAI_IMAGE_OUTPUT_DIR=~/Images -- npx -y openai-image-mcp-for-claude. The Claude Desktop extension sets the first two from its settings screen.
Development
There are two implementations with the same behavior and the same tests:
Python in
src/openai_image_mcp/server.py, used by option 3.TypeScript in
typescript/src/, used by options 1 and 2.npm run buildbundles it and its dependencies into the single filetypescript/dist/index.js, which both the npm package and the.mcpbcontain.
git clone https://github.com/Ozaiy/openai-image-mcp-for-claude
cd openai-image-mcp-for-claude
# Python
python3 -m venv .venv
.venv/bin/pip install -e ".[test]" # Windows: .venv\Scripts\pip install -e ".[test]"
.venv/bin/python -m pytest # Windows: .venv\Scripts\python -m pytest
# TypeScript
cd typescript
npm ci
npm run build
npm test
npm run pack:mcpb # builds build/openai-image-mcp-for-claude-<version>.mcpbThe tests run on Windows, macOS and Linux with GitHub Actions on every push.
Releasing: set the same version in pyproject.toml, src/openai_image_mcp/__init__.py, typescript/package.json, typescript/manifest.json and typescript/src/lib.ts, then push a tag such as v0.3.0. The release workflow builds the .mcpb, attaches it to a GitHub release, and publishes the npm package if the repository has an NPM_TOKEN secret.
License
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models. Up to 4 images per call, SVG vectorization, background removal, upscaling and image-to-video. Remote MCP with OAuth, no API keys.
Focused MCP server for OpenAI image/audio generation (v2.0.0). Wraps endpoints via HAPI CLI.
Generate AI images and videos from any compatible MCP client.
Generate images from Claude, ChatGPT, Cursor and Codex with 12 top AI image models and 10 tools: up to 4 images per call, SVG vectorization, editing and more. Remote MCP with OAuth, no API keys. Pay per image, no subscription.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables image generation and editing via OpenAI's gpt-image-1 model, with options for saving, format control, and transparency.-
- AlicenseAqualityCmaintenanceGenerates and edits images using OpenAI GPT Image or Google Gemini models, saving every result to disk and returning local file paths so AI assistants can continue working with the images. It enables prompt-based image creation, editing, inpainting, multi-image composition, and model listing through MCP tools.131 npm1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to generate and edit images through any OpenAI-compatible image API, saving results as local files and returning absolute paths for immediate use.21 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables coding agents and other MCP clients to generate images from text prompts and edit, restyle, or extend existing images through an OpenAI-compatible /v1/images API. Results are returned both inline as image content blocks and as files saved to disk, so agents can view and reuse them within a normal task.274 npm1MIT