
MCP服务器使AI助手能够与Google Gemini CLI交互,利用Gemini庞大的令牌窗口进行大文件分析和代码库理解
概览
📚 - 搜索我!,示例,常见问题解答,故障排除,最佳实践 这是一个简单的模型上下文协议(MCP)服务器,允许AI助手与Gemini CLI交互。它使AI能够利用Gemini庞大的令牌窗口进行大规模分析,尤其是处理使用@语法的大型文件和代码库。 - 通过克劳德提出双子座自然问题,或者三人组队中头脑风暴新点子! :直接在Claude Code中使用Gemini强大的分析功能,保存令牌并分析大型文件。 🚀 重要信息:Gemini CLI 已退役。该工具现在默认为 Antigravity CLI(agy) 谷歌在 ,已退役 Gemini CLI,面向用户(以及 Gemini Code Assist / GitHub-org 的个人用户)。其继任者是 (agy)。详见谷歌的公告。 如果你处于受影响的套餐,只需安装agy: 然后跑一次登录。没什么可改的。
概述(AI 翻译)
📚 查看完整文档 - 搜索我!、示例、常见问题解答、故障排除、最佳实践
这是一个简单的模型上下文协议(MCP)服务器,允许AI助手与Gemini CLI交互。它使AI能够利用Gemini庞大的令牌窗口进行大规模分析,尤其是处理使用@语法作为方向的大文件和代码库。
- 通过克劳德提出双子座自然问题,或者三人组队中头脑风暴新点子!
简要总结:+( )
目标:直接在Claude Code中使用Gemini强大的分析功能来保存令牌并分析大型文件。
先修条件
🚀 重要信息:Gemini CLI 已退役。该工具现默认为 Antigravity CLI([agy)
在2026-06-18,谷歌为免费、Google AI Pro和Google AI Ultra用户(以及个人Gemini Code Assist/GitHub-org用户)退役了Gemini CLI。其继任者是Antigravity CLI(agy)。详见谷歌的公告。
**自2026-06-18起,该工具会自动选择agy后端。**如果你在受影响的层级,只需安装agy:
然后运行一次agy登录。没有其他需要更改的。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Gemini MCP Tool
📚 View Full Documentation - Search me!, Examples, FAQ, Troubleshooting, Best Practices
This is a simple Model Context Protocol (MCP) server that allows AI assistants to interact with the 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.
- Ask gemini natural questions, through claude or Brainstorm new ideas in a party of 3!
TLDR:
+
(
)
Goal: Use Gemini’s powerful analysis capabilities directly in Claude Code to save tokens and analyze large files.
Prerequisites
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.
From 2026-06-18 this tool selects the agy backend automatically. If you are on an affected tier, just install agy:
curl -fsSL https://antigravity.google/cli/install.sh | bash # macOS / Linux
Then run agy once to sign in. Nothing else to change.
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:
GEMINI_MCP_BACKEND=gemini
| Variable | Purpose |
|---|---|
GEMINI_MCP_BACKEND |
gemini or agy/antigravity. Unset uses the date-aware default (agy from 2026-06-18). |
安装
npx -y gemini-mcp-tool配置
{
"mcpServers": {
"gemini-cli": {
"command": "npx",
"args": ["-y", "gemini-mcp-tool"]
}
}
}