- Home
- MCP servers
- Gemini Image Generator
Gemini Image Generator
- python
29
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
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.
How to use
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.
How to install
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.
Configuration and runtime setup
{
"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"
}
}
}
}
Usage notes and features
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.
Security and troubleshooting tips
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.
Examples of prompts
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.
Available tools
generate_image_from_text
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.
transform_image_from_encoded
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.
transform_image_from_file
Transforms an existing image from a local file path using a text prompt and returns the transformed image data with the saved file path.