home / mcp / gerrit review mcp server
This MCP server provides integration with Gerrit code review system, allowing AI assistants to review code changes and their details through a simple interface.
Configuration
View docs{
"mcpServers": {
"cayirtepeomer-gerrit-code-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"
],
"env": {
"PATH": "/path/to/your/workspace/gerrit-code-review-mcp/.venv/bin:/usr/local/bin:/usr/bin:/bin",
"PYTHONPATH": "/path/to/your/workspace/gerrit-code-review-mcp",
"GERRIT_HOST": "gerrit.example.com",
"GERRIT_USER": "your-username",
"VIRTUAL_ENV": "/path/to/your/workspace/gerrit-code-review-mcp/.venv",
"GERRIT_CA_BUNDLE": "/path/to/ca.pem",
"GERRIT_SSL_VERIFY": "true",
"GERRIT_HTTP_PASSWORD": "your-http-password",
"GERRIT_EXCLUDED_PATTERNS": "\\.pbxproj$,\\.xcworkspace$,node_modules/"
}
}
}
}You can integrate Gerrit code reviews with an MCP server to let AI assistants fetch complete change details, inspect diffs across patchsets, and submit reviews directly from your tooling. This enables fast, contextual code reviews and consistent collaboration across your Gerrit workflows.
You interact with the Gerrit Review MCP Server through your MCP client to perform three core actions: fetch complete change details, compare patchset differences, and submit review feedback. Start by requesting a change to see the full metadata, file diffs, and review history. Then compare specific patchsets to understand how changes evolved over iterations. Finally, post a summary with optional inline comments and votes to streamline the review cycle.
Prerequisites for running the Gerrit Review MCP Server are Python 3.10 or higher and access to Gerrit via HTTP with appropriate credentials. You also need access to the MCP client transport you plan to use (stdio in this guide). All commands below assume you are operating in a Unix-like shell; adapt paths as needed for Windows.
npx -y @smithery/cli install @cayirtepeomer/gerrit-code-review-mcp --client claudeIf you prefer a manual setup, follow these steps. Create a project workspace, set up a virtual environment, and install the MCP package in editable mode.
git clone <repository-url>
cd gerrit-review-mcp
python -m venv .venv
# For macOS/Linux:
source .venv/bin/activate
# For Windows:
.venv\Scripts\activate
pip install -e .The MCP configuration uses a local stdio server started with your Python virtual environment. Ensure your paths reflect your workspace so the server can start correctly.
/path/to/your/workspace/gerrit-code-review-mcp/.venv/bin/python "/path/to/your/workspace/gerrit-code-review-mcp/server.py" --transport stdioUse this JSON structure to register the Gerrit Review MCP Server with your MCP client configuration.
{
"mcpServers": {
"gerrit_review": {
"type": "stdio",
"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"
}
}
}
}With this MCP server, you can fetch the complete change information, including files, patch sets, author/reviewer data, and review history. You can compare patchset diffs to track changes across iterations and submit review feedback with optional inline comments and voting labels.
Fetches complete change information including files and patch sets; returns change details with author/reviewer data and diff content.
Compares differences between two patchsets for a change; can target a specific file or all changed files.
Posts summary feedback with optional labels and inline comments; can target a specific patchset and control notification scope.