Smart Image Generator
This MCP server lets an assistant generate new images or edit existing images via the generate_image tool, save the result to disk, and return it as an MCP file resource.
Generate images from text prompts, with prompt enhancement applied by default.
Edit existing images by supplying an absolute
inputImagePathfor edits, variations, or style transfer.Choose an image provider: Gemini, OpenAI, or BytePlus Seedream, if the corresponding API key is configured.
Control output quality:
fast,balanced, orquality.Control image size:
1K,2K, or4K, subject to provider limits.Control aspect ratio from common presets such as
1:1,16:9,21:9, and9:16.Request output format via
.png,.jpg, or.jpegfilenames for OpenAI or Seedream.Improve complex results with purpose context, blending guidance, character consistency, and world knowledge.
Use Gemini-only Google Search grounding for current or time-sensitive information.
Save and return images to the configured output directory as MCP resources.
Enables AI-powered image generation and editing using Google's Gemini 2.5 Flash Image API, with automatic prompt enhancement via Gemini 2.0 Flash for superior image quality
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Smart Image Generator Generate a futuristic cityscape at night with flying cars and neon lights"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Image Generator 🍌
Generate and edit images from Codex, Cursor, Claude Code, or any MCP client. mcp-image adds visual direction to your request before sending it to Gemini, OpenAI, or BytePlus Seedream.
Tell it what image to create or what to change in an existing image, and what it is for. The result is saved to disk and returned to your assistant.
What It Does
Before generating an image, mcp-image rewrites short requests into more specific prompts. It keeps what you asked for and fills in what the image needs for its use, such as lighting and camera angle for a photo or layout for a poster. Text you want in the image stays as you wrote it, in your language. The more detail you provide, the less it changes.
You ask:
"A photo of a roast chicken dinner for a recipe site. It should look like it was actually cooked, and it should be partway through being carved so you can tell how juicy it is."
mcp-image sends to the image model:
"... a freshly roasted whole chicken resting on a rustic, seasoned wooden carving board. The chicken features deeply bronzed, blistered, and crispy skin ... It is partway carved, with one breast cleanly sliced open to reveal tender, steaming-hot white meat glistening with natural juices pooling slightly onto the board ... shallow depth of field with a softly blurred background."

