home / mcp / gemini image generator mcp server
MCP server for AI image generation and editing using Google's Gemini Flash models. Create images from text prompts with intelligent filename generation and strict text exclusion. Supports text-to-image generation with future expansion to image editing capabilities.
Configuration
View docs{
"mcpServers": {
"qhdrl12-mcp-server-gemini-image-generator": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-server-gemini-image-generator",
"run",
"mcp-server-gemini-image-generator"
],
"env": {
"GEMINI_API_KEY": "YOUR_API_KEY",
"OUTPUT_IMAGE_PATH": "/absolute/path/to/your/images/directory"
}
}
}
}This Gemini Image Generator MCP Server lets any MCP-enabled assistant create high-quality images from text prompts using Google's Gemini model. It handles prompt processing, image generation, intelligent filename creation, and local storage, so you can generate, transform, and manage images entirely through MCP clients.
You interact with the Gemini Image Generator MCP Server through any MCP client. Give prompts to create new images or provide an existing image to transform. Results come back as either raw image data or a saved file path, so you can directly use the image bytes in workflows or reference the stored image file.
Generating new images uses a text prompt description. For example, you can request a photorealistic sunset over mountains or a futuristic cityscape. Transformations apply a new prompt to an existing image, either supplied as a file or as base64-encoded data. You can add effects like snow, change lighting, or insert new subjects into a scene.
Prerequisites you need before installing: Python 3.11 or newer, a Gemini API key, and a host MCP client (such as Claude Desktop App or any MCP-compatible client). You will also need an environment to run the MCP server (local machine or server).
Choose one of the installation methods described here. The recommended approach for Claude Desktop users is to run the MCP server locally via UV and point Claude Desktop at it. A direct installation via Smithery is also available.
{
"mcpServers": {
"gemini_image_gen": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-server-gemini-image-generator",
"run",
"mcp-server-gemini-image-generator"
],
"env": {
"GEMINI_API_KEY": "your-actual-gemini-api-key-here",
"OUTPUT_IMAGE_PATH": "/absolute/path/to/your/images/directory"
}
}
}
}The server supports text-to-image generation, image-to-image transformations based on prompts, and both file-based and base64-encoded image inputs. It automatically translates non-English prompts and stores generated images locally at a configurable output path. Filenames are generated intelligently from prompts, and there is strict control to keep generated content free of unintended text.
Keep your Gemini API key secure and do not commit it to code. If you encounter issues with path resolution in a specific MCP client, try using the file-based transformation method or ensure the client can correctly handle returned file paths.
Generate a sunset over mountains, a futuristic cityscape, or a cat wearing sunglasses. Transform an existing image by adding snow, changing the scene to night, or inserting a new character into the composition.
Creates a new image from a text prompt and returns the raw image data as bytes along with the path to the saved image file.
Transforms an existing image provided as a base64-encoded string using a text prompt and returns the transformed image data with the saved file path.
Transforms an existing image from a local file path using a text prompt and returns the transformed image data with the saved file path.