Stateless MCP server that proxies research queries to Gemini CLI, reducing agent context/model usage
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A lightweight, stateless MCP (Model Context Protocol) server that lets developer agents (Claude Code, GitHub Copilot) hand off deep repository analysis to the Gemini CLI. The server is read-only, returns structured JSON (as text content), and is designed 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 saved you tokens, β please consider giving it a star! :)
The primary goals:
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 reads and synthesizes using 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
Gemini Researcher accepts queries from your AI agent and uses Gemini CLI to analyze your local code files. Results are returned as formatted JSON for your agent to use.
The server runs Gemini CLI with safety restrictions enabled. See docs/runtime-contract.md for full technical details.
Default invocation pattern:
Key safety points:
--approval-mode default (not yolo mode) for controlled executionwrite_file, replace, run_shell_commandGEMINI_RESEARCHER_ENFORCE_ADMIN_POLICY=0 (not recommended)Run health_check with includeDiagnostics: true to see auth status and server health.
| authStatus | What it means | Impact |
|---|---|---|
configured | Gemini CLI is authenticated | Server ready to use |
unauthenticated | No valid authentication found | Server marked as degraded |
unknown | Could not verify auth status | Server marked as degraded |
health_check.status values:
ok: Gemini CLI is available, auth is working, and safety policy is enforceddegraded: Setup incomplete, auth unclear, or safety policy disablednpm install -g @google/gemini-cligemini β Login with Google) or set GEMINI_API_KEYQuick checks:
Run the setup wizard to verify Gemini CLI is installed and authenticated:
Standard config works in most of the tools:
[!NOTE] On native Windows, some MCP hosts use shell-less process spawning and may not resolve npm command shims reliably (
npx,gemini). If startup fails with launch errors (spawn ... ENOENT/GEMINI_CLI_LAUNCH_FAILEDdespite working in PowerShell), prefer Docker or WSL for immediate reliability. See the full remediation tree indocs/platforms/windows.md.
Add to your VS Code MCP settings (create .vscode/mcp.json if needed):
Option 1: Command line (recommended)
Local (user-wide) scope
Project scope
Navigate to your project directory, then run:
Option 2: Manual configuration
Add to .mcp.json in your project root (project scope):
Or add to ~/.claude/settings.json for local scope.
After adding the server, restart Claude Code and use /mcp to verify the connection.
Go to Cursor Settings -> Tools & MCP -> Add a Custom MCP Server. Add the following configuration:
[!NOTE] The server automatically uses the directory where the IDE opened your workspace as the project root or where your terminal is. To analyze a different directory, optionally set
PROJECT_ROOT:
Example
Ask your agent: "Use gemini-researcher to analyze the project."
All tools return structured JSON (as MCP text content). Large responses are chunked (~10KB per chunk) and cached for 1 hour.
| Tool | Purpose | When to use |
|---|---|---|
quick_query | Fast analysis with flash model | Quick questions about specific files or small code sections |
deep_research | In-depth analysis with pro model | Complex multi-file analysis, architecture reviews, security audits |
analyze_directory | Map directory structure | Understanding unfamiliar codebases, generating project overviews |
validate_paths | Pre-check file paths | Verify files exist before running expensive queries |
health_check | Diagnostics | Troubleshooting server/Gemini CLI issues |
fetch_chunk | Get chunked responses | Retrieve remaining parts of large responses |
Query tool fallback chains are family-aware:
quick_query: flash -> flash_lite -> autodeep_research: pro -> flash -> flash_lite -> autoanalyze_directory: flash -> flash_lite -> autoWhen using API-key auth, fallback also handles model-unavailable/unsupported errors (not only quota/capacity errors).
Understanding a security vulnerability:
Quick code explanation:
Mapping an unfamiliar codebase:
quick_query
deep_research
analyze_directory
validate_paths
health_check
fetch_chunk
A pre-built multi-platform Docker image is available on Docker Hub:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/gemini-researcher)<a href="https://allmcps.com/mcp/gemini-researcher"><img src="https://allmcps.com/api/badge/gemini-researcher?style=directory" alt="Gemini Researcher on AllMCPs" /></a>