Gemini MCP server

Integrates Google Gemini 2.5 Pro as a development partner for extended reasoning, code analysis, and collaborative problem-solving with specialized tools for deep thinking, code review, debugging, file analysis, and brainstorming through a 1M token context window.
Back to servers
Setup instructions
Provider
Fahad Gilani
Release date
Jun 09, 2025
Language
JavaScript
Stats
6.7K stars

Zen MCP Server is a Model Context Protocol server that enables multi-model AI orchestration for development workflows. It allows tools like Claude Code, Gemini CLI, or Codex CLI to access multiple AI models, creating a collaborative AI development environment with conversation continuity across different models for enhanced code analysis and problem-solving.

Quick Start

Prerequisites: Python 3.10+, Git, uv installed

Get API Keys

Choose one or more:

  • OpenRouter - Access multiple models with one API
  • Gemini - Google's latest models
  • OpenAI - O3, GPT-5 series
  • X.AI - Grok models
  • DIAL - Vendor-agnostic model access
  • Ollama - Local models (free)

Installation Options

Option A: Clone and Automatic Setup (recommended)

git clone https://github.com/BeehiveInnovations/zen-mcp-server.git
cd zen-mcp-server

# Handles everything: setup, config, API keys from system environment. 
# Auto-configures Claude Desktop, Claude Code, Gemini CLI, Codex CLI
# Enable / disable additional settings in .env
./run-server.sh  

Option B: Instant Setup with uvx

// Add to ~/.claude/settings.json or .mcp.json
// Don't forget to add your API keys under env
{
  "mcpServers": {
    "zen": {
      "command": "bash",
      "args": ["-c", "for p in $(which uvx 2>/dev/null) $HOME/.local/bin/uvx /opt/homebrew/bin/uvx /usr/local/bin/uvx uvx; do [ -x \"$p\" ] && exec \"$p\" --from git+https://github.com/BeehiveInnovations/zen-mcp-server.git zen-mcp-server; done; echo 'uvx not found' >&2; exit 1"],
      "env": {
        "PATH": "/usr/local/bin:/usr/bin:/bin:/opt/homebrew/bin:~/.local/bin",
        "GEMINI_API_KEY": "your-key-here",
        "DISABLED_TOOLS": "analyze,refactor,testgen,secaudit,docgen,tracer",
        "DEFAULT_MODEL": "auto"
      }
    }
  }
}

Start Using

"Use zen to analyze this code for security issues with gemini pro"
"Debug this error with o3 and then get flash to suggest optimizations"
"Plan the migration strategy with zen, get consensus from multiple models"

Core Tools

Collaboration & Planning (Enabled by default)

  • chat - Brainstorm ideas, get second opinions, validate approaches
  • thinkdeep - Extended reasoning, edge case analysis, alternative perspectives
  • planner - Break down complex projects into structured, actionable plans
  • consensus - Get expert opinions from multiple AI models with stance steering

Code Analysis & Quality

  • debug - Systematic investigation and root cause analysis
  • precommit - Validate changes before committing, prevent regressions
  • codereview - Professional reviews with severity levels and actionable feedback
  • analyze (disabled by default) - Understand architecture, patterns, dependencies across entire codebases

Development Tools (Disabled by default)

  • refactor - Intelligent code refactoring with decomposition focus
  • testgen - Comprehensive test generation with edge cases
  • secaudit - Security audits with OWASP Top 10 analysis
  • docgen - Generate documentation with complexity analysis

Utilities

  • challenge - Prevent "You're absolutely right!" responses with critical analysis
  • tracer (disabled by default) - Static analysis prompts for call-flow mapping

Tool Configuration

Default Configuration

To optimize context window usage, only essential tools are enabled by default:

Enabled by default:

  • chat, thinkdeep, planner, consensus - Core collaboration tools
  • codereview, precommit, debug - Essential code quality tools
  • challenge - Critical thinking utility

Disabled by default:

  • analyze, refactor, testgen, secaudit, docgen, tracer

Enabling Additional Tools

Option 1: Edit your .env file

# Default configuration (from .env.example)
DISABLED_TOOLS=analyze,refactor,testgen,secaudit,docgen,tracer

# To enable specific tools, remove them from the list
# Example: Enable analyze tool
DISABLED_TOOLS=refactor,testgen,secaudit,docgen,tracer

# To enable ALL tools
DISABLED_TOOLS=

Option 2: Configure in MCP settings

// In ~/.claude/settings.json or .mcp.json
{
  "mcpServers": {
    "zen": {
      "env": {
        // Tool configuration
        "DISABLED_TOOLS": "refactor,testgen,secaudit,docgen,tracer",
        "DEFAULT_MODEL": "pro",
        "DEFAULT_THINKING_MODE_THINKDEEP": "high",
        
        // API configuration
        "GEMINI_API_KEY": "your-gemini-key",
        "OPENAI_API_KEY": "your-openai-key",
        "OPENROUTER_API_KEY": "your-openrouter-key",
        
        // Logging and performance
        "LOG_LEVEL": "INFO",
        "CONVERSATION_TIMEOUT_HOURS": "6",
        "MAX_CONVERSATION_TURNS": "50"
      }
    }
  }
}

Key Features

AI Orchestration

  • Auto model selection - Claude picks the right AI for each task
  • Multi-model workflows - Chain different models in single conversations
  • Conversation continuity - Context preserved across tools and models
  • Context revival - Continue conversations even after context resets

Model Support

  • Multiple providers - Gemini, OpenAI, X.AI, OpenRouter, DIAL, Ollama
  • Latest models - GPT-5, Gemini 2.5 Pro, O3, Grok-4, local Llama
  • Thinking modes - Control reasoning depth vs cost
  • Vision support - Analyze images, diagrams, screenshots

Developer Experience

  • Guided workflows - Systematic investigation prevents rushed analysis
  • Smart file handling - Auto-expand directories, manage token limits
  • Web search integration - Access current documentation and best practices
  • Large prompt support - Bypass MCP's 25K token limit

Example Workflows

Multi-model Code Review:

"Perform a codereview using gemini pro and o3, then use planner to create a fix strategy"

→ Claude reviews code systematically → Consults Gemini Pro → Gets O3's perspective → Creates unified action plan

Collaborative Debugging:

"Debug this race condition with max thinking mode, then validate the fix with precommit"

→ Deep investigation → Expert analysis → Solution implementation → Pre-commit validation

Architecture Planning:

"Plan our microservices migration, get consensus from pro and o3 on the approach"

→ Structured planning → Multiple expert opinions → Consensus building → Implementation roadmap

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "gemini" '{"command":"python","args":["-m","gemini_mcp_server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "gemini": {
            "command": "python",
            "args": [
                "-m",
                "gemini_mcp_server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "gemini": {
            "command": "python",
            "args": [
                "-m",
                "gemini_mcp_server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later