Gerrit Review MCP Server
About
This MCP server provides integration with Gerrit code review system, allowing AI assistants to review code changes and their details through a simple interface.
Explore
- Fetch complete change details with files and diffs.
- Compare differences between two patchsets.
- Submit review feedback with labels and inline comments.
- Control Gerrit notification scope (NONE, OWNER, OWNER_REVIEWERS, ALL).
- Exclude file patterns from reviews (e.g., .pbxproj$, node_modules/).
- Support for self-signed TLS certificates and custom CA bundles.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Gerrit Review MCP ServerCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
- Python 3.10 or higher (Python 3.11 recommended)
- Gerrit HTTP access credentials
- HTTP password generated from Gerrit settings
- Access to the mcp[cli] package repository (private package)
Review a complete change:
To install gerrit-code-review-mcp for Claude Desktop automatically via Smithery:
bashnpx -y @smithery/cli install @cayirtepeomer/gerrit-code-review-mcp --client claude
1. Clone this repository:
bashgit clone <repository-url>
cd gerrit-review-mcp
2. Create and activate a virtual environment:
bash
export GERRIT_SSL_VERIFY="true" # Set to 'false' to skip TLS verification in constrained environments
export GERRIT_CA_BUNDLE="/path/to/ca.pem" # Optional custom CA bundle path used when verification stays enabled
To use this MCP server with Cursor or RooCode, you need to add its configuration to your ~/.cursor/mcp.json or .roo/mcp.json file. Here's the required configuration:
{
"mcpServers": {
"gerrit-review-mcp": {
"command": "/path/to/your/workspace/gerrit-code-review-mcp/.venv/bin/python",
"args": [
"/path/to/your/workspace/gerrit-code-review-mcp/server.py",
"--transport",
"stdio"
],
"cwd": "/path/to/your/workspace/gerrit-code-review-mcp",
"env": {
"PYTHONPATH": "/path/to/your/workspace/gerrit-code-review-mcp",
"VIRTUAL_ENV": "/path/to/your/workspace/gerrit-code-review-mcp/.venv",
"PATH": "/path/to/your/workspace/gerrit-code-review-mcp/.venv/bin:/usr/local/bin:/usr/bin:/bin"
},
"stdio": true
}
}
}
Replace /path/to/your/workspace with your actual workspace path. For example, if your project is in /Users/username/projects/gerrit-code-review-mcp, use that path instead.
Make sure all paths in the configuration point to:
- Your virtual environment's Python interpreter
- The project's server.py file
- The correct working directory
- The virtual environment's bin directory in the PATH
If you're having trouble with authentication, check your Gerrit config for gitBasicAuthPolicy = HTTP (or HTTP_LDAP).
To run the full test suite:
pip install -e ".[dev]"
The following environment variables can be used to configure test behavior:
- TEST_STARTUP_TIMEOUT: Container startup timeout in seconds (default: 30)
- TEST_LOGS_SETTLE_DELAY: Delay before checking logs in seconds (default: 0)
- DOCKER_HOST: Docker daemon host for remote Docker (optional)
Example:
bashClaude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"gerrit review mcp server": {
"gerrit-code-review-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@cayirtepeomer/gerrit-code-review-mcp",
"--client",
"claude"
]
}
}
}
}
McpServers
{
"gerrit-code-review-mcp": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@cayirtepeomer/gerrit-code-review-mcp",
"--client",
"claude"
]
}
}
This MCP server provides integration with Gerrit code review system, allowing AI assistants to review code changes and their details through a simple interface.
Features
The server provides a streamlined toolset for code review:
Fetch Change Details
fetch_gerrit_change(change_id: str, patchset_number: Optional[str] = None)
- Fetches complete change information including files and patch sets
- Shows detailed diff information for each modified file
- Displays file changes, insertions, and deletions
- Supports reviewing specific patch sets
- Returns comprehensive change details including:
- Project and branch information
- Author and reviewer details
- Comments and review history
- File modifications with diff content
- Current patch set information
Compare Patchset Differences
fetch_patchset_diff(change_id: str, base_patchset: str, target_patchset: str, file_path: Optional[str] = None)
- Compare differences between two patchsets of a change
- View specific file differences or all changed files
- Analyze code modifications across patchset versions
- Track evolution of changes through review iterations
Submit Review Feedback
submit_gerrit_review(
change_id: str,
message: Optional[str] = None,
patchset_number: Optional[str] = None,
labels: Optional[Dict[str, int]] = None,
comments: Optional[List[Dict[str, Any]]] = None,
notify: str = "OWNER",
)
- Post summary feedback, vote labels (e.g., {"Code-Review": 1}), and inline/file-level comments
- Target a specific patchset or default to the latest revision
- Control Gerrit's notification behaviour (notify: NONE, OWNER, OWNER_REVIEWERS, ALL)
- Comment payloads accept dictionaries with path, message, and optional Gerrit comment fields (line, side, range, ...)
Example Usage
Review a complete change:
```python
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



