Connects Claude to Google's Gemini API so you can bounce questions off a second model without leaving your workflow. Exposes four tools: gemini_ask for one-off questions, gemini_analyze for targeted code review or text analysis, gemini_chat for multi-turn conversations with history, and gemini_models to list what's available. Supports all current Gemini models including the 1M token context window on 2.5-pro. Handles rate limits with retry logic and lets you override the model per call. Useful when you want a different perspective on architecture decisions, need massive context windows, or want to compare how two frontier models approach the same problem.
Public tool metadata for what this MCP can expose to an agent.
GEMINI_COUNT_TOKENSCounts the number of tokens in text using Gemini tokenization. Useful for estimating costs, checking input limits, and optimizing prompts before making API calls.2 paramsCounts the number of tokens in text using Gemini tokenization. Useful for estimating costs, checking input limits, and optimizing prompts before making API calls.
textstringmodelstringGEMINI_EMBED_CONTENTGenerates text embeddings using Gemini embedding models. Converts text into numerical vectors for semantic search, similarity comparison, clustering, and classification tasks.4 paramsGenerates text embeddings using Gemini embedding models. Converts text into numerical vectors for semantic search, similarity comparison, clustering, and classification tasks.
textstringmodelstringtitlestringtask_typestringGEMINI_GENERATE_CONTENTGenerates text content from prompts using Gemini models. Supports various models like Gemini Flash and Pro with configurable temperature, token limits, and safety settings for diverse text generation tasks.9 paramsGenerates text content from prompts using Gemini models. Supports various models like Gemini Flash and Pro with configurable temperature, token limits, and safety settings for diverse text generation tasks.
modelstringtop_kintegertop_pnumberpromptstringtemperaturenumberstop_sequencesarraysafety_settingsarraymax_output_tokensintegersystem_instructionstringGEMINI_GENERATE_IMAGEGenerates images from text prompts using Gemini 2.5 Flash Image Preview model (Nano Banana). Supports creative image generation with customizable parameters like aspect ratio, safety settings, and optional local file saving. Generated images are automatically uploaded to S3 an...9 paramsGenerates images from text prompts using Gemini 2.5 Flash Image Preview model (Nano Banana). Supports creative image generation with customizable parameters like aspect ratio, safety settings, and optional local file saving. Generated images are automatically uploaded to S3 an...
modelstringtop_kintegertop_pnumberpromptstringsave_pathstringtemperaturenumbersafety_settingsarraymax_output_tokensintegersystem_instructionstringGEMINI_GENERATE_VIDEOSGenerates videos from text prompts using Google's Veo models. Creates high-quality video content. Returns operation ID for tracking progress. After this, call GEMINI_WAIT_FOR_VIDEO to download the video using the operation ID.4 paramsGenerates videos from text prompts using Google's Veo models. Creates high-quality video content. Returns operation ID for tracking progress. After this, call GEMINI_WAIT_FOR_VIDEO to download the video using the operation ID.
modelstringextrasobjectpromptstringperson_generationstringGEMINI_GET_VIDEOS_OPERATIONChecks the status of a Veo video generation operation. Use the operation name from GenerateVideos to track progress and get the download URL when complete.1 paramsChecks the status of a Veo video generation operation. Use the operation name from GenerateVideos to track progress and get the download URL when complete.
operation_namestringGEMINI_LIST_MODELSLists available Gemini and Veo models with their capabilities and limits. Useful for discovering supported models and their features before making generation requests.1 paramsLists available Gemini and Veo models with their capabilities and limits. Useful for discovering supported models and their features before making generation requests.
filter_prefixstringGEMINI_WAIT_FOR_VIDEOPolls a Veo video generation operation until completion, then downloads and returns the video as a FileDownloadable with public URL.1 paramsPolls a Veo video generation operation until completion, then downloads and returns the video as a FileDownloadable with public URL.
operation_namestringLightweight MCP server that exposes Google Gemini as tools for Claude Code (or any MCP client).
Use Gemini for second opinions, large-context analysis, code review, or anything where a different model perspective helps.
| Tool | Description |
|---|---|
gemini_ask | Ask Gemini a question or give it a task |
gemini_analyze | Send code/text for analysis with a specific instruction |
gemini_chat | Multi-turn conversation with full history |
gemini_models | List available Gemini models |
Go to Google AI Studio and create a free API key.
Option A — Clone (recommended for Claude Code)
git clone https://github.com/PavelGuzenfeld/gemini-mcp.git ~/.claude/mcp-servers/gemini
cd ~/.claude/mcp-servers/gemini
npm install
Option B — npx (no install)
npx claude-gemini-mcp
Add to ~/.claude/settings.json:
{
"mcpServers": {
"gemini": {
"command": "node",
"args": ["/home/you/.claude/mcp-servers/gemini/index.js"],
"env": {
"GEMINI_API_KEY": "your-key-here"
}
}
}
}
Or with 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
| Variable | Default | Description |
|---|---|---|
GEMINI_API_KEY | (required) | Google AI Studio API key |
GEMINI_MODEL | gemini-2.5-pro | Default model for all tools |
| Model | Best for |
|---|---|
gemini-2.5-pro | Best quality, large context (1M tokens) |
gemini-2.5-flash | Fast, good for most tasks |
gemini-2.0-flash | Fastest, simple tasks |
Every tool accepts an optional model parameter to override the default per-call.
| Problem | Solution |
|---|---|
GEMINI_API_KEY is not set | Add the key to your env block in settings.json |
429 Too Many Requests | Built-in retry handles this — wait a few seconds |
Model not found | Run gemini_models to list valid model names |
| Tools not appearing in Claude Code | Check ~/.claude/settings.json syntax, restart Claude Code |
ECONNREFUSED | Check network/firewall — the server calls generativelanguage.googleapis.com |
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
GEMINI_API_KEY*secretGoogle Gemini API key
io.github.ericm1018/skillfm-llm-cost-optimizer-openai-anthropic-usage
io.github.mikerawsonnz/llm-orchestration-agent
io.github.mikerawsonnz/authenticated-llm-agent
labforgedev/copilot-memory-mcp
csoai-org/agent-prompt-injection-firewall-mcp
io.github.mikerawsonnz/authenticated-multi-llm-agent