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
9.4K stars

Zen MCP is a powerful server that enhances your AI tools by connecting them to multiple AI models, enabling collaborative workflows across different providers while maintaining continuous conversation context. This server acts as middleware between your preferred CLI tools (like Claude Code, Gemini CLI, or Codex CLI) and various AI models from providers including OpenAI, Anthropic, Google, and more.

Installation

Prerequisites

  • Python 3.10 or higher
  • Git
  • UV package manager

Quick Start (5 Minutes)

1. Get API Keys (at least one required):

2. Choose an Installation Method:

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
./run-server.sh

Option B: Instant Setup with uvx

// Add to ~/.claude/settings.json or .mcp.json
{
  "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"
      }
    }
  }
}

Basic Usage

Once installed, you can use Zen MCP from your preferred AI CLI tool by including "zen" in your prompts:

"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"
"clink with cli_name=\"gemini\" role=\"planner\" to draft a phased rollout plan"

Provider Configuration

Zen activates any provider that has valid credentials in your .env file. You can customize behavior by setting environment variables in your .env file or in your CLI tool's MCP configuration.

Core Tools

Zen MCP comes with several powerful tools that extend your AI workflows:

Collaboration & Planning (Enabled by default)

  • clink - Bridge requests to external AI CLIs
  • chat - Brainstorm ideas and get second opinions
  • thinkdeep - Extended reasoning and alternative perspectives
  • planner - Break down complex projects into structured plans
  • consensus - Get expert opinions from multiple AI models

Code Analysis & Quality

  • debug - Systematic investigation and root cause analysis
  • precommit - Validate changes before committing
  • codereview - Professional reviews with severity levels
  • analyze - Understand architecture and patterns (disabled by default)

Tool Configuration

To optimize context window usage, some tools are disabled by default. You can enable additional tools by removing them from the DISABLED_TOOLS environment variable:

# Default configuration
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=

Example Workflows

Multi-model Code Review:

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

Collaborative Debugging:

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

Architecture Planning:

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

Key Features

  • AI Orchestration - Auto model selection, multi-model workflows, and conversation continuity
  • Multiple Model Support - Access to latest models from Gemini, OpenAI, Azure, X.AI, and local models
  • Thinking Modes - Control reasoning depth vs cost
  • Vision Support - Analyze images, diagrams, and screenshots
  • Guided Workflows - Systematic investigation prevents rushed analysis
  • Smart File Handling - Auto-expand directories and manage token limits
  • Large Prompt Support - Bypass MCP's 25K token limit

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