openai-gpt-image-mcp

by SureScaleAI

用于OpenAI的GPT-4o/gpt-image-1图像生成与编辑API的Model Context Protocol (MCP)工具服务器。支持通过高级提示控制进行图像生成与编辑。需要通过环境变量设置OpenAI API密钥。支持通过MCP_HF_WORK_DIR环境变量配置文件输出目录,以处理大尺寸图像文件。

Design & creativestdioCommunity

Repository-wide counts · Cached 2026-03-07

Overview

The openai-gpt-image-mcp MCP server is a publicly available project. Review the upstream repository for installation instructions, supported tools, compatibility, permissions, and current maintenance status.

Configuration

Configuration, transport, authentication, and runtime requirements vary by project. Open the repository before connecting and use the smallest set of credentials and permissions required.

Open the openai-gpt-image-mcp repository to read the latest documentation.

KEEP EXPLORING

Compare source, connection, and authentication details before choosing an implementation.

View the complete category

MCP Server Chart

AntV

Community

A Model Context Protocol server for generating charts using AntV. This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.

AbletonMCP

mcpblender

Community

Ableton Live integration through the Model Context Protocol. No external data files required. Telemetry can be disabled via environment variable ABLETON_MCP_DISABLE_TELEMETRY.

AbletonMCP - Ableton Live 模型上下文协议集成

ahujasid

Community

AbletonMCP 通过模型上下文协议(MCP)将 Ableton Live 连接到 Claude AI,允许 Claude 直接与 Ableton Live 交互和控制。这一集成实现了基于提示的音乐制作、轨道创建以及 Live 会话的操作。

Anime Garden

yjl9903

Community

Anime Garden is a third-party mirror and BT resource aggregation site for anime, providing an open API for developers and an MCP server endpoint at https://api.animes.garden/mcp. No external data files are required for the MCP server usage.

FROM THE SOURCE

Repository README

Build-time snapshot · Retrieved 2026-10-05

View original

openai-gpt-image-mcp

MCP SDK OpenAI SDK License GitHub stars Build Status


A Model Context Protocol (MCP) tool server for OpenAI's GPT-4o/gpt-image-1 image generation and editing APIs.

  • Generate images from text prompts using OpenAI's latest models.
  • Edit images (inpainting, outpainting, compositing) with advanced prompt control.
  • Supports: Claude Desktop, Cursor, VSCode, Windsurf, and any MCP-compatible client.

✨ Features

  • create-image: Generate images from a prompt, with advanced options (size, quality, background, etc).
  • edit-image: Edit or extend images using a prompt and optional mask, supporting both file paths and base64 input.
  • File output: Save generated images directly to disk, or receive as base64.

🚀 Installation

git clone https://github.com/SureScaleAI/openai-gpt-image-mcp.git
cd openai-gpt-image-mcp
yarn install
yarn build

🔑 Configuration

Add to Claude Desktop or VSCode (including Cursor/Windsurf) config:

{
  "mcpServers": {
    "openai-gpt-image-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"],
      "env": { "OPENAI_API_KEY": "sk-..." }
    }
  }
}

Also supports Azure deployments:

{
  "mcpServers": {
    "openai-gpt-image-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js"],
      "env": { 
        "AZURE_OPENAI_API_KEY": "sk-...",
        "AZURE_OPENAI_ENDPOINT": "my.endpoint.com",
        "OPENAI_API_VERSION": "2024-12-01-preview"
      }
    }
  }
}

Also supports supplying an environment files:

{
  "mcpServers": {
    "openai-gpt-image-mcp": {
      "command": "node",
      "args": ["/absolute/path/to/dist/index.js", "--env-file", "./deployment/.env"]
    }
  }
}

⚡ Advanced

  • For create-image, set n to generate up to 10 images at once.
  • For edit-image, provide a mask image (file path or base64) to control where edits are applied.
  • Provide an environment file with --env-file path/to/file/.env
  • See src/index.ts for all options.

🧑‍💻 Development

  • TypeScript source: src/index.ts
  • Build: yarn build
  • Run: node dist/index.js

📝 License

MIT


🩺 Troubleshooting

  • Make sure your OPENAI_API_KEY is valid and has image API access.
  • You must have a verified OpenAI organization. After verifying, it can take 15–20 minutes for image API access to activate.
  • File paths must be absolute.
    • Unix/macOS/Linux: Starting with / (e.g., /path/to/image.png)
    • Windows: Drive letter followed by : (e.g., C:/path/to/image.png or C:\path\to\image.png)
  • For file output, ensure the directory is writable.
  • If you see errors about file types, check your image file extensions and formats.

⚠️ Limitations & Large File Handling

  • 1MB Payload Limit: MCP clients (including Claude Desktop) have a hard 1MB limit for tool responses. Large images (especially high-res or multiple images) can easily exceed this limit if returned as base64.
  • Auto-Switch to File Output: If the total image size exceeds 1MB, the tool will automatically save images to disk and return the file path(s) instead of base64. This ensures compatibility and prevents errors like result exceeds maximum length of 1048576.
  • Default File Location: If you do not specify a file_output path, images will be saved to /tmp (or the directory set by the MCP_HF_WORK_DIR environment variable) with a unique filename.
  • Environment Variable:
    • MCP_HF_WORK_DIR: Set this to control where large images and file outputs are saved. Example: export MCP_HF_WORK_DIR=/your/desired/dir
  • Best Practice: For large or production images, always use file output and ensure your client is configured to handle file paths.

📚 References


🙏 Credits