Claude Code Gemini MCP
MCP服务器,使Claude Code能够通过与OpenAI兼容的API调用Gemini模型。
安装
git clone https://github.com/shun-sfoo/claude-code-gemini-mcp.git
cd claude-code-gemini-mcp
npm install
npm run build配置
环境变量
| 变量 | 描述 | 必填 |
|---|---|---|
GEMINI_API_KEY | 您的API密钥 | 是 |
GEMINI_BASE_URL | API终结点(兼容OpenAI) | 是 |
GEMINI_MODEL | 型号ID(默认值: gemini-3-pro-preview) | 没有 |
Claude代码集成
添加到您的项目 .mcp.json:
{
"mcpServers": {
"gemini": {
"command": "node",
"args": ["/path/to/claude-code-gemini-mcp/dist/index.js"],
"env": {
"GEMINI_API_KEY": "your-api-key",
"GEMINI_BASE_URL": "https://your-api-endpoint/v1",
"GEMINI_MODEL": "gemini-3-pro-preview"
}
}
}
}或添加到全局设置(~/.claude/settings.json).
可用工具
双子座思维
对复杂问题进行深入分析和推理。
参数:
problem(string,必填)-要分析的问题context(字符串,可选)-背景信息thinkingStyle(字符串,可选)-以下之一:analytical,creative,critical,systematic
双子座暴雨
产生多种有利有弊的创意。
参数:
topic(string,必填)-头脑风暴的主题constraints(字符串,可选)-约束或要求count(数字,可选)-想法数量,3-10(默认值:5)
gemini_review
代码、架构、安全或性能审查。
参数:
content(字符串,必填)-要查看的内容reviewType(字符串,必填)-以下之一:code,architecture,security,performancefocus(字符串,可选)-要关注的具体方面
双子座查询
具有完全控制的通用查询。
参数:
prompt(string,必填)-发送提示systemPrompt(字符串,可选)-系统提示temperature(数字,可选)-0-2(默认值:0.7)
测试
# Create .env file first
cp .env.example .env
# Edit .env with your credentials
# Run tests
npm test发展
npm run dev # Watch mode
npm run build # Build
npm test # Run tests许可证
麻省理工学院
