MCP Image
MCP server for AI image generation and editing with automatic prompt optimization and quality presets. Powered by Gemini (Nano Banana 2 & Pro), with optional OpenAI GPT Image support.
What is MCP Image?
MCP Image is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server for ai image generation and editing with automatic prompt optimization and quality presets. powered by gemini (nano banana 2 & pro), with optional openai gpt image support.
MCP server for AI image generation and editing with automatic prompt optimization and quality presets. Powered by Gemini (Nano Banana 2 & Pro), with optional OpenAI GPT Image support.
This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- generate_image
Use Cases
Maintainer
Works with
Installation
NPM
npx -y mcp-imageManual Installation
npx -y mcp-imageConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use MCP Image
MCP Image is an AI image generation and editing MCP server powered by Google Gemini (Nano Banana 2 / Gemini 3.1 Flash Image and Nano Banana Pro / Gemini 3 Pro Image), with optional OpenAI GPT Image support. It automatically enriches simple text prompts using a Subject-Context-Style framework — adding lighting, composition, atmosphere, and artistic details — so you get high-quality images without any prompt engineering. It supports text-to-image, image-to-image editing, high-resolution output up to 4K, flexible aspect ratios, and multi-image blending, making it ideal for developers who want professional images directly from their AI coding tools.
Prerequisites
- Node.js 22 or higher
- A Gemini API key from Google AI Studio (aistudio.google.com/apikey) for the default provider
- An OpenAI API key (optional) if you want to use IMAGE_PROVIDER=openai with gpt-image-2
- An MCP-compatible client: Claude Code, Cursor, Codex, or Claude Desktop
- An absolute local directory path where generated images will be saved
Obtain a Gemini API key
Visit Google AI Studio at aistudio.google.com/apikey, sign in with your Google account, and create a new API key. Copy the key — you will supply it as the GEMINI_API_KEY environment variable. If you prefer OpenAI instead, skip this step and get an OpenAI API key from platform.openai.com/api-keys.
Choose an output directory
Decide on an absolute path where generated images will be written. The server uses this path via the IMAGE_OUTPUT_DIR environment variable. Create the directory in advance if it does not already exist.
mkdir -p /absolute/path/to/imagesAdd the MCP server to Claude Code
Run the following command in your terminal to register mcp-image with Claude Code for the current project. Replace the placeholder values with your real API key and image directory.
claude mcp add mcp-image --env GEMINI_API_KEY=your-gemini-api-key --env IMAGE_OUTPUT_DIR=/absolute/path/to/images -- npx -y mcp-imageVerify the server is running
Inside Claude Code, type /mcp to list connected servers. You should see mcp-image listed with a green status. If you see an error, check that your GEMINI_API_KEY is correct and that Node.js 22+ is on your PATH.
(Optional) Switch to OpenAI provider
To use OpenAI GPT Image (gpt-image-2) instead of Gemini, add the IMAGE_PROVIDER and OPENAI_API_KEY environment variables. Note that OpenAI mode requires organization verification on the OpenAI platform before it will work.
claude mcp add mcp-image --env IMAGE_PROVIDER=openai --env OPENAI_API_KEY=your-openai-api-key --env IMAGE_OUTPUT_DIR=/absolute/path/to/images -- npx -y mcp-imageMCP Image Examples
Client configuration (Claude Desktop / Cursor)
Add this block to your claude_desktop_config.json or ~/.cursor/mcp.json to enable mcp-image with the Gemini provider.
{
"mcpServers": {
"mcp-image": {
"command": "npx",
"args": ["-y", "mcp-image"],
"env": {
"GEMINI_API_KEY": "your_gemini_api_key_here",
"IMAGE_OUTPUT_DIR": "/absolute/path/to/images"
}
}
}
}Prompts to try
Once the server is connected, use these prompts in your AI client to generate images. The server automatically optimizes your prompt before calling the Gemini API.
- "Generate an image of a futuristic city at dusk with neon reflections on wet streets"
- "Create a product photo of a minimalist wooden desk lamp on a white background, studio lighting"
- "Edit this image to make the sky look like a stormy sunset" (attach an image first)
- "Generate a 16:9 banner image for a tech blog about machine learning, abstract style"
- "Create a portrait illustration of a fantasy wizard in a dark forest, painterly style"Troubleshooting MCP Image
Images are not saved or the server reports a path error
Ensure IMAGE_OUTPUT_DIR is set to an absolute path (not relative), and that the directory already exists with write permissions. The server does not create the directory automatically.
API key invalid or quota exceeded error from Gemini
Double-check that GEMINI_API_KEY matches the key shown in Google AI Studio. Free-tier keys have per-minute and per-day quotas; if you hit a 429 error, wait a minute or upgrade your plan.
OpenAI provider returns an authorization error
OpenAI image generation (gpt-image-2) requires your OpenAI organization to have completed identity/payment verification. Check your organization status at platform.openai.com/organization before using IMAGE_PROVIDER=openai.
Frequently Asked Questions about MCP Image
What is MCP Image?
MCP Image is a Model Context Protocol (MCP) server that mcp server for ai image generation and editing with automatic prompt optimization and quality presets. powered by gemini (nano banana 2 & pro), with optional openai gpt image support. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install MCP Image?
Install via npm with the command: npx -y mcp-image. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).
Which AI clients work with MCP Image?
MCP Image works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is MCP Image free to use?
Yes, MCP Image is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
MCP Image Alternatives — Similar Data Science & ML Servers
Looking for alternatives to MCP Image? Here are other popular data science & ml servers you can use with Claude, Cursor, and VS Code.
Ultrarag
★ 5.6kA Low-Code MCP Framework for Building Complex and Innovative RAG Pipelines
RocketRide
★ 3.1k📇 🏠 - MCP server that exposes RocketRide AI pipelines as t
Aix Db
★ 2.1kAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。
NeMo Data Designer
★ 1.9k🎨 NeMo Data Designer: Generate high-quality synthetic data from scratch or from seed data.
PaperBanana
★ 1.7kOpen source implementation and extension of Google Research’s PaperBanana for automated academic figures, diagrams, and research visuals, expanded to new domains like slide generation.
MiniMax
★ 1.5kBridges MiniMax AI capabilities to the Model Context Protocol, enabling AI agents to perform image understanding, text-to-image generation, and speech synthesis. It provides a standardized interface for accessing MiniMax's core tools via JSON-RPC.
Browse More Data Science & ML MCP Servers
Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up MCP Image in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use MCP Image?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.