GitLab Code ReviewSAFE
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://www.python.org/downloads/) [](https://opensource.org/licenses/MIT)
This project is forked from cayirtepeomer/gerrit-code-review-mcp and adapted for GitLab integration.
An MCP (Model Context Protocol) server for integrating AI assistants like Claude with GitLab's merge requests. This allows AI assistants to review code changes directly through the GitLab API.
Features
- Complete Merge Request Analysis: Fetch full details about merge requests including diffs, commits, and comments
- File-Specific Diffs: Analyze changes to specific files within merge requests
- Version Comparison: Compare different branches, tags, or commits
- Review Management: Add comments, approve, or unapprove merge requests
- Project Overview: Get lists of all merge requests in a project
Installation
Prerequisites
- Python 3.10+
- GitLab personal access token with API scope (read_api, api)
- Cursor IDE or Claude Desktop App for MCP integration
Quick Start
- Clone this repository:
git clone https://github.com/mehmetakinn/gitlab-mcp-code-review.git cd gitlab-mcp-code-review
- Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Create a
.envfile with your GitLab configuration (see.env.examplefor all options):
# Required GITLAB_TOKEN=your_personal_access_token_here # Optional settings GITLAB_HOST=gitlab.com GITLAB_API_VERSION=v4 LOG_LEVEL=INFO
Configuration Options
The following environment variables can be configured in your .env file:
bd2815d02af3OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add gitlab-mcp-code-review --env GITLAB_TOKEN=${GITLAB_TOKEN} -- uvx gitlab-mcp-code-review{
"mcpServers": {
"gitlab-mcp-code-review": {
"command": "uvx",
"args": [
"gitlab-mcp-code-review"
],
"env": {
"GITLAB_TOKEN": "${GITLAB_TOKEN}"
}
}
}
}Exposed tools (8)
1 read · 7 write · 0 destructive.
| Tool | Risk | Description |
|---|---|---|
add_merge_request_comment | write | |
approve_merge_request | write | |
compare_versions | read | |
fetch_commit_diff | write | |
fetch_merge_request | write | |
fetch_merge_request_diff | write | |
get_project_merge_requests | write | |
unapprove_merge_request | write |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- declared (2 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (4)
.flake8
.pre-commit-config.yaml
pytest, pytest-cov, black, isort, mypy, pre-commit
mcp, python-dotenv, requests
Gates applied: no_behavioural_pass.
bd2815d02af3full audit observations/trust-audit/mcp-server/mehmetakinn__gitlab-code-review.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | bd2815d02af3 | SAFE | B | 89 | first audit |
Questions
What tools does GitLab Code Review expose?
8 in total: 1 read-only, 7 that write, and 0 that can delete or overwrite. Every one is listed on this page with its risk.
Is GitLab Code Review safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does GitLab Code Review need?
It reads GITLAB_TOKEN from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does GitLab Code Review run?
It speaks stdio, so it runs as a local process your client starts. It is published on PyPI as gitlab-mcp-code-review.
How current is this page?
The grade is for one exact copy of the source (bd2815d02af3), read on 2026-10-08. The repository is watched and re-audited when it changes.