Get the FREE Ultimate OpenClaw Setup Guide →

gerrit

null - (mirror of https://gerrit.googlesource.com/./gerrit-mcp-server)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio gerritcodereview-gerrit-mcp-server python -m gerrit_mcp_server.server \
  --env GERRIT_PASSWORD="Gerrit password or token (optional if using OAuth/token auth)" \
  --env GERRIT_USERNAME="Gerrit username (optional if using basic auth)" \
  --env GERRIT_API_BASE_URL="URL of Gerrit REST API (e.g., https://<host>/a/)"

How to use

The Gerrit MCP Server provides a programmatic interface to interact with a Gerrit code review system using the Model Context Protocol. It exposes tools that allow a language model to query changes, retrieve details about specific reviews, and perform actions via Gerrit’s REST API by issuing curl-style requests under the hood. The server can run as a persistent HTTP service for continuous query access or be invoked on-demand in STDIO mode for single-request processing, depending on your workflow. You can explore the available tools and their capabilities in the documentation under Available Tools. The server is designed to be integrated with Gemini or similar agents, enabling natural language queries to translate into Gerrit operations such as listing changes, fetching change details, adding comments, and managing reviews.

How to install

Prerequisites:

  • Python 3.11+
  • curl (for testing REST interactions, optional but recommended)
  • Access to a Gerrit instance (with appropriate API credentials)

Installation steps:

  1. Clone the repository and navigate to the project root: git clone https://github.com/example/gerrit-mcp-server.git cd gerrit-mcp-server

  2. Build/setup the environment using the provided build script: ./build-gerrit.sh

    This creates a Python virtual environment and installs dependencies

  3. Create or customize the configuration file for Gerrit: cp gerrit_mcp_server/gerrit_config.sample.json gerrit_mcp_server/gerrit_config.json

    Edit gerrit_mcp_server/gerrit_config.json to point to your Gerrit instance and auth details

  4. Run the server (HTTP mode) in the background: ./server.sh start

    Use ./server.sh status to check status and ./server.sh stop to stop

  5. Optional: run in STDIO mode via Gemini CLI setup as described in the documentation:

    See docs/gemini-cli.md for instructions on configuring Gemini to communicate with this server

  6. Verify the server is reachable, for example by making a test request to the root endpoint or using the available tools documented in docs/available_tools.md.

Additional notes

Tips and notes:

  • Ensure your Gerrit API credentials have sufficient permissions for the actions you plan to perform.
  • If using HTTP mode, consider securing the server behind a reverse proxy and enabling authentication.
  • The configuration file (gerrit_config.json) supports multiple authentication methods; review docs/configuration.md for details.
  • The build script abstracts environment setup; if you modify environment variables, restart the server to pick up changes.
  • For debugging, consult docs/testing.md to run unit/integration tests and verify tool behavior before production use.

Related MCP Servers

Sponsor this space

Reach thousands of developers