shinpr/mcp-image

MCP Server

mcp-image - image generation MCP server for OpenAI GPT Image 2.5 and Google Nano Banana, saving files to disk

Image generation MCP server with one tool, generate_image, backed by OpenAI GPT Image 2.5 (Flare for fast/balanced, Sunburst for quality), Google Nano Banana 2.1 (Nano Banana Pro for quality), or ByteDance Seedream. It writes every image to disk and returns the file path, so agents without a shell can still place the file in their deliverable. Reference images (inputImagePaths, up to 16 for OpenAI and 14 for Gemini) drive edits, product shots, and consistent characters.

MCP Server

  • Package: mcp-image (pinned in the capability files)
  • Transport: stdio
  • Command: npx -y [email protected]
  • Runtime: Node.js 22+

Authentication

API key for the selected provider.

VariableRequiredDescription
OPENAI_API_KEYFor IMAGE_PROVIDER=openaiOpenAI API key; the GPT Image 2.5 models may require a verified organization
GEMINI_API_KEYFor IMAGE_PROVIDER=geminiGoogle AI Studio (Gemini API) key
ARK_API_KEYFor IMAGE_PROVIDER=seedreamBytePlus ModelArk key
IMAGE_PROVIDERNoopenai, gemini, or seedream (the tap sets it per capability provider)
IMAGE_OUTPUT_DIRNoWhere images are saved (the tap uses ./image-out in the project)
IMAGE_QUALITYNoDefault preset: fast, balanced, or quality
SKIP_PROMPT_ENHANCEMENTNotrue sends the prompt as written instead of rewriting it with a text model

Available Tools

ToolDescription
generate_imageGenerate from a prompt, or edit/combine reference images (inputImagePaths, absolute paths under the project, the output dir, or /tmp). Options: aspectRatio (1:1, 2:3, 3:2, 3:4, 4:3, 4:5, 5:4, 9:16, 16:9, 21:9), imageSize (1K/2K/4K), quality (fast/balanced/quality), fileName (.png/.jpg), maintainCharacterConsistency, blendImages, useWorldKnowledge

Configuration Example

toml
[[mcp.servers]]
name = "image-gen"
type = "stdio"
command = "sh"
args = ["-c", "mkdir -p \"$PWD/image-out\"; IMAGE_OUTPUT_DIR=\"$PWD/image-out\" IMAGE_PROVIDER=openai IMAGE_QUALITY=balanced SKIP_PROMPT_ENHANCEMENT=true exec npx -y [email protected]"]
timeout_seconds = 300
env = { OPENAI_API_KEY = "{{ENV:OPENAI_API_KEY}}" }
tools = []