Gemini Gen MCP
Allows generating images from text descriptions and audio/speech from text using Google's Gemini AI models.
Click on "Deploy 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 Gen MCP generate an image of a sunset over a mountain lake"
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 Gen MCP
MCP Server for Gemini Image and Audio generation using Google's Gemini AI models.
Features
This MCP server provides tools to:
Generate images from text using Gemini's Flash Image model
Generate audio from text using Gemini 2.5 Flash Preview TTS model
Related MCP server: media-mcp
Installation
From PyPI
pip install gemini-gen-mcpFrom Source
git clone https://github.com/ServiceStack/gemini-gen-mcp.git
cd gemini-gen-mcp
pip install -e .Prerequisites
You need a Google Gemini API key to use this server. Get one from Google AI Studio.
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your Google Gemini API key |
| No |
| Directory where generated files are saved |
Set the environment variables:
export GEMINI_API_KEY='your-api-key-here'
export GEMINI_DOWNLOAD_PATH='/path/to/downloads' # optionalGenerated files are organized by type and date:
Images:
$GEMINI_DOWNLOAD_PATH/images/YYYY-MM-DD/Audio:
$GEMINI_DOWNLOAD_PATH/audios/YYYY-MM-DD/
Each generated file includes a companion .info.json file with generation metadata.
Usage
Running the Server
Run the MCP server directly:
gemini-gen-mcpOr as a Python module:
python -m gemini_gen_mcp.serverUsing with Claude Desktop
See CLAUDE_CONFIG.md for detailed instructions.
Add this to your or claude_desktop_config.json:
{
"mcpServers": {
"gemini-gen": {
"description": "Gemini Image and Audio TTS generation",
"command": "uvx",
"args": [
"gemini-gen-mcp"
],
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}Using in llms .py
Or paste server configuration into llms .py MCP Servers:
Name: gemini-gen
{
"description": "Gemini Image and Audio TTS generation",
"command": "uvx",
"args": [
"gemini-gen-mcp"
],
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}Development Server
For development, you can run this server using uv:
{
"mcpServers": {
{
"command": "uv",
"args": [
"run",
"--directory",
"/path/to/ServiceStack/gemini-gen-mcp",
"gemini-gen-mcp"
],
"env": {
"GEMINI_API_KEY": "$GEMINI_API_KEY"
}
}
}
}Available Tools
text_to_image
Generate images from text descriptions using Gemini's image generation models.
Parameters:
prompt(string, required): Text description of the image to generatemodel(string, optional): Gemini model to usegemini-2.5-flash-image(default)gemini-3-pro-image-preview
aspect_ratio(string, optional): Aspect ratio for the generated image (default: "1:1")Supported:
1:1,2:3,3:2,3:4,4:3,4:5,5:4,9:16,16:9,21:9
temperature(float, optional): Sampling temperature for image generation (default: 1.0)top_p(float, optional): Nucleus sampling parameter (optional)
Example:
{
"prompt": "A serene mountain landscape at sunset with a lake",
"model": "gemini-2.5-flash-image",
"aspect_ratio": "16:9",
"temperature": 1.0
}text_to_audio
Generate audio/speech from text using Gemini's TTS models. Output is saved as WAV format.
Parameters:
text(string, required): Text to convert to speechmodel(string, optional): Gemini TTS model to usegemini-2.5-flash-preview-tts(default)gemini-2.5-pro-preview-tts
voice(string, optional): Voice to use for speech generation (default: "Kore")
Available Voices:
Voice | Style | Voice | Style | Voice | Style |
Zephyr | Bright | Puck | Upbeat | Charon | Informative |
Kore | Firm | Fenrir | Excitable | Leda | Youthful |
Orus | Firm | Aoede | Breezy | Callirrhoe | Easy-going |
Autonoe | Bright | Enceladus | Breathy | Iapetus | Clear |
Umbriel | Easy-going | Algieba | Smooth | Despina | Smooth |
Erinome | Clear | Algenib | Gravelly | Rasalgethi | Informative |
Laomedeia | Upbeat | Achernar | Soft | Alnilam | Firm |
Schedar | Even | Gacrux | Mature | Pulcherrima | Forward |
Achird | Friendly | Zubenelgenubi | Casual | Vindemiatrix | Gentle |
Sadachbia | Lively | Sadaltager | Knowledgeable | Sulafat | Warm |
Example:
{
"text": "Hello, this is a test of the Gemini text to speech system.",
"model": "gemini-2.5-flash-preview-tts",
"voice": "Kore"
}Development
Setup Development Environment
# Clone the repository
git clone https://github.com/ServiceStack/gemini-gen-mcp.git
cd gemini-gen-mcp
# Install in editable mode with dependencies
pip install -e .Running Tests
# Install test dependencies
pip install pytest pytest-asyncio
# Run tests
```bash
# uv run pytest tests -v
npm testLicense
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Support
For issues and questions, please use the GitHub Issues page.
Acknowledgments
Built with FastMCP
Powered by Google Gemini AI
Links
Available Tools
2 toolstext_to_imageB
Generate images from text using Gemini's Flash (Nano Banana) Image models.
Inputs: prompt (required), model, aspect_ratio, temperature, +1 more.
text_to_speechC
Generate speech audio from text using Gemini Flash TTS model.
Inputs: text (required), model, voice.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools, text_to_image and text_to_speech, have completely distinct purposes: one generates images, the other generates speech. There is no overlap or ambiguity between them.
Both tools follow a consistent verb_noun pattern: text_to_<output>. The naming is clear and predictable.
With only 2 tools, the server feels thin for a generation-focused service. While the tools are well-defined, the count is borderline low for the implied scope.
The server covers image and audio generation but misses obvious modalities like text and video. For a 'Gen' server, significant gaps exist that limit its usefulness.
Maintenance
Related MCP Connectors
MCP server for Google Veo AI video generation
MCP server for Qwen Image 3 AI image generation
MCP server for Flux AI image generation
MCP server for Grok Imagine AI video generation
Related MCP Servers
- AlicenseBqualityDmaintenanceAn MCP server for image generation using the Gemini API.1160 npm2MIT
- AlicenseAqualityDmaintenanceAn MCP server for AI-powered media generation using Google Gemini, enabling creation of images, videos, music, and speech directly from AI agents.4MIT
- AlicenseBqualityBmaintenanceAn MCP server for AI-powered image generation, editing, analysis, and transformation using Google's Gemini and Imagen 4 models.19144 PyPI2AGPL 3.0
- AlicenseAqualityDmaintenanceMCP server for AI image generation and editing using Google Gemini image models.71,729 npmMIT