
gitlab review mcp
Model Context Protocol Server for Gitlab Reviews
Repository Info
About This Server
Model Context Protocol Server for Gitlab Reviews
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
GitLab Merge Request Review MCP
A Model-Context-Protocol (MCP) tool for interacting with GitLab merge request comments. This tool provides a set of utilities to retrieve information about merge requests from LLM agents.
Disclaimer
This is just a proof of concept. The tools seems to work well enough for my needs. The majority of the code in this repository was written by AI Assistant.
Features
- Retrieve general information about merge requests from the currently checked-out branch
- Fetch comments for merge request by ID
Installation
Prerequisites
- Go 1.16 or higher
- A GitLab account with an API token
- A GitLab project where you have appropriate permissions
Building from Source
-
Clone the repository:
git clone https://github.com/ondratuma/gitlab-review-mcp.git cd gitlab-review-mcp -
Build the project:
go build -o gitlab-review-mcp
Configuration
The tool requires the following environment variables:
GITLAB_TOKEN: Your GitLab personal access tokenGITLAB_PROJECT_ID: The ID of the GitLab project you want to interact with
Configuration with JetBrains IDEs
- Go to
settings->Tools->AI Assisstant->Model Context Protocol (MPC) - Add new Server
- Set the environment variables through the UI
- Set working directory somewhere in your git repository
Usage
With AI Assistant
In the AI Assistant chat window, turn the Codebase option on to access MCP servers.
You can prompt the assistant to fix the review comments for you.
Check all the pending Gitlab Review comments and fix them.
The AI Assistant is able to pull the list of merge requests, and fetch the comments for the active one. !demo.gif
Available Tools
get_current_branch (local)
Gets the name of the current Git branch.
get_merge_request_info
Retrieves general information for merge requests for the currently checked-out branch.
get_merge_request_comments
Gets comments for a specific merge request.
Parameters:
mergeRequestIID(required): The internal ID of the merge request
Debugging
Before creating this tool, I tried several other review tools, but debugging was problematic.
For debugging purposes, a simple proxy script can show you the logs and issue with requests. You can change the path to the binary in the AI Assistant and see the actual requests being proxied.
#!/bin/bash
mkdir -p /tmp/mcp_logs
LOG_FILE="/tmp/mcp_logs/mcp-$(date +%Y%m%d-%H%M%S).log"
INPUT_FILE="/tmp/mcp_logs/mcp-$(date +%Y%m%d-%H%M%S).input"
tee $INPUT_FILE | /path/to/binary 2>&1 | tee -a "$LOG_FILE"
Acknowledgements
This project uses the mcp-go library for MCP server functionality.
Quick Start
Clone the repository
git clone https://github.com/ondratuma/gitlab-review-mcpInstall dependencies
cd gitlab-review-mcp
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.