loading…
Search for a command to run...
loading…
MCP Server providing AI agents with tooling for Gerrit code review workflows via stdio transport.
MCP Server providing AI agents with tooling for Gerrit code review workflows via stdio transport.
MCP Server providing AI agents with tooling for Gerrit code review workflows via stdio transport.
~/.netrc fallback (HTTP mode)~/.ssh/id_rsa fallback (SSH mode)npx mcp-gerrit-code-review
Or install globally:
npm install -g mcp-gerrit-code-review
git clone https://github.com/coveyjorjet/mcp-gerrit-code-review.git
cd mcp-gerrit-code-review
npm install && npm run build
Set via environment variables:
export GERRIT_URL=https://gerrit.example.com
export GERRIT_USERNAME=your-username
export GERRIT_PASSWORD=your-http-password
Or use ~/.netrc:
machine gerrit.example.com
login your-username
password your-http-password
Set transport mode and SSH connection details:
export GERRIT_TRANSPORT=ssh
export GERRIT_SSH_HOST=gerrit.example.com
export GERRIT_SSH_USER=your-username
export GERRIT_SSH_PORT=29418 # optional, defaults to 29418
export GERRIT_SSH_KEY=~/.ssh/id_rsa # optional, defaults to ~/.ssh/id_rsa
export GERRIT_SSH_KEY_PASSPHRASE=your-passphrase # optional
Or use SSH URL format in GERRIT_URL:
export GERRIT_TRANSPORT=ssh
export GERRIT_URL=ssh://[email protected]:29418
SSH credentials are resolved from ~/.netrc for username if not specified.
Add to your opencode.json or opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-gerrit-code-review": {
"type": "local",
"command": ["npx", "-y", "mcp-gerrit-code-review"],
"enabled": true,
"environment": {
"GERRIT_URL": "https://gerrit.example.com",
"GERRIT_USERNAME": "your-username",
"GERRIT_PASSWORD": "your-http-password"
}
}
}
}
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-gerrit-code-review": {
"type": "local",
"command": ["npx", "-y", "mcp-gerrit-code-review"],
"enabled": true,
"environment": {
"GERRIT_TRANSPORT": "ssh",
"GERRIT_SSH_HOST": "gerrit.example.com",
"GERRIT_SSH_USER": "your-username",
"GERRIT_SSH_KEY": "/path/to/private/key"
}
}
}
}
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"mcp-gerrit-code-review": {
"type": "local",
"command": ["node", "/path/to/mcp-gerrit-code-review/dist/index.js"],
"enabled": true,
"environment": {
"GERRIT_URL": "https://gerrit.example.com",
"GERRIT_USERNAME": "your-username",
"GERRIT_PASSWORD": "your-http-password"
}
}
}
}
Add to your MCP client configuration:
{
"mcpServers": {
"mcp-gerrit-code-review": {
"command": "npx",
"args": ["-y", "mcp-gerrit-code-review"],
"env": {
"GERRIT_URL": "https://gerrit.example.com",
"GERRIT_USERNAME": "your-username",
"GERRIT_PASSWORD": "your-http-password"
}
}
}
}
{
"mcpServers": {
"mcp-gerrit-code-review": {
"command": "npx",
"args": ["-y", "mcp-gerrit-code-review"],
"env": {
"GERRIT_TRANSPORT": "ssh",
"GERRIT_SSH_HOST": "gerrit.example.com",
"GERRIT_SSH_USER": "your-username",
"GERRIT_SSH_KEY": "/path/to/private/key"
}
}
}
}
{
"mcpServers": {
"mcp-gerrit-code-review": {
"command": "node",
"args": ["dist/index.js"],
"env": {
"GERRIT_URL": "https://gerrit.example.com",
"GERRIT_USERNAME": "your-username",
"GERRIT_PASSWORD": "your-http-password"
}
}
}
}
| Category | Tools | Description |
|---|---|---|
| Changes | query_changes, get_change_details, list_change_files, get_file_diff, get_commit_message, post_review, post_review_comment, list_change_comments, submit_change, abandon_change, restore_change, list_reviewers, add_reviewer |
Code review operations |
| Accounts | get_account, query_accounts |
User account management (HTTP only) |
| Projects | list_projects |
Project discovery |
| Server | get_server_version, get_server_info |
Server metadata (info: HTTP only) |
⚠️ Mutation tools (
post_review,post_review_comment,submit_change,abandon_change,restore_change,add_reviewer) modify Gerrit state — confirm with user before calling.
📝 Note: Available tools depend on transport mode and Gerrit server capabilities. Tools are dynamically registered at startup based on what the server supports.
src/
├── index.ts # Entry point, MCP server setup
├── gerrit/
│ ├── client.ts # Gerrit API wrapper with HTTP/SSH transport
│ └── types.ts # TypeScript interfaces
├── tools/
│ ├── changes.ts # 13 change-related tools
│ ├── accounts.ts # 2 account tools (HTTP only)
│ ├── projects.ts # 1 project tool
│ └── server.ts # 2 server tools
└── utils/
└── parsing.ts # Credential resolution, SSH config parsing
npm run dev # Watch mode rebuild
npm test # Run tests once
npm run test:watch # Watch mode tests
npm run lint # Type check (tsc --noEmit)
MIT
Выполни в терминале:
claude mcp add mcp-gerrit-code-review -- npx