home / mcp / gemini bridge mcp server

Gemini Bridge MCP Server

A lightweight MCP server bridging AI agents to Google's Gemini AI via official CLI

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "elyin-gemini-bridge": {
      "command": "uvx",
      "args": [
        "gemini-bridge"
      ],
      "env": {
        "GEMINI_BRIDGE_TIMEOUT": "120"
      }
    }
  }
}

Gemini Bridge is a lightweight MCP server that lets your AI coding assistants talk directly to Google's Gemini CLI. It provides two core commands to handle general queries and file-based analysis, is stateless, and integrates reliably with Claude Code, Cursor, VS Code, and any MCP-compatible client.

How to use

You connect Gemini Bridge to your MCP client of choice (for example Claude Code, Cursor, or VS Code) and use the two available tools for interacting with Gemini. First, ask general questions to get quick answers about code patterns, architecture, or practices. Second, run file-focused analysis by attaching one or more files so Gemini can review and suggest improvements. The server runs as a local process and communicates with Gemini CLI, so there is no persistent session state between requests.

Practical usage patterns you can follow: - Ask broad questions about authentication, security, or best practices in your codebase. - Analyze specific files by passing their paths and reviewing the results. - For larger file trees, prefer splitting queries into smaller chunks or using file-based analysis with explicit file lists.

How to install

Prerequisites include having Node.js and Python available on your system, plus access to the Gemini CLI. Install the Gemini CLI globally, then install Gemini Bridge as a Python package and configure your MCP client.

# Install Gemini CLI globally
npm install -g @google/gemini-cli

# Authenticate with Gemini
gemini auth login

# Verify installation
gemini --version

Configuration and usage notes

Key timeout behavior: Gemini Bridge uses a default 60-second timeout for CLI operations. You can override this with the GEMINI_BRIDGE_TIMEOUT environment variable. If you run long queries or analyze large files, consider increasing the timeout to 120–300 seconds.

Environment variable example for a longer timeout during installation or runtime:

# Example: set a 120-second timeout for all operations in Claude Code
claude mcp add gemini-bridge -s user --env GEMINI_BRIDGE_TIMEOUT=120 -- uvx gemini-bridge

Troubleshooting and tips

If you encounter issues, ensure Gemini CLI is installed and authenticated, verify that the gemini command is in your PATH, and confirm the MCP client is configured to use the Gemini Bridge server.

Common issues include CLI not available, authentication failures, or timeouts. Address them by reinstalling the Gemini CLI, running gemini auth login, and increasing the timeout where needed.

Notes on deployment options

Two deployment approaches are supported. Use the standard installation flow with uvx for a ready-to-run local server, or run in development mode for testing before production.

Standard deployment uses the uvx command to start the local MCP server, while development mode runs the server via Python for local testing.

Available tools

consult_gemini

Direct CLI bridge for simple queries to Gemini. Accepts a query, a working directory, a model choice (flash or pro), and an optional per-request timeout.

consult_gemini_with_files

CLI bridge that attaches files for detailed analysis. Accepts a query, directory, list of file paths, model, timeout, and mode to control how files are resolved (inline or via command resolution).