fetch_gerrit_changeLABSCO SUMMARY
It does not just read the change — it posts the review, votes and inline comments included.
Fetching the diff is table stakes; submit_gerrit_review is what makes this a full loop, letting an assistant leave a Code-Review vote and comments anchored to specific lines, with control over who gets notified. Comparing two patchsets is the other useful piece for tracking how a change evolved across review rounds. Excluding noisy file types keeps large binaries out of the review.
What it is
A server over the Gerrit code review system: fetch a change and its diffs, compare patchsets, and submit review feedback.
What you get
- fetch_gerrit_change returns a change's files, patch sets and diffs, with project, branch, author, reviewers and history, and can target a specific patchset
- fetch_patchset_diff compares two patchsets of a change, whole or for one file
- submit_gerrit_review posts summary feedback, vote labels such as {"Code-Review": 1}, and inline or file-level comments
- The review can target a patchset and control notification scope — NONE, OWNER, OWNER_REVIEWERS or ALL
- Comment payloads take a path, message and optional Gerrit fields like line, side and range
Requirements
Python 3.10+ (3.11 recommended) and Gerrit HTTP access — GERRIT_HOST, GERRIT_USER and GERRIT_HTTP_PASSWORD, the last generated from Gerrit's HTTP Credentials. GERRIT_EXCLUDED_PATTERNS optionally excludes file types from reviews. Clone, create a venv, pip install -e ., then the client launches server.py with --transport stdio.
Setup effort
Build from source — git clone https://github.com/cayirtepeomer/gerrit-code-review-mcp.git
USE CASES
Reviewing a change end to end
Fetch the change with its files and diffs, then post a summary, a vote and inline comments.
Seeing what changed between review rounds
Diff two patchsets of the change, for one file or all of them.
Leaving a comment on a specific line
Submit a review with a comment payload carrying the path and line.
Controlling who gets pinged by the review
Set the notification scope on the review to OWNER or OWNER_REVIEWERS instead of ALL.
3 tools
Listed in project docs. Your client may show a different list.
fetch_patchset_diffsubmit_gerrit_reviewBEFORE YOU INSTALL
What to know first
Tools you get
3 tools named in the project's documentation.
Requires
- Python 3.10 or later
- GERRIT_HOST in your environment
- GERRIT_USER in your environment
- GERRIT_HTTP_PASSWORD in your environment
Where it runs
Both documented clients run the server on your machine.
INSTALLATION
Connect your client
You clone this one yourself.
Server setup
git clone https://github.com/cayirtepeomer/gerrit-code-review-mcp.git
cd gerrit-code-review-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e .Generate an HTTP password in Gerrit under Settings > HTTP Credentials; it goes into GERRIT_HTTP_PASSWORD in the client entry below, with GERRIT_HOST (hostname only, no https://) and GERRIT_USER
MCP Clients
Cursor, Roo Code
{
"mcpServers": {
"gerrit-review-mcp": {
"command": "<YOUR_PATH_TO_WORKSPACE>/gerrit-code-review-mcp/.venv/bin/python",
"args": [
"<YOUR_PATH_TO_WORKSPACE>/gerrit-code-review-mcp/server.py",
"--transport",
"stdio"
],
"cwd": "<YOUR_PATH_TO_WORKSPACE>/gerrit-code-review-mcp",
"env": {
"PYTHONPATH": "<YOUR_PATH_TO_WORKSPACE>/gerrit-code-review-mcp",
"VIRTUAL_ENV": "<YOUR_PATH_TO_WORKSPACE>/gerrit-code-review-mcp/.venv",
"PATH": "<YOUR_PATH_TO_WORKSPACE>/gerrit-code-review-mcp/.venv/bin:/usr/local/bin:/usr/bin:/bin",
"GERRIT_HOST": "<YOUR_GERRIT_HOST>",
"GERRIT_USER": "<YOUR_GERRIT_USER>",
"GERRIT_HTTP_PASSWORD": "<YOUR_GERRIT_HTTP_PASSWORD>"
},
"stdio": true
}
}
}