Skip to main content
Glama

Gemini Gen MCP

PyPI version License: MIT

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-mcp

From 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

GEMINI_API_KEY

Yes

-

Your Google Gemini API key

GEMINI_DOWNLOAD_PATH

No

/tmp/gemini_gen_mcp

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'  # optional

Generated 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-mcp

Or as a Python module:

python -m gemini_gen_mcp.server

Using 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 generate

  • model (string, optional): Gemini model to use

    • gemini-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 speech

  • model (string, optional): Gemini TTS model to use

    • gemini-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 test

License

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

Available Tools

2 tools
text_to_imageB

Generate images from text using Gemini's Flash (Nano Banana) Image models.

ParametersJSON Schema
NameRequiredDescriptionDefault
promptYesText description of the image to generate
modelNogemini-2.5-flash-image
aspect_ratioNo1:1
temperatureNoSampling temperature for image generation (default: 1.0)
top_pNoNucleus sampling parameter for image generation (optional)

TDQS

B3.2/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description must carry the full burden of behavioral disclosure. It only states that images are generated, but fails to mention whether generation is synchronous, any auth requirements, cost implications, or rate limits. This is minimal for a generative tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no wasted words. It is efficient but could be slightly expanded without losing conciseness to improve completeness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 5 parameters, no output schema, no annotations, and one sibling, the description is insufficient. It omits return format, model differences, prompt best practices, and potential error states, leaving agents underinformed for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description does not add any meaning to the parameters beyond what is already in the input schema. With 60% schema coverage, it misses the opportunity to clarify parameter usage, defaults, or relationships.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the verb 'generate', resource 'images', input 'text', and specifies the model 'Gemini's Flash (Nano Banana) Image models', clearly distinguishing it from the sibling tool 'text_to_speech' which generates speech.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance is provided. While the purpose is distinct from the only sibling, the description does not offer any context on ideal scenarios or limitations, leaving usage entirely implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

text_to_speechC

Generate speech audio from text using Gemini Flash TTS model.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesText to convert to speech
modelNogemini-2.5-flash-preview-tts
voiceNoKore

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so the description carries full burden. It does not disclose behavioral traits such as output format, file type, response structure, length limits, or latency. Critical gaps for a TTS tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single 9-word sentence, highly concise. However, it may be too brief to be fully informative, but it is not verbose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Missing crucial context for a TTS tool: no mention of output type (audio file, stream), whether language is supported, or any constraints. The description is insufficient for an agent to know what to expect.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 33%, and the tool description adds minimal parameter meaning. It does not explain the model or voice choices beyond defaults, nor does it compensate for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it generates speech audio from text, distinguishing it from sibling tool text_to_image. However, it mentions only 'Gemini Flash TTS model' while the schema includes both Flash and Pro options, slightly limiting accuracy.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance on when to use this tool versus alternatives. The description does not mention any prerequisites, use cases, or conditions, leaving the agent without context for selection.

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. 2 tool updatesv0.0.4
    • First observedtext_to_image
    • First observedtext_to_speech

TDQS

B3.2/5.0
Disambiguation5/5

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.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern: text_to_<output>. The naming is clear and predictable.

Tool Count3/5

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.

Completeness2/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

Latest Blog Posts

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/ServiceStack/gemini-gen-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server