gemini-mcp
gemini-mcp
轻量级 MCP 服务器,将 Google Gemini 作为工具暴露给 Claude Code(或任何 MCP 客户端)。
使用 Gemini 获取第二意见、大上下文分析、代码审查,或任何需要不同模型视角的帮助。
工具
工具 | 描述 |
| 向 Gemini 提问或分配任务 |
| 发送代码/文本并附带特定指令进行分析 |
| 带完整历史的多轮对话 |
| 列出可用的 Gemini 模型 |
Related MCP server: Gemini Bridge
快速开始
1. 获取 API 密钥
前往 Google AI Studio 创建免费 API 密钥。
2. 安装
选项 A — 克隆(推荐用于 Claude Code)
git clone https://github.com/PavelGuzenfeld/gemini-mcp.git ~/.claude/mcp-servers/gemini
cd ~/.claude/mcp-servers/gemini
npm install选项 B — npx(无需安装)
npx claude-gemini-mcp3. 在 Claude Code 中注册
添加到 ~/.claude/settings.json:
{
"mcpServers": {
"gemini": {
"command": "node",
"args": ["/home/you/.claude/mcp-servers/gemini/index.js"],
"env": {
"GEMINI_API_KEY": "your-key-here"
}
}
}
}或使用 npx:
{
"mcpServers": {
"gemini": {
"command": "npx",
"args": ["-y", "claude-gemini-mcp"],
"env": {
"GEMINI_API_KEY": "your-key-here"
}
}
}
}使用示例
提问
> Use gemini_ask to explain the difference between std::expected and std::optional
Gemini says: std::optional<T> represents a value that may or may not be present...
std::expected<T, E> additionally carries an error value when the expected value is absent...分析代码
> Use gemini_analyze to review this function for performance issues:
instruction: "Find performance bottlenecks"
content: <your code here>
Gemini says: Line 12 allocates inside the loop — move the vector outside...多轮对话
> Use gemini_chat with messages:
[{"role": "user", "content": "Design a REST API for a task manager"},
{"role": "model", "content": "Here's a RESTful design..."},
{"role": "user", "content": "Now add authentication"}]
Gemini says: Building on the previous design, add JWT-based auth...每次调用覆盖模型
> Use gemini_ask with model: "gemini-2.5-flash" to quickly summarize this error log环境变量
变量 | 默认值 | 描述 |
| (必填) | Google AI Studio API 密钥 |
|
| 所有工具的默认模型 |
模型
模型 | 最适合 |
| 最佳质量,大上下文(100 万 tokens) |
| 快速,适合大多数任务 |
| 最快,简单任务 |
每个工具都接受可选的 model 参数,用于覆盖每次调用的默认模型。
特性
在速率限制(429)和服务器错误(5xx)时使用指数退避重试
优雅地将错误报告返回给 MCP 客户端(不会崩溃)
每次调用可覆盖模型
除 API 密钥外零配置
故障排除
问题 | 解决方案 |
| 将密钥添加到 |
| 内置重试会处理此问题 — 等待几秒 |
| 运行 |
工具未出现在 Claude Code 中 | 检查 |
| 检查网络/防火墙 — 服务器调用 |
开发
git clone https://github.com/PavelGuzenfeld/gemini-mcp.git
cd gemini-mcp
npm install
npm test # Run smoke tests
node index.js # Start the MCP server locally许可证
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceAn MCP server implementation that allows using Google's Gemini AI models (specifically Gemini 1.5 Pro) through Claude or other MCP clients via the Model Context Protocol.1
- AlicenseAqualityFmaintenanceA lightweight MCP server that enables AI coding assistants to interact with Google's Gemini AI through the official CLI.3MIT
- AlicenseNot gradedqualityCmaintenanceAn MCP server that integrates Google Gemini CLI with Claude Code for AI-powered development assistance, enabling code review, bug analysis, feature planning, and code explanation without requiring an API key.8MIT
- AlicenseAqualityDmaintenanceAn MCP server that provides access to Google Gemini models via Vertex AI, enabling text generation, multi-turn chat, image/video generation, and frontend design through Claude Code.21MIT
Related MCP Connectors
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/PavelGuzenfeld/gemini-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server