auto-reviewers-mcp-server
v1.0.1
Published
MCP server for auto-reviewer suggestions on GitLab merge requests based on CODEOWNERS and contribution history
Downloads
7
Maintainers
Readme
Auto Reviewers MCP Server
A Model Context Protocol (MCP) server that exposes auto-reviewer functionality for GitLab merge requests.
Installation
Install the package from npm:
npm install auto-reviewers-mcp-serverQuick Start
After installation, you can run the server directly:
node node_modules/auto-reviewers-mcp-server/dist/index.jsOr add it to your MCP configuration (see Integration section below).
Features
- suggest_reviewers: Automatically suggest reviewers based on contributors, team members, and code owners
- get_contributor_analysis: Analyze file contributors using git blame data
- get_reviewer_workload: Get current workload analysis for potential reviewers
Development Setup
For development or building from source:
- Install dependencies:
npm install- Build the server:
npm run build- Configure environment (optional):
cp .env.example .env
# Edit .env with your GitLab URL and token- Run the server:
npm startConfiguration
The server requires a GitLab API token. You can provide it in two ways:
- Environment variable: Set
GITLAB_TOKENin your environment or.envfile - Tool parameter: Pass
gitlabTokenwhen calling the tool
Optionally set GITLAB_URL (defaults to https://gitlab.com).
Tools
suggest_reviewers
Suggests reviewers for a GitLab merge request based on:
- Git blame analysis of changed files to find previous contributors
- Team member availability with FTE-aware load balancing
- Code ownership rules from CODEOWNERS file
- Current reviewer workload across open merge requests
Parameters:
projectId(number): GitLab project IDmergeRequestIid(number): Merge request internal IDauthorUsername(string): Username of the MR authorgitlabToken(string, optional): GitLab API tokengitlabUrl(string, optional): GitLab instance URL
Returns:
- List of contributor reviewers with change details
- Team member suggestions with load balancing scores
- Code owner assignments by section
- Formatted comment for GitLab MR
get_contributor_analysis
Provides detailed analysis of who contributed to the changed files using git blame.
Parameters:
projectId(number): GitLab project IDmergeRequestIid(number): Merge request internal IDgitlabToken(string, optional): GitLab API tokengitlabUrl(string, optional): GitLab instance URL
Returns:
- List of changed files
- Contributors per file with line counts
get_reviewer_workload
Analyzes current workload of potential reviewers across open merge requests.
Parameters:
projectId(number): GitLab project IDgitlabToken(string, optional): GitLab API tokengitlabUrl(string, optional): GitLab instance URL
Returns:
- List of reviewers with open MR counts
Integration
To use this MCP server with an AI assistant, add it to your MCP configuration:
{
"mcpServers": {
"auto-reviewers": {
"command": "node",
"args": ["node_modules/auto-reviewers-mcp-server/dist/index.js"],
"env": {
"GITLAB_TOKEN": "your_token_here",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}If you installed the package globally, you can reference it directly:
{
"mcpServers": {
"auto-reviewers": {
"command": "auto-reviewers-mcp-server",
"env": {
"GITLAB_TOKEN": "your_token_here",
"GITLAB_URL": "https://gitlab.com"
}
}
}
}Team Configuration
Create a CONTRIBUTORS file in your repository root with team and FTE data:
{
"contributors": [
{
"username": "developer1",
"email": "[email protected]",
"teams": [
{ "name": "Backend", "fte": 1.0 },
{ "name": "API", "fte": 0.5 }
]
}
]
}Code Owners
Create a CODEOWNERS file in your repository root (or docs/CODEOWNERS or .gitlab/CODEOWNERS):
# Backend team owns all backend code
/backend/ @backend-team
# API section requires 2 approvals
[API][2] @api-lead
/api/ @developer1 @developer2Contributing
Contributions are welcome! Please visit the GitHub repository to:
- Report issues or bugs
- Request new features
- Submit pull requests
- View the source code
License
MIT
Support
For issues, questions, or contributions, please visit:
- Issues: GitHub Issues
- Repository: GitHub Repository
