gemini-image-mcp
Enables AI-powered image generation using Google's Gemini API, supporting text prompts and optional reference images with automatic compression and file management
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-mcpgenerate a futuristic cityscape with flying cars at sunset"
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
This is an MCP (Model Context Protocol) server that uses Google's Gemini API to generate images and save them to a specified directory. In addition to text prompts, you can optionally provide input images to guide the image generation process. Generated images are automatically compressed to reduce file size.
Features
Image generation from text prompts
(Optional) Image generation using input reference images
Automatic compression of generated images (JPEG, PNG)
Unique file name assignment to prevent file name conflicts
Operates as an MCP server, accepting tool calls via standard input/output
Related MCP server: gemini-image-mcp
Prerequisites
Node.js (v18 or higher recommended)
Google Cloud Project with Gemini API enabled
Gemini API Key
Setup
Example MCP server configuration for Roo Code
{
"mcpServers": {
"gemini-image-mcp-server": {
"command": "npx",
"args": [
"-y",
"@creating-cat/gemini-image-mcp-server"
],
"env": {
"GEMINI_API_KEY": "YOUR_GEMINI_API_KEY"
},
"disabled": false,
"timeout": 300
}
}
}Replace
YOUR_GEMINI_API_KEYwith your actual Gemini API Key.You can also use
${env:GEMINI_API_KEY}to retrieve the key from environment variables (Roo Code feature).
Tool: generate_image
This MCP server provides a tool named generate_image.
Input Parameters
Parameter Name | Description | Default Value |
| (string, required) Text prompt for image generation. If input images are provided, include instructions on how to incorporate them into the generated image. English is recommended. | None |
| (string, optional) Directory path where the generated image will be saved. |
|
| (string, optional) Name of the saved image file (without extension). |
|
| (string[], optional) List of file paths for input reference images. |
|
| (boolean, optional) Whether to use enhanced prompts to assist AI instructions. |
|
| (number, optional) Maximum size (in pixels) for the longer edge after resizing. The aspect ratio is preserved. |
|
| (string, optional) Optionally force conversion to a specific format ('jpeg', 'webp', 'png'). If not specified, the original format will be processed, defaulting to PNG for non-JPEG images. | None |
| (boolean, optional) Whether to skip compression and resizing of generated images. If |
|
| (number, optional) JPEG quality (0-100). Lower values result in higher compression. |
|
| (number, optional) WebP quality (0-100). Lower values result in higher compression. |
|
| (number, optional) PNG compression level (0-9). Higher values result in higher compression. |
|
| (number, optional) OptiPNG optimization level (0-7). Higher values result in higher compression. |
|
Output
On success, the server returns the save path of the generated image and a message detailing the process, including the original and compressed file sizes. Example:
{
"content": [
{
"type": "text",
"text": "Image successfully generated and compressed at output/images/my_cat.jpg.\nOriginal size: 1024.12KB, Final size: 150.45KB"
}
]
}If an error occurs, an error message will be returned.
Notes
The MIME type and aspect ratio of the generated images depend on the default settings of the Gemini API.
Handle your API key with care.
This server uses the model
gemini-2.0-flash-preview-image-generation. Google may discontinue this model in the future.
License
MIT
Available Tools
1 toolgenerate_imageC
Generates an image based on a prompt and saves it to the specified path.
| Name | Required | Description | Default |
|---|---|---|---|
| file_name | No | The name of the image file to be saved (without extension). Defaults to 'generated_image'. | generated_image |
| force_conversion_type | No | Optionally force conversion to a specific format ('jpeg', 'webp', 'png'). If not specified, the original format will be processed, defaulting to PNG for non-JPEG images. | |
| input_image_paths | No | Optional. A list of file paths for input images to be used as a reference for generation. | |
| jpeg_quality | No | JPEG quality (0-100). Lower values result in higher compression. Defaults to 80. | |
| optipng_optimization_level | No | OptiPNG optimization level (0-7). Higher values result in higher compression. Defaults to 2. | |
| output_directory | No | The directory path to save the image. Defaults to 'output/images'. | output/images |
| png_compression_level | No | PNG compression level (0-9). Higher values result in higher compression. Defaults to 9. | |
| prompt | Yes | Text prompt for image generation. If input images are provided, include instructions on how to use them to create the new image. English is recommended. | |
| skip_compression_and_resizing | No | Whether to skip compression and resizing of the generated image. If true, `force_conversion_type` and `target_image_max_size` are ignored. Defaults to false. | |
| target_image_max_size | No | The maximum length (in pixels) of the longest side of the resized image. The original aspect ratio is maintained. Defaults to 512. | |
| use_enhanced_prompt | No | Whether to use an enhanced prompt to assist the AI's instructions. Defaults to true. | |
| webp_quality | No | WebP quality (0-100). Lower values result in higher compression. Defaults to 80. |
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 mentions saving the image but omits critical details like potential side effects (e.g., file overwriting), performance considerations (e.g., generation time, resource usage), error handling, or output specifics. For a complex tool with 12 parameters, this lack of behavioral context 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 a single, efficient sentence that directly states the tool's core function without unnecessary words. It is front-loaded with the essential action, making it highly concise and well-structured for quick understanding.
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 (12 parameters, no output schema, and no annotations), the description is inadequate. It fails to explain behavioral traits, output details, or usage context, leaving the agent with insufficient information to effectively invoke the tool beyond basic parameter filling.
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?
The schema description coverage is 100%, meaning all parameters are well-documented in the schema itself. The description adds no additional parameter semantics beyond implying a 'prompt' and 'path' are involved, which is already covered. Thus, it meets the baseline of 3 where the schema does the heavy lifting without adding extra value.
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: 'Generates an image based on a prompt and saves it to the specified path.' It specifies the verb ('generates'), resource ('image'), and destination ('saves it to the specified path'), making the action explicit. However, it doesn't differentiate from siblings since there are none, so it cannot achieve a perfect score of 5.
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, prerequisites, or contextual constraints. It merely states what the tool does without indicating scenarios for its application, leaving the agent without usage direction.
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.
1 tool update
v1.0.0- First observed
generate_image
TDQS
With only one tool, there is no possibility of confusion or overlap between tools. The tool 'generate_image' has a clearly distinct and singular purpose, making it impossible for an agent to misselect between non-existent alternatives.
The single tool name 'generate_image' follows a clear verb_noun pattern (generate + image), and with only one tool, there is no inconsistency or deviation to evaluate. The naming is straightforward and predictable.
A single tool is too few for most server purposes, as it limits functionality and flexibility. For an image generation server, one tool feels thin and under-scoped, lacking operations like editing, listing, or deleting images, which could hinder agent workflows.
The tool surface is severely incomplete for an image generation domain. While 'generate_image' covers creation, there are obvious gaps such as no ability to retrieve, update, delete, or manage generated images, leading to potential dead ends in agent tasks.
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
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for Grok Imagine AI video generation
MCP server for NanoBanana AI image generation and editing
Related MCP Servers
- AlicenseBqualityCmaintenanceMCP server for generating images and audio using Google's Gemini AI models.22MIT
- FlicenseAqualityDmaintenanceMCP server that generates images using Gemini models via an OpenAI-compatible gateway.19-
- AlicenseAqualityDmaintenanceMCP server for Google Gemini image generation with configurable model support, enabling text-to-image generation, image editing, and iterative refinement.641MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides image generation capabilities using Google's Gemini 2.5 Flash Image Preview model.22MIT
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/creating-cat/gemini-image-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server