This document serves as the comprehensive guide for developing, testing, and maintaining the gerrit-mcp-server. It provides practical instructions for all stages of the development lifecycle.
pipvirtualenv (recommended)The project includes a build script that handles the creation of the virtual environment and installation of dependencies using uv.
Run the build script:
./build-gerrit.sh
This will create a virtual environment in .venv and install all necessary dependencies.
Activate the virtual environment:
source .venv/bin/activate
[!IMPORTANT] ALWAYS use the virtual environment's Python. Never use the system Python.
We use pytest as our testing framework.
test_*.pytest_query_changes_returns_results.pytest fixtures for setup and dependency injection.conftest.py.unittest.mock.patch as a context manager or fixture.Ensure your virtual environment is activated, then run:
./test.sh
The server is configured via gerrit_mcp_server/gerrit_config.json.
GERRIT_CONFIG_PATH can be used to point to a custom config file.{ "gerrit_hosts": [ { "name": "MyGerrit", "external_url": "https://gerrit.example.com", "authentication": { "type": "http_basic", ... } } ] }See Configuration Guide for full details.
To configure the Gemini CLI to use this server, see the Gemini CLI Setup Guide.
To run the server locally for debugging (ensure venv is active):
python -m gerrit_mcp_server
This project uses Gerrit for code reviews. The primary development branch is master.
git checkout -b <your-feature-branch>
git commit -m "Your descriptive commit message"
refs/for/master to create a CL. Direct pushes to master are not permitted.git push origin HEAD:refs/for/master