GitLab.Mcp.Server
1.0.5
dotnet tool install --global GitLab.Mcp.Server --version 1.0.5
dotnet new tool-manifest
dotnet tool install --local GitLab.Mcp.Server --version 1.0.5
#tool dotnet:?package=GitLab.Mcp.Server&version=1.0.5
nuke :add-package GitLab.Mcp.Server --version 1.0.5
๐ฆ GitLab MCP Server
A professional-grade Model Context Protocol (MCP) server that empowers AI agents (like Claude, Cursor, and Antigravity) to interact directly with GitLab. Automate your development workflow, manage merge requests, and triage issues using the power of AI.
๐ Key Features
- ๐ Complete MR Lifecycle: List, create, review, approve, and merge MRs.
- ๐ Repository Intelligence: Navigate file trees, read source code, and commit changes.
- ๐ฌ Discussion Management: AI can post inline review comments and resolve threads.
- ๐ซ Issue Tracking: Full control over issues, labels, and linking.
- ๐ Discovery: Easily search for projects, groups, and namespaces.
๐ ๏ธ Requirements & Prerequisites
To use this server, you need to meet the following requirements:
1. GitLab Authentication (Mandatory)
- Personal Access Token (PAT): Create one at GitLab Token Settings.
- Required Scope:
api - Optional:
read_repositoryandwrite_repository(usually included inapi).
2. System Dependencies
Choose one of the following based on your preferred installation method:
| Method | System Requirement | Best For... |
|---|---|---|
| Docker | Docker Desktop / Engine | Zero-install experience (No .NET needed) |
| .NET Tool | .NET 10 Runtime | Fastest local setup (via NuGet) |
| Source Code | .NET 10 SDK | Developers (Building/Contributing) |
3. Network Access
- Access to
https://gitlab.com/api/v4(or your custom self-hosted GitLab URL). - Standard outbound HTTPS (port 443).
๐ Installation & Usage
Option 1: Docker (Recommended)
Requirement: Docker installed. No .NET SDK needed.
# Pull and run in one command
docker run -i --rm \
-e GITLAB_PERSONAL_ACCESS_TOKEN="your_actual_token" \
faizu786/gitlab-mcp-server:latest
Option 2: .NET Global Tool (NuGet)
Requirement: .NET 10 Runtime installed.
# 1. Install the tool
dotnet tool install -g GitLab.Mcp.Server
# 2. Run the tool (Environment variable must be set)
# Windows (PowerShell):
$env:GITLAB_PERSONAL_ACCESS_TOKEN="your_token"; gitlab-mcp
# Linux/macOS:
GITLAB_PERSONAL_ACCESS_TOKEN="your_token" gitlab-mcp
Option 3: Build from Source
Requirement: .NET 10 SDK installed.
# 1. Clone the repository
git clone https://gitlab.com/faizanshaik/gitlab_mcp_server.git
cd GitLabMcpServer
# 2. Run directly
dotnet run
๐ Client Integration (Antigravity & Cursor)
Configure your AI agent by adding one of the following to your MCP settings. Docker is the recommended setup.
1. Docker Setup (Recommended)
Use this if you want a zero-install experience. Docker handles everything.
{
"mcpServers": {
"gitlab-docker": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--name",
"gitlab-mcp",
"-e",
"GITLAB_PERSONAL_ACCESS_TOKEN=your_actual_PAT_here",
"-e",
"GITLAB_API_URL=https://gitlab.com/api/v4",
"-e",
"GITLAB_USER_DISPLAY_NAME=Argus",
"faizu786/gitlab-mcp-server:latest"
]
}
}
}
2. Local Source Setup
Use this if you are developing or running directly from the project folder.
{
"mcpServers": {
"gitlab-local": {
"command": "dotnet",
"args": [
"run",
"--project",
"C:\\Path\\To\\GitLab.Mcp.Server.csproj"
],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_actual_PAT_here",
"GITLAB_API_URL": "https://gitlab.com/api/v4",
"GITLAB_USER_DISPLAY_NAME": "Argus"
}
}
}
}
3. .NET Global Tool Setup
Use this if you have installed the tool via NuGet (dotnet tool install -g GitLab.Mcp.Server).
{
"mcpServers": {
"gitlab-tool": {
"command": "gitlab-mcp",
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "your_actual_PAT_here",
"GITLAB_API_URL": "https://gitlab.com/api/v4",
"GITLAB_USER_DISPLAY_NAME": "Argus"
}
}
}
}
โ๏ธ Configuration Variables
| Variable | Default | Description |
|---|---|---|
GITLAB_PERSONAL_ACCESS_TOKEN |
Required | Your Personal Access Token. |
GITLAB_API_URL |
https://gitlab.com/api/v4 |
Custom URL for self-hosted GitLab. |
GITLAB_USER_DISPLAY_NAME |
Argus |
The name the AI uses when posting comments. |
๐ Detailed Guides
- ๐๏ธ Architecture
- ๐ Integration Guide
- ๐ Project Overview
- ๐งช Unit Testing Guide
Developed with โค๏ธ by Faizan Shaik.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.