trackmcp
Back to directory
aliargun

mcp-server-gemini

View on GitHub

MCP server implementation for Google's Gemini API JavaScript-based implementation.

230 stars JavaScriptDeveloper Kits Updated Nov 1, 2025

Documentation

Gemini MCP Server

smithery badge
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

ModelContextFeaturesBest For
gemini-2.5-pro2M tokensThinking, JSON, GroundingComplex reasoning
gemini-2.5-flash ⭐1M tokensThinking, JSON, GroundingGeneral use
gemini-2.5-flash-lite1M tokensThinking, JSONFast responses
gemini-2.0-flash1M tokensJSON, GroundingStandard tasks
gemini-1.5-pro2M tokensJSONLegacy support

Quick Start

1. Get Gemini API Key

    2. Configure Your MCP Client

    Claude Desktop

    Config location:

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

      Cursor

      Add to Cursor's MCP settings:

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

      Windsurf

      Configure in Windsurf's MCP settings following their documentation.

      Other MCP Clients

      Use the standard MCP stdio configuration:

      json
      {
           "type": "stdio",
           "command": "npx",
           "args": ["-y", "github:aliargun/mcp-server-gemini"],
           "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

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

      Advanced Examples

      code
      "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

      bash
      # Clone repository
      git clone https://github.com/aliargun/mcp-server-gemini.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

        2. API Key Problems

          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

          Frequently asked questions

          What is mcp-server-gemini?

          mcp-server-gemini is MCP server implementation for Google's Gemini API JavaScript-based implementation.

          How do I install mcp-server-gemini?

          Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.

          Is mcp-server-gemini open source?

          Yes — it is hosted on GitHub at https://github.com/aliargun/mcp-server-gemini and has 230 stars.

          Related MCP tools

          Run your own MCP server? See who uses it and what to fix.

          Measure it with TrackMCP