Skip to main content
Glama
Gemini MCP Server

Gemini MCP Server

by riotofgeese

Gemini MCP Server

An MCP (Model Context Protocol) server that provides access to Google's Gemini API. Drop-in alternative to Codex MCP with matching interface.

Features

  • gemini - Start a new Gemini conversation with configurable context

  • gemini-reply - Continue multi-turn conversations

  • gemini-image - Generate images using Nano Banana (Gemini's native image generation)

  • gemini-video-generate - Start video generation with Veo 3.1

  • gemini-video-check - Check video generation status and retrieve completed videos

Related MCP server: NanoBanana MCP

Installation

npm install
npm run build

Configuration

Create a .env file or set environment variables:

# Required: Your Google Gemini API key
GEMINI_API_KEY=your_api_key_here

# Optional: Override the model (default: gemini-3-pro-preview)
GEMINI_MODEL=gemini-3-pro-preview

Get your API key from Google AI Studio.

Usage with Claude Code

Add to your MCP settings (~/.claude/mcp.json):

{
  "mcpServers": {
    "gemini": {
      "command": "node",
      "args": ["/path/to/gemini-mcp/dist/index.js"],
      "env": {
        "GEMINI_API_KEY": "your_api_key_here"
      }
    }
  }
}

Tools

gemini

Start a new conversation with Gemini.

Parameters:

  • prompt (required) - The initial prompt

  • cwd - Working directory context

  • sandbox - Access policy: "read-only", "workspace-write", or "danger-full-access"

  • base-instructions - Override default system instructions

  • developer-instructions - Additional context for the model

Returns: Response text and a conversationId for follow-up.

gemini-reply

Continue an existing conversation.

Parameters:

  • conversationId (required) - ID from a previous gemini call

  • prompt (required) - Your follow-up message

gemini-image

Generate images using Nano Banana, Google's native image generation built into Gemini.

Models:

  • Nano Banana (gemini-2.5-flash-image) - Fast, cost-effective (~$0.04/image), good for most use cases

  • Nano Banana Pro (gemini-3-pro-image-preview) - Advanced model with better text rendering, ideal for infographics, diagrams, and text-heavy images

Auto-Detection: The server automatically uses Nano Banana Pro when your prompt contains keywords like:

  • "nano banana pro", "pro model"

  • "infographic", "diagram", "chart", "graph"

  • "text", "typography", "font", "lettering"

  • "logo", "brand", "poster", "flyer", "banner"

  • "slide", "presentation", "document"

  • "high quality", "4k", "detailed text"

Parameters:

  • prompt (required) - Description of the image to generate

  • numberOfImages - How many images (1-4, default: 1)

  • aspectRatio - Image ratio: "1:1", "3:4", "4:3", "9:16", "16:9"

  • usePro - Force Nano Banana Pro (auto-detected from prompt if not specified)

  • outputPath - Directory to save generated images

Example:

// Auto-detects Pro model
"Create an infographic showing the software development lifecycle"

// Explicitly request Pro
{ "prompt": "A sunset over mountains", "usePro": true }

// Fast generation (default)
"A cute cat wearing a hat"

gemini-video-generate

Start video generation using Veo 3.1, Google's advanced video generation model.

Important: Video generation is asynchronous. This tool returns immediately with an operation ID. Use gemini-video-check to poll for completion (typically 30-60 seconds).

Parameters:

  • prompt (required) - Description of the video to generate

  • aspectRatio - Video ratio: "16:9" (default), "9:16"

  • resolution - Video resolution: "480p", "720p" (default)

  • firstFrameBase64 - Optional base64 image to use as first frame (generate with gemini-image first)

Returns: Operation ID for checking status

Example Workflow:

1. gemini-video-generate: "A cat playing with a ball of yarn"
   → Returns: { operationId: "op-123..." }

2. Wait 30-60 seconds

3. gemini-video-check: { operationId: "op-123..." }
   → Returns: { status: "processing", elapsed: "45s" }
   OR
   → Returns: { status: "complete", videoData: "..." }

gemini-video-check

Check the status of a video generation operation and retrieve completed videos.

Parameters:

  • operationId - Operation ID from gemini-video-generate (optional - uses last operation if omitted)

  • outputPath - Directory to save the completed video

Returns:

  • If processing: Status and elapsed time

  • If complete: Video data (base64) and optional saved file path

Tip: You can create a custom first frame using gemini-image, then pass it to gemini-video-generate with firstFrameBase64 for more control over your video.

Development

# Run in development mode
npm run dev

# Build for production
npm run build

# Start production server
npm start

License

MIT

Available Tools

5 tools
geminiB

Run a Gemini session. Similar to Codex but uses Google Gemini 3 Pro Preview.

Supports configuration parameters matching the Codex Config struct:

  • prompt: The initial user prompt to start the conversation (required)

  • cwd: Working directory context

  • sandbox: Access policy ("read-only", "workspace-write", "danger-full-access")

  • base-instructions: Override default system instructions

  • developer-instructions: Additional developer context

  • model: Optional override for model (default: gemini-3-pro-preview)

Inputs: prompt (required), cwd, sandbox, base-instructions, +3 more.

gemini-imageA

Generate images using Nano Banana (Gemini's native image generation).

Two models available:

  • Nano Banana (default): Fast, cheap (~$0.04/image), good for most use cases

  • Nano Banana Pro: Advanced model with better text rendering, infographics, diagrams

Auto-detection: Says "nano banana pro" or mentions text/infographic/diagram/chart/logo/poster in prompt → automatically uses Pro model.

Parameters:

  • prompt: Text description of the image to generate (required)

  • numberOfImages: How many images to generate (1-4, default: 1)

  • aspectRatio: Image aspect ratio ("1:1", "3:4", "4:3", "9:16", "16:9", default: "1:1")

  • usePro: Force Nano Banana Pro (auto-detected from prompt if not specified)

  • outputPath: Optional path to save images

Inputs: prompt (required), numberOfImages, aspectRatio, usePro, +1 more.

gemini-replyA

Continue a Gemini conversation by providing the conversation ID and prompt.

Use this to continue a multi-turn conversation started with the 'gemini' tool.

Inputs: conversationId (required), prompt (required).

gemini-video-checkA

Check the status of a video generation operation.

If the video is still processing, returns the current status. If the video is complete, returns the video data.

Parameters:

  • operationId: The operation ID from gemini-video-generate (optional - uses last operation if not provided)

  • outputPath: Optional path to save the video file when complete

Inputs: operationId, outputPath.

gemini-video-generateA

Generate a video using Veo 3.1 (Google's video generation model).

This starts an async video generation that takes 1-5 minutes. Returns an operation ID that you can use with gemini-video-check to poll for completion.

Parameters:

  • prompt: Text description of the video to generate (required)

  • aspectRatio: Video aspect ratio ("16:9" or "9:16", default: "16:9")

  • resolution: Video resolution ("720p", default: "720p")

  • firstFrameBase64: Optional base64 PNG image to use as first frame (from gemini-image)

Workflow:

  1. Call gemini-video-generate → returns operationId

  2. Wait 30-60 seconds

  3. Call gemini-video-check with operationId → returns status or video

Inputs: prompt (required), aspectRatio, resolution, firstFrameBase64.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 5 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: 'gemini' for text-based conversations, 'gemini-image' for image generation, 'gemini-reply' for continuing conversations, 'gemini-video-generate' for initiating video generation, and 'gemini-video-check' for checking video status. There is no overlap or ambiguity between these functions.

    Naming Consistency4/5

    The naming follows a consistent 'gemini-' prefix pattern for all tools, with descriptive suffixes like 'image', 'reply', 'video-generate', and 'video-check'. The only minor deviation is the first tool named just 'gemini' instead of 'gemini-chat' or similar, but this is a small inconsistency in an otherwise predictable scheme.

    Tool Count5/5

    With 5 tools, this server is well-scoped for interacting with Google Gemini models. It covers core functionalities: text generation, image generation, conversation continuation, and video generation with status checking. Each tool earns its place without being overwhelming or sparse.

    Completeness4/5

    The toolset provides comprehensive coverage for the Gemini domain, including text, image, and video generation with multi-turn conversation support. A minor gap is the lack of a tool for managing or listing past conversations, but the core workflows are fully covered with no dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables interaction with Google Gemini AI models through MCP protocol. Provides text generation capabilities with configurable model selection and temperature settings.
      ISC
    • A
      license
      A
      quality
      D
      maintenance
      MCP server that brings Gemini's image generation and editing capabilities to Claude Desktop, Claude Code, and Cursor. Supports Nano Banana 2 (Flash) and Nano Banana Pro models.
      7
      732 npm
      32
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Integrates Google's Gemini API with MCP-compatible clients for chat, real-time web search, knowledge queries, code/text analysis, and content generation.
      -