Skip to main content
Glama
Gemini MCP Server

Gemini MCP Server

by jon-the-dev

Gemini MCP Server

npm version License: MIT TypeScript MCP Version

A powerful MCP (Model Context Protocol) server that brings Google's latest Gemini AI models to your favorite development environment. Access Gemini 2.5's thinking capabilities, vision analysis, embeddings, and more through a seamless integration.

🚀 Works with: Claude Desktop, Cursor, Windsurf, and any MCP-compatible client
🎯 Why use this: Get Gemini's cutting-edge AI features directly in your IDE with full parameter control
📚 Self-documenting: Built-in help system means you never need to leave your editor

Features

  • 6 Powerful Tools: Text generation, image analysis, token counting, model listing, embeddings, and self-documenting help

  • Latest Gemini Models: Support for Gemini 2.5 series with thinking capabilities

  • Advanced Features: JSON mode, Google Search grounding, system instructions, conversation memory

  • Full MCP Protocol: Standard stdio communication for seamless integration with any MCP client

  • Self-Documenting: Built-in help system - no external docs needed

  • TypeScript & ESM: Modern, type-safe implementation

Supported Models

Model

Context

Features

Best For

gemini-2.5-pro

2M tokens

Thinking, JSON, Grounding

Complex reasoning

gemini-2.5-flash ⭐

1M tokens

Thinking, JSON, Grounding

General use

gemini-2.5-flash-lite

1M tokens

Thinking, JSON

Fast responses

gemini-2.0-flash

1M tokens

JSON, Grounding

Standard tasks

gemini-1.5-pro

2M tokens

JSON

Legacy support

Related MCP server: Gemini Thinking MCP Server

Quick Start

  1. Get Gemini API Key

    • Visit Google AI Studio

    • Create a new API key

    • IMPORTANT: Keep your API key secure and never commit it to version control

  2. Configure Your MCP Client

    Config location:

    • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • Linux: ~/.config/Claude/claude_desktop_config.json

    {
      "mcpServers": {
        "gemini": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "github:jon-the-dev/gemini-mcp-server"],
          "env": {
            "GEMINI_API_KEY": "your_api_key_here"
          }
        }
      }
    }

    Add to Cursor's MCP settings:

    {
      "gemini": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "github:jon-the-dev/gemini-mcp-server"],
        "env": {
          "GEMINI_API_KEY": "your_api_key_here"
        }
      }
    }

    Configure in Windsurf's MCP settings following their documentation.

    Use the standard MCP stdio configuration:

    {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "github:jon-the-dev/gemini-mcp-server"],
      "env": {
        "GEMINI_API_KEY": "your_api_key_here"
      }
    }
  3. Restart Your MCP Client

How to Use

Once configured, you can use natural language in your MCP client to access Gemini's capabilities:

Basic Commands

"Use Gemini to explain quantum computing"
"Analyze this image with Gemini" 
"List all Gemini models"
"Get help on using Gemini"

Advanced Examples

"Use Gemini 2.5 Pro with temperature 0.3 to review this code"
"Use Gemini in JSON mode to extract key points with schema {title, summary, tags}"
"Use Gemini with grounding to research the latest in quantum computing"

📖 See the complete Usage Guide for detailed examples and advanced features.

Why Gemini MCP Server?

  • Access Latest Models: Use Gemini 2.5 with thinking capabilities - Google's most advanced models

  • Full Feature Set: All Gemini API features including JSON mode, grounding, and system instructions

  • Easy Setup: One-line npx installation, no complex configuration needed

  • Production Ready: Comprehensive error handling, TypeScript types, and extensive documentation

  • Active Development: Regular updates with new Gemini features as they're released

Documentation

Local Development

# Clone repository
git clone https://github.com/jon-the-dev/gemini-mcp-server.git
cd mcp-server-gemini

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env and add your GEMINI_API_KEY

# Start development server
npm run dev

Contributing

Contributions are welcome! Please see our Contributing Guide.

Common Issues

  1. Connection Issues

    • Ensure your MCP client is properly restarted

    • Check the client's logs (e.g., ~/Library/Logs/Claude/mcp-server-gemini.log for Claude Desktop on Mac)

    • Verify internet connection

    • See Troubleshooting Guide

  2. API Key Problems

    • Verify API key is correct

    • Check API key has proper permissions

    • Ensure the key is set in the environment variable

    • See Setup Guide

Security

  • API keys are handled via environment variables only

  • Never commit API keys to version control

  • The .claude/ directory is excluded from git

  • No sensitive data is logged or stored

  • Regular security updates

  • If your API key is exposed, regenerate it immediately in Google Cloud Console

License

MIT

Available Tools

6 tools
analyze_imageC

Analyze images using Gemini vision capabilities

Inputs: prompt (required), model, imageUrl, imageBase64.

count_tokensC

Count tokens for a given text with a specific model

Inputs: text (required), model.

embed_textC

Generate embeddings for text using Gemini embedding models

Inputs: text (required), model.

generate_textC

Generate text using Google Gemini with advanced features

Inputs: prompt (required), topK, topP, model, +8 more.

get_helpC

Get help and usage information for the Gemini MCP server

Inputs: topic.

list_modelsB

List all available Gemini models and their capabilities

Inputs: filter.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct capability: text generation, image analysis, token counting, model listing, embeddings, and help. There is no meaningful overlap between generate_text and analyze_image since they operate on different modalities, and embed_text is clearly separate from generation.

    Naming Consistency5/5

    All six tools follow a strict verb_noun snake_case pattern (generate_text, analyze_image, count_tokens, list_models, embed_text, get_help). The convention is predictable and readable across the whole set.

    Tool Count5/5

    Six tools is a well-scoped surface for a Gemini API wrapper, covering the core capabilities without bloat. Each tool corresponds to a real, non-redundant operation an agent would want.

    Completeness4/5

    The set covers text generation, vision, embeddings, token counting, and model discovery, which are the primary Gemini workflows. Minor gaps exist for multi-turn chat sessions, non-image media (audio/video/file uploads), and image generation, but agents can work around these via generate_text.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      A Model Context Protocol (MCP) server implementation for the Google Gemini language model. This server allows Claude Desktop users to access the powerful reasoning capabilities of Gemini-2.0-flash-thinking-exp-01-21 model.
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A Model Context Protocol server that enables Claude Desktop and other MCP-compatible clients to leverage Google's Gemini AI models with features like thinking models, Google Search grounding, JSON mode, and vision support.
      6
      75 npm
      14
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that wraps the Gemini CLI to provide tools for executing prompts, managing chat sessions, and accessing CLI extensions. It supports both local stdio and remote SSE transports for flexible integration with MCP clients.
      1
      -