Skip to main content
Glama

What is this?

A local MCP server that wraps the gemini CLI, letting any MCP client (Claude Code, Cursor, etc.) offload expensive tasks to Gemini 2.5 Pro's massive context window.

Use cases:

  • Summarize a 5,000-line file without burning Claude's tokens

  • Analyze an entire codebase directory in one shot

  • Get a second-opinion code review from a different model

  • Process huge logs or data files that exceed comfortable context limits

  • Search the web for up-to-date information via Google Search grounding

  • Review a PR or branch diff automatically without manual copy-paste

Related MCP server: gemini-researcher

MCP Tools

Tool

Description

gemini_query

Send a prompt to Gemini with optional file context

gemini_summarize

Summarize a file or entire directory/codebase

gemini_analyze

Deep analysis of codebase structure, patterns, and issues

gemini_review

Code review with actionable feedback (manual diff/files)

gemini_search

Web search with Google Search grounding — get current info with source citations

gemini_pr_review

Git-aware PR/branch review — auto-fetches diff and commit history

Prerequisites

Quick Start

No cloning needed — just add to your MCP client config:

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}

Run:

claude mcp add gemini -- npx -y @ethantsaitsai/gemini-mcp-server

Or add to your project's .mcp.json:

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}

Add to ~/.gemini/settings.json:

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}

Go to Cursor Settings > MCP > Add new MCP Server, then add:

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}

Add to .vscode/mcp.json in your workspace:

{
  "servers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "gemini": {
      "command": "npx",
      "args": ["-y", "@ethantsaitsai/gemini-mcp-server"]
    }
  }
}
git clone https://github.com/ethan-tsai-tsai/gemini-mcp-server.git
cd gemini-mcp-server
npm install
npm start

Environment Variables

Variable

Default

Description

GEMINI_CLI_PATH

gemini

Path to the gemini binary

GEMINI_MODEL

gemini-2.5-pro

Default Gemini model

GEMINI_TIMEOUT_MS

120000

Timeout per invocation (ms)

How It Works

┌─────────────┐     MCP (stdio)     ┌──────────────┐    child_process    ┌─────────────┐
│  AI Client  │ ◄──────────────────► │  index.js    │ ◄────────────────► │  gemini CLI  │
│ (Claude,    │   gemini_query()     │  (MCP Server)│   spawn/execFile   │  (Google)    │
│  Cursor...) │   gemini_summarize() │              │                    │              │
│             │   gemini_analyze()   │              │                    │              │
│             │   gemini_review()    │              │                    │              │
│             │   gemini_search()    │              │                    │              │
│             │   gemini_pr_review() │              │                    │              │
└─────────────┘                      └──────────────┘                    └─────────────┘

Security

  • No console.log — stdout is reserved for JSON-RPC; all logging uses stderr

  • No shell injection — Uses spawn/execFile instead of exec; all inputs are sanitized

  • Binary files skipped — Automatically detects and skips non-text files

  • Path validation — All file paths are sanitized before use

License

ISC

Available Tools

6 tools
gemini_analyzeA

Perform deep, structured analysis of a codebase or file using Gemini. USE THIS TOOL WHEN: (1) You need to understand the architecture of a large, unfamiliar project. (2) You want to audit code for bugs or security vulnerabilities across many files. (3) You need to map out dependencies or identify design patterns in a codebase. (4) You have a specific analytical question about a codebase that requires reading many files. This tool is MORE STRUCTURED than gemini_summarize — it uses specialized prompts for each analysis type and produces categorized, actionable findings. Automatically filters out node_modules, .git, binary files, and other non-essential content.

Inputs: target_path (required), analysis_type (required), model, max_depth, +1 more.

gemini_pr_reviewA

