mcpField
G
gemini

gemini

Local
github.com/PavelGuzenfeldAI & Agents0Updated 33w ago

About gemini

gemini is an MCP server that makes Google Gemini available to Claude Code and other MCP clients. It provides question answering, code and text analysis, multi-turn chat, and model selection.

Key features

  1. 01Ask Gemini questions or assign tasks
  2. 02Analyze code and text with instructions
  3. 03Continue multi-turn conversations
  4. 04List available Gemini models
  5. 05Override the model per call

Use cases

  1. 01Get a second opinion on a technical question
  2. 02Review code for performance issues
  3. 03Analyze long text or code
  4. 04Refine a design through follow-up chat

MCP support

Exposes Google Gemini through the `gemini_ask`, `gemini_analyze`, `gemini_chat`, and `gemini_models` MCP tools. It connects to Google AI Studio using `GEMINI_API_KEY`.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"pavelguzenfeld-gemini": {
"command": "npx",
"args": [
"-y",
"claude-gemini-mcp"
],
"env": {
"GEMINI_API_KEY": "<GEMINI_API_KEY>"
}
}
}
}
Run commandnpx -y claude-gemini-mcp
Environment variables to set
GEMINI_API_KEYSecretGoogle Gemini API key

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmclaude-gemini-mcp0.1.2

Tools

4

Saved tool list · updated 3w ago

ParameterTypeRequiredDescription
modelstringNoModel override (default: gemini-2.5-pro). Options: gemini-2.5-pro, gemini-2.5-flash, gemini-2.0-flash
promptstringYesThe prompt to send to Gemini

Details

From the project README

gemini-mcp

npm MCP Registry Node.js License: MIT

Lightweight 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.

Tools

ToolDescription
gemini_askAsk Gemini a question or give it a task
gemini_analyzeSend code/text for analysis with a specific instruction
gemini_chatMulti-turn conversation with full history
gemini_modelsList available Gemini models

Quick Start

1. Get an API key

Go to Google AI Studio and create a free API key.

2. Install

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
3. Register with Claude Code

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"
      }
    }
  }
}

Usage Examples

Ask a question
> 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...
Analyze code
> 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...
Multi-turn conversation
> 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...
Override model per call
> Use gemini_ask with model: "gemini-2.5-flash" to quickly summarize this error log

Environment Variables

VariableDefaultDescription
GEMINI_API_KEY(required)Google AI Studio API key
GEMINI_MODELgemini-2.5-proDefault model for all tools

Models

ModelBest for
gemini-2.5-proBest quality, large context (1M tokens)
gemini-2.5-flashFast, good for most tasks
gemini-2.0-flashFastest, simple tasks

Every tool accepts an optional model parameter to override the default per-call.

Features

  • Retry with exponential backoff on rate limits (429) and server errors (5xx)
  • Graceful error reporting back to the MCP client (no crashes)
  • Per-call model override
  • Zero configuration beyond the API key

Troubleshooting

ProblemSolution
GEMINI_API_KEY is not setAdd the key to your env block in settings.json
429 Too Many RequestsBuilt-in retry handles this — wait a few seconds
Model not foundRun gemini_models to list valid model names
Tools not appearing in Claude CodeCheck ~/.claude/settings.json syntax, restart Claude Code
ECONNREFUSEDCheck network/firewall — the server calls generativelanguage.googleapis.com

Development

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

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.