Gerrit MCP Server
OfficialThe Gerrit MCP Server exposes Gerrit code-review workflows as MCP tools for AI clients.
Search and filter changes by query, date range, project, status, message substring, and limits.
Inspect changes: details, commit messages, modified files, file diffs, comments, related/submitted-together changes, and bug IDs.
Manage reviews: add reviewers/CCs, suggest reviewers, post review comments, create/list/delete/publish draft comments.
Manage change state: create changes, set topic, mark ready for review or work-in-progress, abandon, revert changes, and revert submissions.
Find a user's most recent CL.
Run as a Gemini CLI extension, Claude Code plugin, Codex plugin, persistent HTTP server, or STDIO server, with optional plugin-backed extensions.
Interacts with the Gerrit code review system to query changes, retrieve details, and manage reviews via its REST API.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Gerrit MCP Server list my pending reviews"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π Gerrit MCP Server
An MCP (Model Context Protocol) server that brings Gerrit code-review workflows to AI clients including the Gemini CLI, Claude Code, and OpenAI Codex. It provides tools to search changes, inspect diffs and review metadata, manage reviewers, comments, and change state, and analyze related or dependent changes. Optional extensions add tools backed by Gerrit plugins.
Use it as a Gemini CLI extension, Claude Code plugin, or Codex plugin, or run it directly as a persistent HTTP server or on-demand via STDIO.
π Documentation
For detailed information, please see the documents in the docs/ directory:
Configuration: A detailed guide to the
gerrit_config.jsonfile and all authentication methods.Testing Guide: Instructions on how to run the unit, integration, and E2E tests.
Gemini CLI Setup: How to configure the Gemini CLI to use this server.
Claude Code Setup: How to use this server as a Claude Code plugin.
Codex Setup: How to use this server as a Codex plugin.
Best Practices: Tips for using the server effectively.
Contributing: Guidelines for contributing to the project.
Available Tools: A list of all available tools and their descriptions.
Extensions: How to register additional MCP tools without modifying the core server.
Example Use Cases: Scenarios demonstrating how to use the server.
Related MCP server: Gerrit MCP Server
Reporting bugs and feature requests
Please report bugs and feature requests in the Gerrit MCP Server component of the Gerrit issue tracker.
Due to spam abuse, membership in the repo-discuss Google Group is required to create issues. See the announcement for more information.
π Getting Started
1. Prerequisites
Before you begin, ensure you have the following tools installed and available in
your system's PATH.
Python 3.12+: Required by the server.
uv: Used for dependency management and running the server. Optional β the build script will install it via
pipif absent.curl: The standard command-line tool for transferring data with URLs.
2. Build the Environment
Run the build script from the root of the gerrit-mcp-server project directory.
This will create a virtual environment in .venv via uv sync and install all
dependencies.
./build-gerrit.sh3. Configure the Server
Create the shared user config file described in the Configuration Guide. Copy the sample to the default location (using the project virtual environment's Python):
config_path=$(uv run python -c 'from platformdirs import user_config_path; print(user_config_path("gerrit-mcp") / "gerrit_config.json")')
mkdir -p "$(dirname "$config_path")"
cp gerrit_mcp_server/gerrit_config.sample.json "$config_path"Customize it for your environment. GERRIT_CONFIG_PATH overrides the default.
Existing repo-local configs must be moved or explicitly selected with that
variable; they are not migrated automatically.
Alternatively, if your harness supports skills (tested with Claude Code), the
/gerrit:setup skill can create or repair this file for you interactively. See
Interactive Setup.
4. Run the Server (HTTP Mode)
To run the server as a persistent background process, use the server.sh
script:
Start the server:
./server.sh startCheck the status:
./server.sh statusStop the server:
./server.sh stop
For on-demand STDIO mode or client-specific installation instructions, see the Gemini CLI Setup Guide, Claude Code Setup Guide, or Codex Setup Guide.
Contributing
To contribute code or other changes, use the canonical gerrit-mcp-server repository hosted on Gerrit and follow the contribution guidelines. This project does not accept GitHub pull requests.
Security
This is not an officially supported Google product. This project is not eligible for the Google Open Source Software Vulnerability Rewards Program.
Available Tools
25 toolsabandon_changeC
Abandons a change.
Inputs: change_id (required), message, gerrit_base_url.
add_reviewerA
Adds a user or a group to a CL as either a reviewer or a CC.
Inputs: reviewer (required), change_id (required), state, gerrit_base_url.
changes_submitted_togetherC
Computes and lists all changes that would be submitted together with a given CL.
Inputs: change_id (required), options, gerrit_base_url.
create_changeC
Creates a new change in Gerrit.
Inputs: branch (required), project (required), subject (required), topic, +2 more.
delete_draft_commentB
Deletes a single draft comment on a CL by its draft ID.
Inputs: draft_id (required), change_id (required), gerrit_base_url.
delete_draft_commentsB
Deletes ALL draft comments on a CL.
Inputs: change_id (required), gerrit_base_url.
get_bugs_from_clB
Extracts bug IDs from the commit message of a CL.
Inputs: change_id (required), gerrit_base_url.
get_change_detailsC
Retrieves a comprehensive summary of a single CL.
Inputs: change_id (required), options, gerrit_base_url.
get_commit_messageB
Gets the commit message of a change from the current patch set.
Inputs: change_id (required), gerrit_base_url.
get_file_diffB
Retrieves the diff for a single, specified file within a CL.
Inputs: change_id (required), file_path (required), gerrit_base_url.
get_most_recent_clC
Gets the most recent CL for a user.
Inputs: user (required), gerrit_base_url.
list_change_commentsC
list_change_comments is useful for reviewing feedback, reading comments on a change, analyzing comments, and responding to comments.
Inputs: change_id (required), gerrit_base_url.
list_change_filesB
Lists all files modified in the most recent patch set of a CL.
Inputs: change_id (required), gerrit_base_url.
list_draft_commentsA
Lists all draft comments on a CL.
Inputs: change_id (required), gerrit_base_url.
post_draft_commentA
Creates a draft review comment on a specific line of a file in a CL. Draft comments are only visible to the author until explicitly published. Use in_reply_to with a parent comment ID to create a threaded reply.
Inputs: message (required), change_id (required), file_path (required), line_number (required), +8 more.
post_review_commentB
Posts a review comment on a specific line of a file in a CL.
Inputs: message (required), change_id (required), file_path (required), line_number (required), +3 more.
publish_draftsA
Publishes all pending draft comments on a CL as a single review. This is equivalent to clicking "Send" in the Gerrit web UI β all draft comments become visible to other reviewers in one batch.
Inputs: change_id (required), labels, message, gerrit_base_url.
query_changesC
Searches for CLs matching a given query string.
Inputs: query (required), limit, options, gerrit_base_url.
query_changes_by_date_and_filtersA
Searches for Gerrit changes within a specified date range, optionally filtered by project, a substring in the commit message, and change status. This tool provides a flexible way to find changes based on their dates and content.
Args:
start_date: The start date for the changes (e.g., "2025-08-18").
end_date: The end date for the changes (e.g., "2025-08-19").
gerrit_base_url: The base URL of the Gerrit instance.
limit: The maximum number of changes to return.
project: Optional project name to filter by. This filter is only
applied if gerrit_base_url is not explicitly provided, in which
case the default Gerrit instance will be queried.
message_substring: An optional substring to search for in the commit message.
status: The status of the changes to search for (e.g., "merged",
"open", "abandoned"). Defaults to "merged".
Inputs: end_date (required), start_date (required), limit, status, +3 more.
revert_changeB
Reverts a single change, creating a new CL.
Inputs: change_id (required), message, gerrit_base_url.
revert_submissionB
Reverts an entire submission, creating one or more new CLs.
Inputs: change_id (required), message, gerrit_base_url.
set_ready_for_reviewC
Sets a CL as ready for review.
Inputs: change_id (required), gerrit_base_url.
set_topicB
Sets the topic of a change. An empty string deletes the topic.
Inputs: topic (required), change_id (required), gerrit_base_url.
set_work_in_progressC
Sets a CL as work-in-progress.
Inputs: change_id (required), message, gerrit_base_url.
suggest_reviewersC
Suggests reviewers for a change based on a query.
Inputs: query (required), change_id (required), limit, exclude_groups, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 25 tools
Most tools target distinct actions and resources, but there is minor overlap between query_changes and query_changes_by_date_and_filters, and between delete_draft_comments (all) and delete_draft_comment (single). The descriptions clarify these boundaries, so an agent can generally select correctly.
The overwhelming majority follow a verb_noun pattern (query_, get_, list_, delete_, set_, create_, etc.). The notable exception is 'changes_submitted_together', which is a noun phrase rather than a verb-first name, and 'query_changes_by_date_and_filters' is longer but still verb-initial.
With 25 tools, the server sits at the high end of what is typically considered heavy. While each tool has a specific purpose for Gerrit operations, the count is borderline and may feel bloated compared to more focused servers.
The server covers the core Gerrit lifecycle well: create, query, get details, modify state, comment, add reviewers, revert, and abandon. However, it lacks a direct 'submit' operation, which is a notable gap for a Gerrit client, and also misses actions like restoring an abandoned change or editing a commit message.
Maintenance
Related MCP Connectors
Access the GitHub API, enabling file operations, repository management, search functionality, andβ¦
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Enable Large Language Model clients to interact seamlessly with any MediaWiki wiki. Perform actionβ¦
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides integration with Gerrit code review system, allowing AI assistants to fetch change details and compare patchset differences for code reviews.38MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that enables language models to query and manage Gerrit code reviews via the REST API.78 PyPI1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that exposes Gerrit code review operations as capability-gated tools, enabling AI agents to search and read changes, publish comments, vote, and manage change state, with write capabilities as explicit opt-in.9MIT
- AlicenseNot gradedqualityBmaintenanceA Model Context Protocol server that connects AI coding agents to Gerrit code review, enabling change search, diff review, and comment publishing without leaving the session.Elastic 2.0