Gemini Image MCP Server
Provides tools for image generation and editing using Google Gemini AI, supporting multiple aspect ratios, custom styles, context images for guidance, watermark overlay, and automatic file saving with configurable safety settings.
Click on "Install 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., "@Gemini Image MCP Servergenerate a minimalist logo for a coffee shop with warm colors"
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.
Gemini Image MCP Server
A Model Context Protocol (MCP) server for image generation and editing using Google Gemini AI. Supports optional context images to guide results and now includes a dedicated edit workflow. Optimized for creating eyeβcatching social media images with square (1:1) format by default.
Features
β¨ Image generation with Google Gemini AI
π¨ Multiple aspect ratios (1:1, 16:9, 9:16, 4:3, 3:4)
π± Optimized for social media with 1:1 format by default
π― Custom style support
π§© Context images to guide generation
βοΈ Dedicated edit tool for modifying existing assets without juggling extra options
π·οΈ Watermark support - Overlay watermark images on generated results
πΎ Automatic saving of images to local files
π Flexible output path configuration
π‘οΈ Customizable safety settings
Related MCP server: Gemini Flash Image MCP Server
Installation
Clone this repository
Install dependencies:
npm installBuild the project:
npm run buildConfiguration
Environment Variables
You need to configure your Google AI API key:
export GOOGLE_API_KEY="your-api-key-here"Getting Google AI API Key
Go to Google AI Studio
Create a new API key
Copy the key and set it as an environment variable
Client Configuration
{
"servers": {
"gemini-image": {
"command": "node",
"args": ["/full/path/to/project/dist/index.js"],
"env": {
"GOOGLE_API_KEY": "your-api-key-here"
}
}
}
}Command Line Interface
In addition to the MCP server, the project now ships with a CLI for quick terminal-friendly workflows.
Build the project once:
npm run buildMake sure
GOOGLE_API_KEYis set in your environment.Explore the CLI:
node dist/cli.js --help # or, after publishing/packing: gemini-image --help
Commands
gemini-image generate: Create new imagery from a text prompt.gemini-image generate --prompt "A banana astronaut on Mars" --output ./images/gemini-image edit: Apply instructions to an existing image.gemini-image edit --prompt "Add neon lights to the skyline" --input ./images/city.png
Both commands support --help for detailed, friendly option descriptions. CLI option names are intentionally concise (for example --prompt, --context, --input) so they are easier to memorize than the MCP tool identifiers.
Available Tools
generate_image
Creates a brand-new image from a text description, optionally using one or more images as visual context. Use this tool when you want to generate fresh content.
Parameters:
description(string, required): Detailed description of the desired image.images(string[], optional): Array of image paths used as context (absolute or relative). Use this to βeditβ or guide style/content.aspectRatio(string, optional): Orientation preset (square,landscape,portrait). Default:square.style(string, optional): Additional style (e.g., "minimalist", "colorful", "professional", "artistic").outputPath(string, optional): Where to save the image. If omitted, saves in current directory.watermarkPath(string, optional): Path to watermark image to overlay.watermarkPosition(string, optional): One oftop-left,top-right,bottom-left,bottom-right. Default:bottom-right.
Usage Examples:
# Basic - saves to current directory
Generate an image of a mountain landscape at sunset with warm, minimalist style# With context image to guide composition
Generate an image: "Create a futuristic city skyline inspired by this photo", images: ["./reference-skyline.jpg"], aspectRatio: "landscape"# Multiple context images
Generate an image combining style of a logo and a photo, images: ["./photo.jpg", "./logo.png"], style: "professional"When you request a specific orientation (square, landscape, or portrait), the server automatically appends an invisible helper image (assets/square.png, assets/landscape.png, or assets/portrait.png) so Gemini respects the target dimensions.
edit_image
Modifies an existing image using a focused text instruction. This tool keeps the original framing unless you explicitly ask for structural changes.
Parameters:
description(string, required): Instructions describing the edits to apply to the provided image.image(string, required): Path to the image file you want to edit (absolute or relative).outputPath(string, optional): Where to save the edited result. If omitted, the server uses the working directory and an auto-generated filename.
Usage Examples:
# Simple edit
Edit image: "Soften skin tones and remove flyaway hairs", image: "./headshot.png"# Heavier retouch
Edit image: "Turn the product label red and add subtle sparkle highlights", image: "./product-shot.jpg"# Custom path and watermark (top-left)
Generate an image of a space cat, outputPath: "./images/epic_pizza.png", watermarkPath: "./my_logo.png", watermarkPosition: "top-left"Watermark Functionality
The generate_image tool supports adding watermarks to your images:
Features:
π·οΈ Add image watermarks to any generated output
π Position in any corner (
watermarkPosition)π Smart sizing (25% of image width, maintaining aspect ratio)
π― Consistent spacing (3% padding from edges)
πΌοΈ Supports PNG, JPG, WebP watermark files
β‘ Only applied when
watermarkPathparameter is provided
Usage:
# For image generation
watermarkPath: "./my-brand-logo.png"
# With context images
watermarkPath: "./watermark.jpg"Watermark Specifications:
Position: Configurable corner via
watermarkPositionSize: 25% of image width (maintains watermark aspect ratio)
Padding: 3% of image width from the selected edges
Blend mode: Over (watermark appears on top of image)
Save Functionality:
Default: Images are saved in the directory from where the MCP client is executed
Automatic naming: Generated based on description, date and time
Supported formats: PNG, JPG, WebP (depending on what Gemini returns)
Automatic creation: Creates necessary folders if they don't exist
Development
Available Scripts
npm run build: Compiles TypeScript to JavaScriptnpm run dev: Development mode with automatic reloadnpm start: Runs the compiled servernpm run cli: Runs the CLI entry directly (node dist/cli.js)
Project Structure
gemini-image-mcp-server/
βββ src/
β βββ index.ts # Main server entry point
β βββ cli.ts # CLI entry point (generate/edit commands)
β βββ services/
β β βββ gemini.ts # Gemini AI calls
β β βββ imageService.ts # File system + watermark handling
β β βββ serviceFactory.ts # Shared initialization helpers
β βββ tools/
β β βββ index.ts # Tools exports
β β βββ generateImage.ts # Tool for creating new images
β β βββ editImage.ts # Tool for editing existing images
β βββ types/
β βββ index.ts # Type definitions
βββ dist/ # Compiled files
βββ package.json
βββ tsconfig.json
βββ README.mdTroubleshooting
Error: "GOOGLE_API_KEY environment variable is required"
Make sure you have configured the GOOGLE_API_KEY environment variable with your Google AI API key.
Error: "Could not generate image"
Verify that your API key is valid and has permissions for the
gemini-2.5-flash-image-previewmodelEnsure the description doesn't contain content that might be blocked by safety filters
File saving error
Verify you have write permissions in the specified path
Make sure the path is valid and accessible
If specifying a folder, end it with
/
Server not responding
Verify the server is running correctly
Check logs in stderr for error messages
Make sure the MCP client is configured correctly
License
MIT
Contributing
Contributions are welcome. Please open an issue before making significant changes.
Available Tools
2 toolsedit_imageC
Modify an existing image using Google Gemini AI based on a text instruction. Provide the path to the image you want to edit and describe the changes that should be applied.
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Describe the changes that should be applied to the provided image. Be specific about elements to add, remove, or modify. | |
| image | Yes | Path to the image file that should be edited. Can be absolute or relative to the server. | |
| outputPath | No | Optional path where the edited image should be saved. If omitted, saves in the current working directory using an auto-generated filename. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool modifies images using AI, implying mutation, but lacks details on permissions, side effects, rate limits, or output behavior. The mention of saving to an output path is covered in the schema, not behavioral context. This is inadequate for a mutation tool with zero annotation coverage.
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 is concise and front-loaded, with two sentences that directly state the tool's purpose and key parameters. Every sentence earns its place by providing essential information without redundancy or fluff.
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?
Given the tool's complexity (AI-based image editing with mutation), lack of annotations, and no output schema, the description is incomplete. It fails to address critical behavioral aspects like error handling, output format, or limitations, leaving significant gaps for an AI agent to understand the tool fully.
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%, so the schema fully documents all three parameters. The description adds minimal value beyond the schema, mentioning the image path and description of changes but not elaborating on semantics. Baseline 3 is appropriate as the schema does the heavy lifting, though the description doesn't compensate for any gaps.
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 states the tool's purpose: 'Modify an existing image using Google Gemini AI based on a text instruction.' It specifies the verb ('Modify'), resource ('existing image'), and technology ('Google Gemini AI'), distinguishing it from the sibling tool 'generate_image' which likely creates new images. However, it doesn't explicitly contrast with the sibling beyond implied differences.
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 provides no guidance on when to use this tool versus alternatives. It mentions the sibling tool 'generate_image' exists but gives no explicit comparison, prerequisites, or exclusions. Usage is implied through the description of modifying existing images, but no clear when/when-not rules are stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
generate_imageA
Create a new image using Google Gemini AI from a text description, optionally providing reference images to guide the result. Use the edit_image tool when you need to modify an existing asset.
| Name | Required | Description | Default |
|---|---|---|---|
| description | Yes | Detailed description of the image to generate. For better social media results, include details about colors, style and composition. | |
| images | No | Optional array of image file paths to use as visual context (absolute or relative). | |
| watermarkPosition | No | Optional watermark position when using `watermarkPath`. | bottom-right |
| aspectRatio | No | Aspect ratio preset (square/landscape/portrait). | square |
| style | No | Additional style for the image (optional). Examples: "minimalist", "colorful", "professional", "artistic" | |
| outputPath | No | Path where to save the image (optional). If not specified, saves in current directory. Can be a folder or complete path with filename. | |
| watermarkPath | No | Path to watermark image file to overlay in a corner (optional) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. While it mentions the tool creates images and can use reference images, it lacks critical behavioral details like whether this is a read/write operation, potential rate limits, authentication requirements, error handling, or what the output looks like (e.g., file path, image data). For a generative AI tool with no annotation coverage, this is a significant gap.
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 is perfectly concise with only two sentences that each earn their place. The first sentence states the core purpose and key optional feature, while the second provides crucial sibling tool differentiation. There's zero wasted text and it's front-loaded with the most important information.
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?
Given the tool's complexity (generative AI with 7 parameters) and lack of both annotations and output schema, the description is incomplete. While it covers purpose and sibling differentiation well, it doesn't address behavioral aspects, output format, or error conditions that would be important for an AI agent to use this tool effectively. The 100% schema coverage helps but doesn't compensate for missing behavioral context.
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%, so the schema already documents all 7 parameters thoroughly. The description adds minimal value beyond the schema by mentioning 'optionally providing reference images' (implied by the images parameter) and the sibling tool reference. It doesn't provide additional parameter semantics beyond what's already in the structured schema.
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 states the tool's purpose with specific verbs ('Create a new image') and resources ('using Google Gemini AI from a text description'), and distinguishes it from its sibling tool ('Use the `edit_image` tool when you need to modify an existing asset'). This provides immediate clarity about what this tool does versus alternatives.
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 explicitly provides usage guidance by stating when to use this tool ('Create a new image') versus when to use the alternative ('Use the `edit_image` tool when you need to modify an existing asset'). This gives clear context for tool selection without ambiguity.
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. Dates show when Glama detected each change.
2 tool updates
- First observed
edit_image - First observed
generate_image
TDQS
The two tools have clearly distinct purposes: generate_image creates new images from text descriptions, while edit_image modifies existing images based on text instructions. The descriptions explicitly differentiate them and even cross-reference when to use each, eliminating any potential confusion.
Both tools follow a consistent verb_noun pattern (generate_image, edit_image) with clear action verbs that accurately describe their functions. The naming is perfectly uniform and predictable across the tool set.
With only 2 tools, this server feels somewhat thin for an image generation/editing domain. While the tools cover the core operations, additional functionality like image analysis, format conversion, or batch processing might be expected but are absent, making the scope borderline minimal.
For a basic image AI server, the tools cover the essential create and modify operations well. However, there are minor gaps such as no direct image analysis or metadata tools, and the reliance on external paths for images might limit some workflows, though agents can generally work around these limitations.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Generate logos, social posts, app screenshots, comic panels & visual-novel assets from prompts.
AI image generation across 5 quality tiers (SDXL to Gemini 3 Pro), 50 free credits on signup.
Generate AI videos, images, audio and staged AI Video Story episodes, and publish them to social.
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.4203MIT
- FlicenseAqualityDmaintenanceEnables text-to-image generation, image editing, and multi-image composition using Google's Gemini 2.5 Flash Image API. Supports flexible aspect ratios and character consistency across generations.1-
- AlicenseNot gradedqualityBmaintenanceGenerates images from text prompts using Google's Gemini AI models with customizable aspect ratios and resolutions up to 4K, automatically saving images locally.432MIT
- AlicenseNot gradedqualityDmaintenanceEnables generating, editing, and manipulating images using Google Gemini Flash 2.5 through natural language prompts. Supports text-to-image generation, image editing, multi-image composition, and batch processing with direct file management.1044MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/antoniolg/gemini-image-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server