Gemini MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/Raydius/gemini-for-claude-mcp
cd gemini-for-claude-mcp

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "GEMINI_API_KEY=${GEMINI_API_KEY}" gemini-mcp-8526 -- node "<FULL_PATH_TO_GEMINI_FOR_CLAUDE_MCP>/dist/index.js"

Replace <FULL_PATH_TO_GEMINI_FOR_CLAUDE_MCP>/dist/index.js with the actual folder you prepared in step 1.

Required:GEMINI_API_KEY+ 1 optional
README.md

Give Claude Code access to Google's Gemini AI models.

Gemini MCP Server for Claude Code

Give Claude Code access to Google's Gemini AI models. Get second opinions, compare approaches, and leverage Gemini's capabilities—all from within your Claude Code session.


Quick Start

# 1. Clone and build
git clone https://github.com/Raydius/gemini-for-claude-mcp.git
cd gemini-for-claude-mcp
npm install && npm run build

# 2. Add to Claude Code (replace with your actual path and API key)
claude mcp add gemini -e GEMINI_API_KEY=your-api-key -e GEMINI_DEFAULT_MODEL=gemini-3-pro-preview -- node $(pwd)/dist/app.js

# 3. Start Claude Code and try it out
claude

Then ask Claude:

"Ask Gemini to explain the tradeoffs between microservices and monoliths"


Features

  • Built for Claude Code - Seamlessly integrates with your Claude Code workflow
  • Streaming Responses - Enabled by default for real-time output
  • Multi-turn Conversations - Maintain context across multiple Gemini queries
  • Configurable Model - Set your preferred Gemini model via environment variable
  • Token Counting - Estimate costs before making queries
  • Type-Safe - Built with strict TypeScript
  • Well-Tested - 100% domain layer test coverage

Prerequisites


Installation & Setup

Step 1: Clone and Build

git clone https://github.com/Raydius/gemini-for-claude-mcp.git
cd gemini-for-claude-mcp
npm install
npm run build

Step 2: Add to Claude Code

Option A: Using the CLI (Recommended)

# Basic setup (substitute default model for any valid Gemini model designation string)
claude mcp add gemini \
  -e GEMINI_API_KEY=your-api-key \
  -e GEMINI_DEFAULT_MODEL=gemini-3-pro-preview \
  -- node /absolute/path/to/gemini-for-claude-mcp/dist/app.js

Option B: Manual Configuration

Edit your Claude Code settings file (~/.claude.json):

{
  "mcpServers": {
    "gemini": {
      "command": "node",
      "args": ["/absolute/path/to/gemini-for-claude-mcp/dist/app.js"],
      "env": {
        "GEMINI_API_KEY": "your-api-key-here",
        "GEMINI_DEFAULT_MODEL": "gemini-2.5-flash"
      }
    }
  }
}

See Configuration for all available options and supported models.

Step 3: Verify Installation

Start Claude Code and verify the server is connected:

claude

Then ask:

"What Gemini models are available?"

If configured correctly, Claude will use the list_gemini_models tool and show you the available models.


Using with Claude Code

Once installed, you can ask Claude to use Gemini in natural language. Here are some examples:

Get a Second Opinion

You: I'm implementing a rate limiter. Can you ask Gemini for its approach?

Claude: I'll query Gemini for an alternative perspective on rate limiting...
[Uses query_gemini tool]

Gemini suggests using a token bucket algorithm. Here's the comparison:
- My approach: Sliding window...
- Gemini's approach: Token bucket with...

Compare Solutions

You: Here's my sorting algorithm. Have Gemini review it and compare approaches.

Claude: Let me get Gemini's analysis of your sorting implementation...
[Uses query_gemini tool]

Gemini's feedback: ...

Leverage Gemini's Strengths

You: Ask Gemini to analyze this mathematical proof for logical errors.

Claude: I'll have Gemini examine the proof...
[Uses query_gemini tool]

Check Token Usage Before Querying

You: How many tokens would this prompt use with Gemini?

Claude: Let me count the tokens...
[Uses count_gemini_tokens tool]

This text would use approximately 1,250 tokens.

Multi-turn Conversations

You: Start a conversation with Gemini about Rust's ownership model.

Claude: [Uses query_g

Tools (3)

query_geminiSends a prompt to the Gemini model to get a response, analysis, or comparison.
count_gemini_tokensEstimates the number of tokens a prompt would use with Gemini.
list_gemini_modelsLists the available Gemini models.

Environment Variables

GEMINI_API_KEYrequiredYour Google AI Studio API key
GEMINI_DEFAULT_MODELThe default Gemini model to use

Configuration

claude_desktop_config.json
{"mcpServers": {"gemini": {"command": "node", "args": ["/absolute/path/to/gemini-for-claude-mcp/dist/app.js"], "env": {"GEMINI_API_KEY": "your-api-key-here", "GEMINI_DEFAULT_MODEL": "gemini-2.5-flash"}}}}

Try it

Ask Gemini to explain the tradeoffs between microservices and monoliths
Have Gemini review my sorting algorithm and compare approaches
Ask Gemini to analyze this mathematical proof for logical errors
How many tokens would this prompt use with Gemini?
What Gemini models are available?

Frequently Asked Questions

What are the key features of Gemini MCP Server?

Seamless integration with Claude Code workflow. Streaming responses for real-time output. Multi-turn conversation support. Configurable Gemini model selection. Built-in token counting for cost estimation.

What can I use Gemini MCP Server for?

Getting a second opinion on architectural decisions from a different AI model. Comparing code implementation approaches between Claude and Gemini. Analyzing complex logic or mathematical proofs using Gemini's specific capabilities. Estimating API costs by checking token usage before executing large prompts.

How do I install Gemini MCP Server?

Install Gemini MCP Server by running: claude mcp add gemini -e GEMINI_API_KEY=your-api-key -e GEMINI_DEFAULT_MODEL=gemini-3-pro-preview -- node /path/to/dist/app.js

What MCP clients work with Gemini MCP Server?

Gemini MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Gemini MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare