home / mcp / gemini mcp server

Gemini MCP Server

Provides tools for analyzing codebases using the Gemini CLI, including file, directory, and project-level analyses plus verification, security, and architecture assessments.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "juparave-gemini-mcp": {
      "command": "uv",
      "args": [
        "run",
        "python",
        "-m",
        "gemini_mcp"
      ]
    }
  }
}

Gemini MCP Server lets you analyze large codebases, verify feature implementations, and run security and architecture analyses by leveraging Gemini CLI capabilities. It provides practical tools to inspect files, directories, and entire projects with focused prompts you craft for Gemini.

How to use

You interact with the Gemini MCP Server through an MCP client. After you have the server running, you can perform focused analyses by selecting one of the built-in tools and supplying the necessary inputs, such as file paths, directory paths, or a custom analysis prompt. Use these patterns to get actionable results:

How to install

Prerequisites you must have installed before running the server:

- Python 3.12 or newer.

- uv package manager.

Gemini CLI should be installed and configured on your system as part of your tooling ecosystem. You can install and use Gemini CLI through multiple methods.

Concrete steps to set up the MCP server locally:

# 1) Ensure prerequisites are installed
# Python 3.12+ is required for the MCP server

# 2) Install/prepare Gemini CLI (one of these options)
# Using npx (no installation required)
# npx https://github.com/google-gemini/gemini-cli

# Install Gemini CLI (example - check official docs for latest instructions)
# npm install -g @google/gemini-cli@latest

# or install via Brew if you prefer
# brew install gemini-cli

# 3) Install the MCP server's runtime environment
# uv is the package manager used for this server

# 4) Obtain the MCP source and set it up locally
# Clone or download the gemini-mcp project

# 5) Install and synchronize dependencies
# From the project root
uv sync

# 6) Run the MCP server directly
uv run python -m gemini_mcp

# Or install and start via the CLI entry point
uv pip install -e .
gemini-mcp

Additional sections

Configuration and runtime options help you tailor analysis runs. The server exposes commands you can invoke via an MCP client or via slash commands in compatible environments. If you are integrating with Claude Code, you can add the MCP server using the provided script integration flow and then issue prompts through the client interface.

Troubleshooting and maintenance tips include checking Gemini CLI installation, ensuring file paths are accessible, and validating permissions in your working directory. For large projects, consider breaking down analysis into subdirectories to avoid timeouts and to keep results focused.

Upgrade and maintenance steps: keep dependencies synchronized and, if installed in editable mode, changes are reflected automatically. Re-run synchronization after updates to ensure you are using the latest code paths.

Available tools

gemini_analyze_files

Analyze specific files using Gemini CLI with @ syntax. Accepts a list of file paths, a prompt, and an optional working directory to run from.

gemini_analyze_directories

Analyze entire directories using Gemini CLI. Accepts a list of directories, a prompt, and an optional working directory to run from.

gemini_analyze_all_files

Analyze all files in the current directory using the --all_files flag with a provided prompt.

gemini_verify_implementation

Verify if specific features or patterns are implemented in the codebase. Accepts a feature name, search paths, and an optional verification prompt and working directory.

gemini_security_audit

Perform security analysis of the codebase, selecting the audit type (sql_injection, xss, auth, general, or input_validation) and paths to audit.

gemini_architecture_analysis

Analyze codebase architecture and patterns, with options for overview, dependencies, patterns, structure, or coupling analysis and target paths.