Smart Image Generator
Generate and edit images using Google's Gemini 2.5 Flash Image with intelligent prompt enhancement and advanced features for professional image creation.
AI-Powered Image Generation: Create high-quality images from text prompts using advanced AI models
Intelligent Prompt Enhancement: Automatically optimize prompts for superior image quality (can be disabled for full control)
Image Editing: Transform existing images with natural language instructions while preserving original style
Multi-Image Blending: Combine multiple visual elements to create composite scenes
Character Consistency: Maintain character appearance across different generations
World Knowledge Integration: Generate accurate context with historical figures, landmarks, and factual scenarios
Flexible Output: Support for PNG, JPEG, and WebP formats with customizable file naming and directory saving
Customizable Parameters: Control aspect ratio and enable/disable specific features as needed
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 GeneratorGenerate 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 details such as composition, lighting, and camera angle. 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 beautifully roasted whole chicken, golden-brown and glistening, resting on a rustic wooden cutting board. One leg is partially carved, revealing tender, succulent white meat and rich, glistening juices pooling around the carving knife ... shallow depth of field focused on the carved chicken."

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: uneven browning and juices across the boardpartway through being carved: the cut face and slices beside ithow juicy it is: close framing 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 path to an input image 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 |
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 an absolute path and make sure the MCP server can read the file. Input images can be PNG, JPEG, or WebP and must be no larger than 10 MB. 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 an existing image using inputImagePath. Saves the result and returns a file resource.
| Name | Required | Description | Default |
|---|---|---|---|
| prompt | Yes | Describe the image to generate or the edit to apply. Include the subject, context, and visual style; English is recommended for prompt enhancement. | |
| purpose | No | Describe the image's intended use, such as a cookbook cover, social media post, or presentation slide, so prompt enhancement can adapt composition and detail. | |
| quality | No | Set only when the user requests a quality level; otherwise omit to use the server default. fast prioritizes speed, balanced trades speed for detail, and quality prioritizes fidelity. | |
| fileName | No | Use .png, .jpg, or .jpeg to request that output format from OpenAI or Seedream. Other or absent suffixes use the provider default; the saved filename is corrected to the actual image extension. | |
| provider | No | Set only when the user requests a specific image provider; otherwise omit to use the server default. The provider must have its API key configured on the server. | |
| imageSize | No | Set the requested output size to 1K, 2K, or 4K. Omit to use the selected provider and quality preset's default. With Seedream, use 1K or 2K. | |
| aspectRatio | No | Set the requested output aspect ratio. Omit to use the provider default. OpenAI does not support 1:4, 1:8, 4:1, or 8:1. | |
| blendImages | No | Enable when the prompt combines multiple visual elements that need coherent spatial relationships, lighting, or composition. | |
| inputImagePath | No | Provide an absolute path to a source image when editing, creating a variation, or transferring style. | |
| useGoogleSearch | No | Enable when using Gemini and the image requires current or time-sensitive web information. With OpenAI or Seedream, omit this option or set it to false. | |
| useWorldKnowledge | No | Enable when accurate real-world details matter, such as historical figures, landmarks, cultures, or factual settings. | |
| maintainCharacterConsistency | No | Enable when the same character must retain a recognizable appearance across poses or scenes. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full behavioral burden. It honestly discloses that the tool saves the result and returns a file resource, which is meaningful side-effect and return information. However, it omits other behavioral traits such as potential cost, latency, provider API-key requirements, and file overwrite or naming behavior, so transparency is only partial.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description packs purpose, edit mode, and result behavior into two concise sentences. Every clause adds meaningful information; there is no redundancy, fluff, or unnecessary detail. The key action is front-loaded and the secondary outcome follows naturally.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 12-parameter tool with no annotations and no output schema, the description provides a minimal but coherent end-to-end picture: input prompt or source image, save result, return a file resource. The rich parameter schema covers most input semantics, but the description does not address output format details, default provider/quality behavior, or potential side effects like file name resolution or costs. This leaves noticeable gaps for a complex generative tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% across all 12 parameters, so the schema already handles parameter semantics thoroughly. The description adds only marginal context by mentioning text prompts and inputImagePath, which aligns with the prompt and inputImagePath parameters. There is no need for the description to repeat schema-level details, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly identifies two concrete operationsβgenerating from a text prompt and editing an existing image via inputImagePathβand states the outcome (saves and returns a file resource). It is specific about verb, resource, and mode, making the tool's purpose unmistakable even without sibling tools to differentiate.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear context for when to use the tool: generating new images or editing existing ones, with inputImagePath called out for the editing path. There are no sibling tools to contrast with, so it cannot name alternatives, but the two modes are explicit. It does not provide exclusions, but the context is sufficient for a standalone tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v0.13.2- Changed
generate_image2 fields changed- changed
Input schema / properties / aspectRatio / descriptionPrevious value: -"Set the requested output aspect ratio. Omit to use the provider default."New value: +"Set the requested output aspect ratio. Omit to use the provider default. OpenAI does not support 1:4, 1:8, 4:1, or 8:1." - added
Input schema / properties / providerAdded value: +{ + "description": "Set only when the user requests a specific image provider; otherwise omit to use the server default. The provider must have its API key configured on the server.", + "enum": [ + "gemini", + "openai", + "seedream" + ], + "type": "string" +}
1 tool update
v0.12.1- Changed
generate_image11 fields changed- changed
Input schema / properties / aspectRatio / descriptionPrevious value: -"Aspect ratio for the generated image"New value: +"Set the requested output aspect ratio. Omit to use the provider default." - changed
Input schema / properties / blendImages / descriptionPrevious value: -"Enable multi-image blending for combining multiple visual elements naturally. Use when prompt mentions multiple subjects or composite scenes"New value: +"Enable when the prompt combines multiple visual elements that need coherent spatial relationships, lighting, or composition." - changed
Input schema / properties / fileName / descriptionPrevious value: -"Custom file name for the output image. Auto-generated if not specified."New value: +"Use .png, .jpg, or .jpeg to request that output format from OpenAI or Seedream. Other or absent suffixes use the provider default; the saved filename is corrected to the actual image extension." - changed
Input schema / properties / imageSize / descriptionPrevious value: -"Image resolution for high-quality output. Specify \"1K\", \"2K\", or \"4K\" when you need specific resolution. Leave unspecified for standard quality."New value: +"Set the requested output size to 1K, 2K, or 4K. Omit to use the selected provider and quality preset's default. With Seedream, use 1K or 2K." - changed
Input schema / properties / inputImagePath / descriptionPrevious value: -"Optional absolute path to source image for image-to-image generation. Use when generating variations, style transfers, or similar images based on an existing image (must be an absolute path)"New value: +"Provide an absolute path to a source image when editing, creating a variation, or transferring style." - changed
Input schema / properties / maintainCharacterConsistency / descriptionPrevious value: -"Maintain character appearance consistency. Enable when generating same character in different poses/scenes"New value: +"Enable when the same character must retain a recognizable appearance across poses or scenes." - changed
Input schema / properties / prompt / descriptionPrevious value: -"The prompt for image generation (English recommended for optimal structured prompt enhancement)"New value: +"Describe the image to generate or the edit to apply. Include the subject, context, and visual style; English is recommended for prompt enhancement." - changed
Input schema / properties / purpose / descriptionPrevious value: -"Intended use for the image (e.g., cookbook cover, social media post, presentation slide). Influences lighting, composition, and detail level to match the context."New value: +"Describe the image's intended use, such as a cookbook cover, social media post, or presentation slide, so prompt enhancement can adapt composition and detail." - changed
Input schema / properties / quality / descriptionPrevious value: -"Quality preset controlling speed/fidelity tradeoff. Only specify when the user explicitly requests a specific quality level; omit to use the server's configured default. \"fast\": best for drafts and rapid iteration. \"balanced\": better detail and coherence, moderate latency. \"quality\": highest fidelity, use for final deliverables where quality matters most."New value: +"Set only when the user requests a quality level; otherwise omit to use the server default. fast prioritizes speed, balanced trades speed for detail, and quality prioritizes fidelity." - changed
Input schema / properties / useGoogleSearch / descriptionPrevious value: -"Enable Google Search grounding to access real-time web information for factually accurate image generation. Use when prompt requires current or time-sensitive data that may have changed since the model's knowledge cutoff. Leave disabled for creative, fictional, historical, or timeless content."New value: +"Enable when using Gemini and the image requires current or time-sensitive web information. With OpenAI or Seedream, omit this option or set it to false." - changed
Input schema / properties / useWorldKnowledge / descriptionPrevious value: -"Use real-world knowledge for accurate context. Enable for historical figures, landmarks, or factual scenarios"New value: +"Enable when accurate real-world details matter, such as historical figures, landmarks, cultures, or factual settings."
1 tool update
v0.11.0- Added
generate_image
TDQS
Scored across 1 tool
Since there is only one tool, there is no possibility of ambiguity or misselection. The tool clearly serves as the singular entry point for image operations.
The single tool name 'generate_image' follows a clear verb_noun convention and is descriptive of its purpose. With only one tool, naming consistency is inherently perfect.
A single tool is minimal, but it effectively combines two core operationsβgenerating from a prompt and editing an existing imageβso the count feels appropriate for the focused 'Smart Image Generator' server without being excessively thin.
The tool covers the primary workflows: creating new images and editing existing ones, with saving and file return built in. Missing operations like listing or deleting generated images are not critical for this narrow server purpose, so only a minor gap exists.
Maintenance
Related MCP Connectors
Generate, edit, and explore AI images. Flux, Imagen, LoRA identity swap, upscale, and more.
AI image, video & music generation. Flux, Veo 3.1, Suno V5. Free tier included.
Analyze images from multiple angles to extract detailed insights or quick summaries. Describe visuβ¦
Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.
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.49 npm3MIT
- AlicenseNot gradedqualityCmaintenanceUse 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