Gemini Researcher MCP Server

Delegate deep repository analysis to the Gemini CLI

README.md

Gemini Researcher

A lightweight, stateless MCP (Model Context Protocol) server that lets developer agents (Claude Code, GitHub Copilot) delegate deep repository analysis to the Gemini CLI. The server is read-only, returns structured JSON (as text content), and is optimized to reduce the calling agent's context and model usage.

Status: v1 complete. Core features are stable, but still early days. Feedback welcome!

If this project extended the lifespan of your usage window, ⭐ please consider giving it a star! :)

Primary goals:

  • Reduce agent context usage by letting Gemini CLI read large codebases locally and do its own research
  • Reduce calling-agent model usage by offloading heavy analysis to Gemini
  • Keep the server stateless and read-only for safety

Why use this?

Instead of copying entire files into your agent's context (burning tokens and cluttering the conversation), this server lets Gemini CLI read files directly from your project. Your agent sends a research query, Gemini does the heavy lifting with its large context window, and returns structured results. You save tokens, your agent stays focused, and complex codebase analysis becomes practical.

Verified clients: Claude Code, Cursor, VS Code (GitHub Copilot)

[!NOTE] It definitely works with other clients, but I haven't personally tested them yet. Please open an issue if you try it elsewhere!

Table of contents

Overview

Gemini Researcher accepts research-style queries over the MCP protocol and spawns the Gemini CLI in headless, read-only mode to perform large-context analysis on local files referenced with @path. Results are returned as pretty-printed JSON strings suitable for programmatic consumption by agent clients.

Prerequisites

  • Node.js 18+ installed
  • Gemini CLI installed: npm install -g @google/gemini-cli
  • Gemini CLI authenticated (recommended: gemini → Login with Google) or set GEMINI_API_KEY

Quick checks:

node --version
gemini --version

Quickstart

Step 1: Validate environment

Run the setup wizard to verify Gemini CLI is installed and authenticated:

npx gemini-researcher init

Step 2: Configure your MCP client

Standard config works in most of the tools:

{
  "mcpServers": {
    "gemini-researcher": {
      "command": "npx",
      "args": [
        "gemini-researcher"
      ]
    }
  }
}
VS Code

Add to your VS Code MCP settings (create .vscode/mcp.json if needed):

{
  "servers": {
    "gemini-researcher": {
      "command": "npx",
      "args": [
        "gemini-researcher"
      ]
    }
  }
}
Claude Code

Option 1: Command line (recommended)

Local (user-wide) scope

# Add the MCP server via CLI
claude mcp add --transport stdio gemini-researcher -- npx gemini-researcher 

# Verify it was added
claude mcp list

Project scope

Navigate to your project directory, then run:

# Add the MCP server via CLI
claude mcp add --scope project --transport stdio gemini-researcher -- npx gemini-researcher

# Verify it was added
claude mcp list

Option 2: Manual configuration

Add to .mcp.json in your project root (project scope):

{
  "mcpServers": {
    "gemini-researcher": {
      "command": "npx",
      "args": [
        "gemini-researcher"
      ]
    }
  }
}

Or add to ~/.claude/settings.json for local scope.

After adding the server, restart Claude Code and use /mcp to verify the connection.

Cursor

Go to Cursor Settings -> Tools & MCP -> Add a Custom MCP Server. Add the following configuration:

{
  "mcpServers": {
    "gemini-researcher": {
      "type": "stdio",
      "command": "npx",
      "arg

Tools 1

researchPerforms large-context analysis on local files referenced with @path using the Gemini CLI in read-only mode.

Environment Variables

GEMINI_API_KEYAPI key for authenticating with Gemini services

Try it

Analyze the codebase and explain how the authentication flow is implemented across the project.
Research the current implementation of the database connection module and suggest potential performance improvements.
Find all files related to user profile management and summarize their responsibilities.
Compare the error handling patterns in the API controllers versus the service layer.

Frequently Asked Questions

What are the key features of Gemini Researcher?

Delegates deep repository analysis to Gemini CLI to save agent context. Stateless and read-only operation for enhanced security. Returns structured JSON results for programmatic consumption. Optimized to reduce calling-agent model usage and token costs. Supports local file analysis via @path references.

What can I use Gemini Researcher for?

Analyzing large codebases without exceeding the primary LLM's context window. Offloading complex research tasks to Gemini to reduce API costs for Claude or Copilot. Performing automated code audits and architectural reviews on local projects. Quickly summarizing logic across multiple files without manual copy-pasting.

How do I install Gemini Researcher?

Install Gemini Researcher by running: npx gemini-researcher init

What MCP clients work with Gemini Researcher?

Gemini Researcher works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Gemini Researcher docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Open Conare