Review a pull request or branch diff using Gemini. USE THIS TOOL WHEN: (1) You want to review all changes in a PR or feature branch before merging. (2) You need a thorough review of a large diff that would consume too many tokens. (3) You want to compare changes between two branches or commits. This tool automatically fetches the git diff and optionally collects the full content of changed files for deeper context. It differs from gemini_review: this tool is git-aware and fetches diffs automatically, while gemini_review requires you to pass in the diff or file content manually.

Inputs: repo_path (required), base, head, model, +2 more.

gemini_queryA

Send a query to Google Gemini with optional file context. Use this tool when you need to delegate a task that would consume a large amount of tokens — for example: reading and analyzing a very large file (>1000 lines), summarizing lengthy logs, getting a second opinion on complex analysis, or processing content that exceeds your comfortable context window. Gemini has a very large context window (1M+ tokens) and can handle these tasks efficiently. You can attach files as context by providing their absolute paths. Returns Gemini's text response.

Inputs: prompt (required), model, context_files.

gemini_reviewA

Get a code review from Gemini on specific files or a git diff. USE THIS TOOL WHEN: (1) You want a second opinion on code you just wrote or are about to commit. (2) You need to review a large diff that would consume too many tokens to analyze yourself. (3) You want a focused review on a specific aspect like performance, error handling, or readability. (4) You need to review multiple files together to check for cross-file consistency. This tool differs from gemini_analyze: it is designed for reviewing CHANGES (diffs, specific files) rather than analyzing an entire codebase. It provides actionable review comments with severity levels.

Inputs: diff, model, file_paths, review_focus.

gemini_summarizeA

Summarize a file or an entire directory/codebase using Gemini's large context window. USE THIS TOOL WHEN: (1) You need a quick overview of a large file (>500 lines) without reading it yourself. (2) You need to understand the structure and purpose of an unfamiliar codebase or directory. (3) You want to summarize lengthy logs, documentation, or data files. For directories, this tool automatically traverses the file tree, skipping node_modules, .git, binary files, and other non-essential content. It respects a ~4MB total content limit to stay within Gemini's context window. Returns a structured summary from Gemini.

Inputs: target_path (required), focus, model, max_depth.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool has a distinct intent: query (arbitrary delegation), summarize (overview), analyze (structured deep analysis), review (manual diffs/files), pr_review (git-aware diff fetching), and search (web grounding). The boundaries between summarize/analyze/review are explicitly explained in the descriptions, though gemini_query is a generic catch-all that could plausibly be used where the specialized tools are intended.

    Naming Consistency5/5

    All six tools follow a strict gemini_<verb> pattern (query, summarize, analyze, review, search, pr_review). The convention is predictable and the names read cleanly.

    Tool Count5/5

    Six tools is well-scoped for a Gemini delegation wrapper, with each tool covering a distinct workflow (query, summarize, analyze, review, search, PR review). No filler tools appear.

    Completeness4/5

    The surface covers the main use cases of offloading large-context work: arbitrary queries, file/directory summarization, structured analysis, code review, git-aware PR review, and web search. Minor gaps exist, such as no dedicated diff-between-commits reporting beyond pr_review or a batch multi-file review tool, but the catch-all gemini_query lets agents work around these.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables comprehensive codebase analysis using Google's Gemini CLI and its massive context window. Supports file/directory analysis, security audits, architecture analysis, feature verification, and complete project overviews for large codebases that exceed other AI models' context limits.
      -
    • A
      license
      Not graded
      quality
      A
      maintenance
      An MCP server for AI-to-AI collaboration via the Gemini CLI. Available on npm: ask-gemini-mcp. Works with Claude Code, Claude Desktop, Cursor, Warp, Copilot, and 40+ other MCP clients. Leverage Gemini's massive 1M+ token context window for large file and codebase analysis while your primary AI handles interaction and code editing.
      21
      MIT
    • A
      license
      C
      quality
      D
      maintenance
      Exposes the local Gemini CLI as an MCP stdio server, providing tools for prompting, web search, file operations, and MCP management, enabling AI clients like Codex CLI and Claude Code to interact with Gemini.
      22
      7
      MIT