# OpenAI Image

An MCP server that hands your agent two tools: turn a text prompt into an image, or edit one you already have, through Anthropic.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 13
- Author: mindstone
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mindstone/mcp-servers/tree/HEAD/connectors/openai-image
- Updated: 2026-10-22
- HTML: https://affpapa.org/en/nevibecode/mcp/openai-image

## What it does

The server exposes `generate_image` and `edit_image`. The first one takes a prompt plus size and quality settings, the second reworks an existing file. Generation runs on `gpt-image-2`, with four quality levels and three aspect ratios, and prompts can be written in more than one language.

Output PNGs stay inside a fenced workspace. With `MCP_WORKSPACE_PATH` set they land in `<workspace>/Chief-of-Staff/generated-images/`; otherwise the default is `~/Pictures/MCP-Generated-Images/`. Point the edit tool at a file outside that fence and you get `WORKSPACE_FENCE_VIOLATION` back — so copy the source image into the workspace first. The API key is pinned to `api.openai.com`, which means a tampered environment cannot reroute your prompts or the bearer token.

You need Node.js 20.3+, npm, and an OpenAI key with image generation access. Without `OPENAI_API_KEY` the process still boots, but tool calls answer with `NOT_CONFIGURED` rather than crashing. The request timeout defaults to 180000 ms, sized for `quality: high` jobs that can run about two minutes on complicated prompts.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `OPENAI_API_KEY`, `MCP_WORKSPACE_PATH`, `OPENAI_IMAGE_MODEL`, `OPENAI_IMAGE_REQUEST_TIMEOUT_MS`, `MCP_ALLOWED_SYMLINK_ROOTS`, `MCP_HTTP_PORT` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env OPENAI_API_KEY=<OPENAI_API_KEY> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env OPENAI_IMAGE_MODEL=<OPENAI_IMAGE_MODEL> --env OPENAI_IMAGE_REQUEST_TIMEOUT_MS=<OPENAI_IMAGE_REQUEST_TIMEOUT_MS> --env MCP_ALLOWED_SYMLINK_ROOTS=<MCP_ALLOWED_SYMLINK_ROOTS> --transport stdio openai-image -- npx -y @mindstone/mcp-server-openai-image
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Codex

**Platform CLI**
```bash
codex mcp add openai-image --env OPENAI_API_KEY=<OPENAI_API_KEY> --env MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> --env OPENAI_IMAGE_MODEL=<OPENAI_IMAGE_MODEL> --env OPENAI_IMAGE_REQUEST_TIMEOUT_MS=<OPENAI_IMAGE_REQUEST_TIMEOUT_MS> --env MCP_ALLOWED_SYMLINK_ROOTS=<MCP_ALLOWED_SYMLINK_ROOTS> -- npx -y @mindstone/mcp-server-openai-image
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "openai-image": {
            "command": "npx",
            "args": [
                "-y",
                "@mindstone/mcp-server-openai-image"
            ],
            "env": {
                "OPENAI_API_KEY": "<OPENAI_API_KEY>",
                "MCP_WORKSPACE_PATH": "<MCP_WORKSPACE_PATH>",
                "OPENAI_IMAGE_MODEL": "<OPENAI_IMAGE_MODEL>",
                "OPENAI_IMAGE_REQUEST_TIMEOUT_MS": "<OPENAI_IMAGE_REQUEST_TIMEOUT_MS>",
                "MCP_ALLOWED_SYMLINK_ROOTS": "<MCP_ALLOWED_SYMLINK_ROOTS>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "openai-image": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@mindstone/mcp-server-openai-image"
            ],
            "env": {
                "OPENAI_API_KEY": "<OPENAI_API_KEY>",
                "MCP_WORKSPACE_PATH": "<MCP_WORKSPACE_PATH>",
                "OPENAI_IMAGE_MODEL": "<OPENAI_IMAGE_MODEL>",
                "OPENAI_IMAGE_REQUEST_TIMEOUT_MS": "<OPENAI_IMAGE_REQUEST_TIMEOUT_MS>",
                "MCP_ALLOWED_SYMLINK_ROOTS": "<MCP_ALLOWED_SYMLINK_ROOTS>"
            }
        }
    }
}
```
Replace <…> with your own values. 1 more environment variable is in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e OPENAI_API_KEY=<OPENAI_API_KEY> -e MCP_WORKSPACE_PATH=<MCP_WORKSPACE_PATH> -e OPENAI_IMAGE_MODEL=<OPENAI_IMAGE_MODEL> -e OPENAI_IMAGE_REQUEST_TIMEOUT_MS=<OPENAI_IMAGE_REQUEST_TIMEOUT_MS> -e MCP_ALLOWED_SYMLINK_ROOTS=<MCP_ALLOWED_SYMLINK_ROOTS> openai-image npx -y @mindstone/mcp-server-openai-image
```
Replace <…> with your own values. 1 more environment variable is in the server README

## When to use it
- generate an illustration from a written prompt
- touch up an existing image with `edit_image`
- produce a PNG in a specific aspect ratio
- keep generated files inside the project workspace
- give an agent image generation without a separate CLI

## Example prompts
- Generate a 1024x1536 portrait of a draft horse pulling a cart at dawn, quality high
- Edit `hero.png` and drop the background, keep just the subject
- Make a square product card image at medium quality

## Similar
- [openai-image-gen](https://affpapa.org/en/nevibecode/skills/openai-image-gen.md) — skill · ★ 700
- [gpt-image-2](https://affpapa.org/en/nevibecode/skills/gpt-image-2.md) — skill · 84300 installs
- [gpt-image](https://affpapa.org/en/nevibecode/skills/gpt-image.md) — skill · 12300 installs
- [gpt-image-2-skill](https://affpapa.org/en/nevibecode/skills/gpt-image-2-skill.md) — skill · 315 installs
- [mcp-image](https://affpapa.org/en/nevibecode/mcp/mcp-image.md) — MCP server · ★ 184
- [baoyu-image-gen](https://affpapa.org/en/nevibecode/skills/baoyu-image-gen.md) — skill · 33600 installs

From the same set: [mindstone/mcp-servers](https://affpapa.org/en/nevibecode/by/mindstone/mcp-servers.md) — 13 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
