$git clone https://github.com/jamubc/gemini-mcp-tool</div>
| 1 | # Gemini MCP Tool |
| 2 | |
| 3 | <div align="center"> |
| 4 | |
| 5 | [](https://github.com/jamubc/gemini-mcp-tool/releases) |
| 6 | [](https://www.npmjs.com/package/gemini-mcp-tool) |
| 7 | [](https://www.npmjs.com/package/gemini-mcp-tool) |
| 8 | [](https://opensource.org/licenses/MIT) |
| 9 | [](https://github.com/jamubc/gemini-mcp-tool) |
| 10 | |
| 11 | </div> |
| 12 | |
| 13 | > 📚 **[View Full Documentation](https://jamubc.github.io/gemini-mcp-tool/)** - Search me!, Examples, FAQ, Troubleshooting, Best Practices |
| 14 | |
| 15 | This is a simple Model Context Protocol (MCP) server that allows AI assistants to interact with the [Gemini CLI](https://github.com/google-gemini/gemini-cli). It enables the AI to leverage the power of Gemini's massive token window for large analysis, especially with large files and codebases using the `@` syntax for direction. |
| 16 | |
| 17 | - Ask gemini natural questions, through claude or Brainstorm new ideas in a party of 3! |
| 18 | |
| 19 | <a href="https://glama.ai/mcp/servers/@jamubc/gemini-mcp-tool"> |
| 20 | <img width="380" height="200" src="https://glama.ai/mcp/servers/@jamubc/gemini-mcp-tool/badge" alt="Gemini Tool MCP server" /> |
| 21 | </a> |
| 22 | |
| 23 | ## TLDR: [](#) + [](#)([](#)) |
| 24 | |
| 25 | **Goal**: Use Gemini's powerful analysis capabilities directly in Claude Code to save tokens and analyze large files. |
| 26 | |
| 27 | ## Prerequisites |
| 28 | |
| 29 | <details> |
| 30 | <summary>🚀 <strong>Important: Gemini CLI is retired. This tool now defaults to Antigravity CLI (`agy`)</strong></summary> |
| 31 | |
| 32 | On **2026-06-18**, Google retired the Gemini CLI for **free, Google AI Pro, and Google AI Ultra** users (and individual Gemini Code Assist / GitHub-org users). Its successor is the **Antigravity CLI** (`agy`). See [Google's announcement](https://goo.gle/gemini-cli-migration). |
| 33 | |
| 34 | **From 2026-06-18 this tool selects the `agy` backend automatically.** If you are on an affected tier, just install `agy`: |
| 35 | |
| 36 | ```bash |
| 37 | curl -fsSL https://antigravity.google/cli/install.sh | bash # macOS / Linux |
| 38 | ``` |
| 39 | |
| 40 | Then run `agy` once to sign in. Nothing else to change. |
| 41 | |
| 42 | **Enterprise / Standard-license or paid-API-key user?** Your Gemini CLI access is **unaffected** by the retirement. To keep using it, set one env var on the MCP server: |
| 43 | |
| 44 | ```bash |
| 45 | GEMINI_MCP_BACKEND=gemini |
| 46 | ``` |
| 47 | |
| 48 | | Variable | Purpose | |
| 49 | | --- | --- | |
| 50 | | `GEMINI_MCP_BACKEND` | `gemini` or `agy`/`antigravity`. Unset uses the date-aware default (`agy` from 2026-06-18). | |
| 51 | | `AGY_CLI_PATH` | Full path to the `agy` binary if it isn't on the server's PATH. | |
| 52 | | `GEMINI_MCP_TIMEOUT` | Overall CLI run timeout in minutes (default 45). | |
| 53 | |
| 54 | The `agy` backend is **experimental**: print mode is Gemini 3.5 Flash-only, replies come from `agy`'s stdout (transcript recovery only as a fallback), and tool execution isn't sandboxed in `-p`. The tool emits a notice when a requested `model`/`sandbox` can't be honored, and surfaces `agy`'s own errors (quota, auth) verbatim. Full analysis: [docs/migration/antigravity-cli.md](docs/migration/antigravity-cli.md). |
| 55 | |
| 56 | </details> |
| 57 | |
| 58 | |
| 59 | Before using this tool, ensure you have: |
| 60 | |
| 61 | 1. **[Node.js](https://nodejs.org/)** (v16.0.0 or higher) |
| 62 | 2. **[Google Gemini CLI](https://github.com/google-gemini/gemini-cli)** installed and configured |
| 63 | |
| 64 | ### One-Line Setup |
| 65 | |
| 66 | ```bash |
| 67 | claude mcp add gemini-cli -- npx -y gemini-mcp-tool |
| 68 | ``` |
| 69 | |
| 70 | <details> |
| 71 | <summary>For Windows users</summary> |
| 72 | |
| 73 | Use `-- y` instead of `-y`: |
| 74 | |
| 75 | ```bash |
| 76 | claude mcp add gemini-cli -- npx -- y gemini-mcp-tool |
| 77 | ``` |
| 78 | |
| 79 | </details> |
| 80 | |
| 81 | ### Verify Installation |
| 82 | |
| 83 | Type `/mcp` inside Claude Cod |