Gemini
Bridge Claude with Google's Gemini via the official Gemini CLI. Leverages Gemini's massive 1M+ token context window for large file and codebase analysis while Claude handles interaction and code editing.
Installation
Run in your terminal:
bash
# Project scope (current project only)
claude mcp add gemini-cli -- npx -y ask-gemini-mcp
# User scope (all projects)
claude mcp add --scope user gemini-cli -- npx -y ask-gemini-mcp Or install as a plugin (adds slash commands like /multi-review, /brainstorm, /compare, plus reviewer subagents and a pre-commit hook):
bash
/plugin marketplace add Lykhoyda/ask-llm
/plugin install ask-llm@ask-llm-pluginsOr install globally:
bash
npm install -g ask-gemini-mcpPrerequisites
- Node.js v20.0.0 or higher
- Gemini CLI installed and authenticated:
bash
npm install -g @google/gemini-cli
gemini loginTools
| Tool | Purpose |
|---|---|
ask-gemini | Send prompts to Gemini CLI with @ file syntax. Optional sessionId for multi-turn; live progressive output via --output-format stream-json (ADR-057) |
ask-gemini-edit | Structured code edits via Gemini changeMode. Returns OLD/NEW edit blocks. Supports includeDirs for monorepo context |
fetch-chunk | Retrieve subsequent chunks from cached large responses |
get-usage-stats | Per-session token totals + breakdowns by provider/model. In-memory (ADR-054) |
ping | Fast connection test to verify MCP setup |
ask-gemini returns both human-readable text and a structured AskResponse (provider, response, model, sessionId, usage) via MCP outputSchema — programmatic clients can extract the sessionId and usage fields directly without parsing the response footer (ADR-065).
Models
- Default:
gemini-3.1-pro-preview(latest, highest capability) - Fallback:
gemini-3-flash-preview(automatic on quota errors per ADR-044)
Key Features
- 1M+ token context for analyzing entire codebases
- Multi-turn sessions via
sessionId— native--resume <id>(zero replay cost) - Include directories for monorepo context (
includeDirsparameter onask-gemini-edit) - Live progressive output — assistant message deltas stream to MCP progress notifications, no frozen waits on long calls
- Structured AskResponse via outputSchema for programmatic clients
- Automatic quota fallback from Pro to Flash on
RESOURCE_EXHAUSTED
npm
- Package: ask-gemini-mcp
- Binary:
ask-gemini-mcp