{
  "markdown": "# gemini-mcp\n\n[![npm](https://img.shields.io/npm/v/claude-gemini-mcp)](https://www.npmjs.com/package/claude-gemini-mcp)\n[![MCP Registry](https://img.shields.io/badge/MCP-Registry-blue)](https://registry.modelcontextprotocol.io)\n[![Node.js](https://img.shields.io/badge/Node.js-20+-339933?logo=node.js&logoColor=white)](https://nodejs.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nLightweight [MCP](https://modelcontextprotocol.io) server that exposes Google Gemini as tools for Claude Code (or any MCP client).\n\nUse Gemini for second opinions, large-context analysis, code review, or anything where a different model perspective helps.\n\n## Tools\n\n| Tool | Description |\n|------|-------------|\n| `gemini_ask` | Ask Gemini a question or give it a task |\n| `gemini_analyze` | Send code/text for analysis with a specific instruction |\n| `gemini_chat` | Multi-turn conversation with full history |\n| `gemini_models` | List available Gemini models |\n\n## Quick Start\n\n### 1. Get an API key\n\nGo to [Google AI Studio](https://aistudio.google.com/apikey) and create a free API key.\n\n### 2. Install\n\n**Option A — Clone (recommended for Claude Code)**\n\n```bash\ngit clone https://github.com/PavelGuzenfeld/gemini-mcp.git ~/.claude/mcp-servers/gemini\ncd ~/.claude/mcp-servers/gemini\nnpm install\n```\n\n**Option B — npx (no install)**\n\n```bash\nnpx claude-gemini-mcp\n```\n\n### 3. Register with Claude Code\n\nAdd to `~/.claude/settings.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"gemini\": {\n      \"command\": \"node\",\n      \"args\": [\"/home/you/.claude/mcp-servers/gemini/index.js\"],\n      \"env\": {\n        \"GEMINI_API_KEY\": \"your-key-here\"\n      }\n    }\n  }\n}\n```\n\nOr with npx:\n\n```json\n{\n  \"mcpServers\": {\n    \"gemini\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"claude-gemini-mcp\"],\n      \"env\": {\n        \"GEMINI_API_KEY\": \"your-key-here\"\n      }\n    }\n  }\n}\n```\n\n## Usage Examples\n\n### Ask a question\n```\n> Use gemini_ask to explain the difference between std::expected and std::optional\n\nGemini says: std::optional<T> represents a value that may or may not be present...\nstd::expected<T, E> additionally carries an error value when the expected value is absent...\n```\n\n### Analyze code\n```\n> Use gemini_analyze to review this function for performance issues:\n  instruction: \"Find performance bottlenecks\"\n  content: <your code here>\n\nGemini says: Line 12 allocates inside the loop — move the vector outside...\n```\n\n### Multi-turn conversation\n```\n> Use gemini_chat with messages:\n  [{\"role\": \"user\", \"content\": \"Design a REST API for a task manager\"},\n   {\"role\": \"model\", \"content\": \"Here's a RESTful design...\"},\n   {\"role\": \"user\", \"content\": \"Now add authentication\"}]\n\nGemini says: Building on the previous design, add JWT-based auth...\n```\n\n### Override model per call\n```\n> Use gemini_ask with model: \"gemini-2.5-flash\" to quickly summarize this error log\n```\n\n## Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `GEMINI_API_KEY` | *(required)* | Google AI Studio API key |\n| `GEMINI_MODEL` | `gemini-2.5-pro` | Default model for all tools |\n\n## Models\n\n| Model | Best for |\n|-------|----------|\n| `gemini-2.5-pro` | Best quality, large context (1M tokens) |\n| `gemini-2.5-flash` | Fast, good for most tasks |\n| `gemini-2.0-flash` | Fastest, simple tasks |\n\nEvery tool accepts an optional `model` parameter to override the default per-call.\n\n## Features\n\n- Retry with exponential backoff on rate limits (429) and server errors (5xx)\n- Graceful error reporting back to the MCP client (no crashes)\n- Per-call model override\n- Zero configuration beyond the API key\n\n## Troubleshooting\n\n| Problem | Solution |\n|---------|----------|\n| `GEMINI_API_KEY is not set` | Add the key to your `env` block in `settings.json` |\n| `429 Too Many Requests` | Built-in retry handles this — wait a few seconds |\n| `Model not found` | Run `gemini_models` to list valid model names |\n| Tools not appearing in Claude Code | Check `~/.claude/settings.json` syntax, restart Claude Code |\n| `ECONNREFUSED` | Check network/firewall — the server calls `generativelanguage.googleapis.com` |\n\n## Development\n\n```bash\ngit clone https://github.com/PavelGuzenfeld/gemini-mcp.git\ncd gemini-mcp\nnpm install\nnpm test          # Run smoke tests\nnode index.js     # Start the MCP server locally\n```\n\n## License\n\n[MIT](LICENSE)\n",
  "bytes": 4371,
  "sha": "6c05c6fc7282290dca066d096c80dfe524bdce996cf47363d457c4afef6483a2",
  "repo_slug": "pavelguzenfeld/gemini-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_io_github_pavelguzenfeld_gemini_5685e926/readme"
}