Generated with Gemini using the default fast quality preset.
What carried through:
for a recipe site: one clear subject, with everything else kept subordinateactually cooked: blistered, uneven browning, rising steam, and drippings on the knifepartway through being carved: one breast sliced open, with the cut piece still resting against the birdhow juicy it is: juices pooling on the board and shallow depth of field around the cut
Baseline from the same request, with prompt enhancement disabled.
Set SKIP_PROMPT_ENHANCEMENT=true to send the original prompt to the image model unchanged.
Related MCP server: Gemini 2.5 Flash Image MCP
Quick Start
You need Node.js 22 or later, an MCP-compatible client, and an API key for one image provider.
1. Get an API key
All three providers generate and edit images. Gemini is the default and requires the least configuration.
Provider | Image size | Output format | Setup |
Gemini (default) | 1K, 2K, 4K | Automatic | Get a key, then set |
OpenAI | 1K, 2K, 4K | PNG or JPEG | Get a key, then set |
BytePlus Seedream | 1K, 2K | PNG or JPEG | Get an AP region key, then set |
Google Search grounding is available with Gemini only. OpenAI may require organization verification before it can generate images.
The examples below use Gemini. Replace the provider settings if you prefer OpenAI or Seedream.
2. Configure your MCP client
Codex
Add this to ~/.codex/config.toml:
[mcp_servers.mcp-image]
command = "npx"
args = ["-y", "mcp-image"]
[mcp_servers.mcp-image.env]
GEMINI_API_KEY = "your_gemini_api_key_here"
IMAGE_OUTPUT_DIR = "/absolute/path/to/images"Cursor
Add this to ~/.cursor/mcp.json for all projects, or .cursor/mcp.json in a project:
{
"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"
}
}
}
}Claude Code
Run this in your project directory:
claude mcp add mcp-image --env GEMINI_API_KEY=your-api-key --env IMAGE_OUTPUT_DIR=/absolute/path/to/images -- npx -y mcp-imageAdd --scope user after mcp-image to make it available in every project.
Never commit API keys to version control. Use an absolute IMAGE_OUTPUT_DIR in MCP configuration because the server's working directory depends on the client. If omitted, images are written to ./output relative to that working directory.
3. Generate an image
Restart your MCP client after changing its configuration, then ask your AI assistant:
Generate a product photo of a ceramic coffee mug on a wooden desk.The generated file is saved in the configured output directory and returned to the assistant as an MCP resource.
pnpm install
pnpm run buildConfigure the MCP client to run the local build instead of npx -y mcp-image:
node /absolute/path/to/mcp-image/dist/index.jsMore Examples
Edit an existing image
Give the assistant an absolute path to the source image:
Edit /path/to/image.jpg so the person is facing right.Control the result
Generate a high-quality product photo of a smartphone with clear text on the screen.Generate a cinematic desert landscape in a 21:9 aspect ratio.Keep the knight's appearance consistent with the previous image.
See the tool reference for the options your assistant can pass explicitly.
Configuration
Changing the provider changes both prompt enhancement and image generation. The way you ask for an image stays the same.
Quality
IMAGE_QUALITY accepts fast (default), balanced, or quality. Set it in the MCP server environment:
IMAGE_QUALITY=balancedUse fast to try ideas quickly, balanced for everyday use, and quality for complex scenes or images where small details matter. Higher settings can take longer and cost more; results vary by provider.
All three providers support these presets for generation and editing. You can override the default with the quality option on each request.
Environment variables
Variable | Default | Description |
|
| Default provider: |
| - | API key for Gemini |
| - | API key for OpenAI |
| - | ModelArk AP API key for Seedream |
|
| Directory where generated images are saved; use an absolute path in MCP configuration |
|
| Default quality preset: |
|
| Set to |
You can configure keys for more than one provider and switch per request. A request-level provider option takes precedence over IMAGE_PROVIDER.
Tool Reference
Your MCP client calls this tool for you. Open the reference when you need to check an option or provider limitation.
Parameter | Type | Required | Description |
| string | Yes | Image description or editing instruction |
| string | No |
|
| string | No |
|
| string[] | No | Absolute paths to input images for editing |
| string | No | Output filename; |
| string | No |
|
| string | No |
|
| boolean | No | Add blending guidance when combining visual elements |
| boolean | No | Keep a character's appearance consistent across images |
| boolean | No | Add context for historical figures, landmarks, and factual scenes |
| boolean | No | Gemini only. Use Google Search grounding for current information |
| string | No | Intended use, such as |
| string | No | Kind of image: |
Troubleshooting
API key not found
Check that the key for the selected provider is present in the MCP server's environment:
Gemini:
GEMINI_API_KEYOpenAI:
OPENAI_API_KEYSeedream:
ARK_API_KEY
Restart the MCP client after changing its configuration.
Input image file not found
Use absolute paths and make sure the MCP server can read the files. Input images can be PNG, JPEG, or WebP and must be no larger than 10 MiB each. Seedream editing accepts PNG and JPEG only.
Provider rejects a request
Check the requested size in the provider table. useGoogleSearch works with Gemini only, and Seedream does not support 4K. For OpenAI permission errors, check your organization settings. For quota or rate-limit errors, check the selected provider account.
Image Generation Prompt Skill
This repository also includes an Agent Skill for assistants that already have access to an image generation tool. It teaches the prompt-writing approach used by mcp-image and works independently of this server.
Install it with:
npx mcp-image skills install --path <skills-directory>For example, use ~/.codex/skills, ~/.cursor/skills, or ~/.claude/skills as the destination.
License
MIT License. See LICENSE for details.
Need help? Open an issue or check Troubleshooting.
Available Tools
1 toolgenerate_imageA
Generate a new image from a text prompt or edit and combine reference images using inputImagePaths. Saves the result and returns a file resource. Prompt enhancement expands these arguments into the final image prompt without seeing the conversation, filling in the details they leave open, so pass the user's intent as they gave it; anything you add is expanded too. When a guess at the image's purpose or style would likely miss what the user needs, ask them first.
Inputs: prompt (required), purpose, quality, category, +9 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
There is only one tool, so there is no possibility of misselection or overlapping purpose. Its description clearly delimits the single capability: generating or editing images from prompts and reference paths.
The lone name, generate_image, follows a clean verb_noun snake_case convention that matches the server's domain. With a single tool there is nothing to be inconsistent with, and the name is predictable and readable.
One tool is a thin surface for an image server; a single call can generate or edit, but there is no way to list, retrieve, or manage previously saved results. It is not a mismatch, but the surface feels minimal even for a focused generator.
Core generation and reference-image editing/combining are both covered and results are returned as file resources, so the main workflow has no dead end. Minor gaps remain: no listing or fetching of earlier outputs, no explicit variation/upscale or asset management operations.
Maintenance
Related MCP Connectors
Generate images, videos and SVG with Nano Banana, GPT Image, Seedream, Recraft, Seedance, Kling
Generate, edit, and explore AI images. Flux, Imagen, LoRA identity swap, upscale, and more.
Generate and edit images (PNG, transparent, GIF, SVG) with GPT Image and Nano Banana models.
Generate images with GPT Image 2, Nano Banana Pro and more, placed on your Banana Art Lab canvas.
Related MCP Servers
- -
- AlicenseAqualityDmaintenanceEnables conversational image generation and editing with Google's Gemini 2.5 Flash Image Preview. Supports text-to-image generation, natural language image editing, multi-image composition, and style transfer with optional file saving.43MIT
- AlicenseNot gradedqualityDmaintenanceUse Nano Banana Pro to generate image from text prompt and edit image3Apache 2.0
- AlicenseAqualityDmaintenanceExposes Google Gemini's Nano Banana image generation models to Claude, enabling text-to-image generation, image editing, and multi-image composition through natural language prompts.3MIT