# Gerrit MCP

> Gerrit MCP lets you manage every step of your code review process directly through conversation. Query changes by status or owner, track the full history of patch sets, audit approvals, and map out project branches without leaving your agent chat. It gives your AI client complete oversight of your entire Git workflow.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** code-review, git-management, patch-sets, version-control, software-development, pull-requests

## Description

Need to keep tabs on what's being coded? This MCP connects your Gerrit instance directly to any AI agent, giving you total control over code reviews and repository management through natural conversation. Instead of opening dozens of browser tabs just to check status updates or commit SHAs, you talk to your agent. You can ask for all open changes in a specific project, filtering by owner or status using syntax like 'status:open'. Need to verify who needs to approve something? Ask the agent to list reviewers and check if required labels, like 'Code-Review' or 'Verified', are present. It also helps you map out your repository structure; you can query all projects, list every branch in a project, and even audit user groups to see who has access control. If you use Vinkius, you get this entire suite of developer tools connected once and accessible from any compatible client.

## Tools

### query_changes
Find specific code reviews (changes) on Gerrit using advanced filters like status or owner.

### get_change
Retrieves the full, detailed information for a single specified change ID.

### list_projects
Lists every project (repository) available on your Gerrit instance.

### get_project
Gets full, detailed metadata about a specific Gerrit project.

### list_branches
Lists all defined branches within any given Gerrit project.

### get_account
Fetches the profile information for the currently authenticated Gerrit user account.

### list_emails
Lists all email addresses associated with your verified Gerrit account.

### list_reviewers
Retrieves a list of users who have reviewed a specific change.

### list_patchsets
Lists all historical revisions (patch sets) for a change, including commit SHAs and parent commits.

### list_groups
Returns the names, IDs, and ownership information for all defined groups in Gerrit.

## Prompt Examples

**Prompt:** 
```
List my open changes in project 'core-engine'
```

**Response:** 
```
Retrieving your changes... I found 2 open changes in 'core-engine': #501 'Fix memory leak' and #502 'Refactor logging'. Would you like to see the current patch set for either of these?
```

**Prompt:** 
```
Who are the reviewers for change #501?
```

**Response:** 
```
Retrieving reviewers for #501... I found 3 reviewers: Alice (Code-Review: +2), Bob (Code-Review: +1), and Charlie (Verified: +1). The change is currently awaiting more approvals to be merged.
```

**Prompt:** 
```
List all branches in project 'frontend-v2'
```

**Response:** 
```
Retrieving branches for 'frontend-v2'... I found 3 branches: 'master' (SHA: abc123), 'release-v1.0' (SHA: def456), and 'feature-auth'. Would you like the latest commit message for any of these?
```

## Capabilities

### Track open changes
Find specific code reviews by status, owner, or project name using advanced search syntax.

### Audit version history
Retrieve the complete list of patch sets for a change to track every commit SHA and parent revision in its lifecycle.

### Monitor approvals
List who has reviewed a change and verify if necessary approval labels have been applied by team members.

### View repository structure
Get metadata for all projects, list branches within a project, or check the latest commit SHAs to understand repo boundaries.

### Manage access and users
List associated user emails, audit system groups, or fetch detailed information about authenticated accounts.

## Use Cases

### Checking merge readiness
An engineer needs to know if a change is ready to merge. They ask their agent, 'Who are the reviewers for change #123?' The agent uses `list_reviewers` and reports back on required approval labels, telling them exactly what's missing before they even open Gerrit.

### Debugging version history
A maintainer suspects a specific commit SHA was overwritten. They ask the agent to list all patch sets for that change. The agent uses `list_patchsets` and gives them the full, chronological record of revisions, letting them pinpoint the exact moment something broke.

### Auditing team access
A DevOps engineer needs to verify if a new contractor has access rights. They ask the agent to list all groups and then query group details using `list_groups`, verifying who controls what projects across the organization.

### Finding stale changes
An engineering manager wants to clean up old, unreviewed code. They prompt the agent with 'List my open changes in the core API project.' The agent uses `query_changes` and provides a list of subjects, numbers, and owners that need attention.

## Benefits

- You stop switching tabs. Instead of manually navigating to a change ID, you ask the agent to list all patch sets for that change, getting the full history and commit SHAs immediately.
- Review status checks are instant. You can query changes using `query_changes` with syntax like 'status:open' so your agent only pulls exactly what needs reviewing, filtering out noise.
- Approval tracking gets clearer. By calling `list_reviewers`, you instantly see who has provided feedback and verify if critical approval labels were added, without manually checking comments.
- Project structure is visible at a glance. Use `list_projects` to get an overview of your entire repository landscape, or use `list_branches` to map out which branches exist in a given project.
- Identity management simplifies. You don't need to remember user IDs; simply asking the agent for user information using `get_account` keeps context clean.

## How It Works

The bottom line is you manage complex code review tasks by talking to your agent instead of navigating multiple developer tools.

1. Subscribe to this MCP and provide your Gerrit URL, username, and HTTP password.
2. Connect the credentialed MCP to your preferred AI client (Claude, Cursor, etc.).
3. Use natural conversation to query changes, list branches, or check project details using specific syntax.

## Frequently Asked Questions

**How do I check my open Gerrit changes using the query_changes tool?**
You simply ask your agent to run `query_changes` and provide a filter, such as 'status:open' or 'owner:self'. The MCP handles the advanced syntax so you don't have to remember it.

**Can I use Gerrit MCP to see all branches in a project?**
Yes. You ask the agent to list all projects first, then specify which one you want details on and run `list_branches` for that project's current state.

**What is the difference between get_change and list_patchsets?**
The `get_change` tool gives you the high-level metadata (who, what, when). The `list_patchsets` tool drills down further to give you a full historical record of every commit SHA that contributed to that change.

**Is Gerrit MCP useful for auditing group permissions?**
Absolutely. You can use the agent to run `list_groups` and then query specific groups to verify who has control over which parts of your organization's project access.

**Does this MCP help with pull request workflows?**
Yes, it manages the core components of PR workflows. You can check approvals (`list_reviewers`) and track the full commit history required to complete a successful merge.