An MCP server for image generation using the Gemini API.
Gemini image mcp server connects Gemini Image to AI assistants that speak the Model Context Protocol. An MCP server for image generation using the Gemini API.
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.
Once connected, the assistant can call these 13 tools directly:
prompt — (string, required) Text prompt for image generation. If input images are provided, include instructions on how to incorporate them into the generated imageoutput_directory — (string, optional) Directory path where the generated image will be savedfile_name — (string, optional) Name of the saved image file (without extension)input_image_paths — (string[], optional) List of file paths for input reference imagesuse_enhanced_prompt — (boolean, optional) Whether to use enhanced prompts to assist AI instructionstarget_image_max_size — (number, optional) Maximum size (in pixels) for the longer edge after resizing. The aspect ratio is preservedforce_conversion_type — (string, optional) Optionally force conversion to a specific format ('jpeg', 'webp', 'png'). If not specified, the original format will be processedskip_compression_and_resizing — (boolean, optional) Whether to skip compression and resizing of generated images. If true, force_conversion_type and target_image_max_size will be ignoredjpeg_quality — (number, optional) JPEG quality (0-100). Lower values result in higher compressionwebp_quality — (number, optional) WebP quality (0-100). Lower values result in higher compressionpng_compression_level — (number, optional) PNG compression level (0-9). Higher values result in higher compressionoptipng_optimization_level — (number, optional) OptiPNG optimization level (0-7). Higher values result in higher compressionOutput — On success, the server returns the save path of the generated image and a message detailing the process, including the original and compressed file sizesSetup follows the standard MCP pattern: clone or install the server, then register it in your client's configuration file and restart the client. The configuration snippets on this page cover Claude Desktop, Claude Code and Cursor.
Before the server will start you need to supply 2 environment variables: GEMINI_API_KEY, YOUR_GEMINI_API_KEY. Keep credentials in your client's env block or a secrets manager rather than committing them.
AI-service servers chain other models into your assistant, turning a single chat into a small production pipeline. Gemini Image sits in that group, and the shape of its toolset — prompt, output_directory, file_name among others — tells you what it is really for. Worth comparing against the other ai services servers in this directory before you commit to one, since several overlap in scope but differ sharply in setup cost and permissions.
| Tool | What it does |
|---|---|
| prompt | (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. |
| output_directory | (string, optional) Directory path where the generated image will be saved. |
| file_name | (string, optional) Name of the saved image file (without extension). |
| input_image_paths | (string\[], optional) List of file paths for input reference images. |
| use_enhanced_prompt | (boolean, optional) Whether to use enhanced prompts to assist AI instructions. |
| target_image_max_size | (number, optional) Maximum size (in pixels) for the longer edge after resizing. The aspect ratio is preserved. |
| force_conversion_type | (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. |
| skip_compression_and_resizing | (boolean, optional) Whether to skip compression and resizing of generated images. If true, force_conversion_type and target_image_max_size will be ignored. |
| jpeg_quality | (number, optional) JPEG quality (0-100). Lower values result in higher compression. |
| webp_quality | (number, optional) WebP quality (0-100). Lower values result in higher compression. |
| png_compression_level | (number, optional) PNG compression level (0-9). Higher values result in higher compression. |
| optipng_optimization_level | (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: |
{
"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
}
}
}Configuration as documented by the project. Restart the client after saving.
| Variable | Description | Required |
|---|---|---|
| GEMINI_API_KEY | Credential the server authenticates with. | Yes |
| YOUR_GEMINI_API_KEY | Credential the server authenticates with. | Yes |
Build a programmable telecommunications stack for connecting telephony services with the Internet via a cloud-based utility.
Search built for AI, not humans — semantic web search that returns model-ready content, plus code context.
Answers, not links — delegate questions to Perplexity's search-grounded models and get cited responses back.
Give your assistant a voice — text-to-speech, voice cloning and audio tools from the ElevenLabs API.
Give your assistant a real code sandbox — isolated cloud VMs for actually running the code it writes.
The ML hub in your context window — search models, datasets, papers and run Spaces from the official server.