GitLab MCP Server
Provides tools for interacting with GitLab instances to manage merge requests, browse repository trees, search code, and handle project-level operations such as commits, branches, and discussions.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@GitLab MCP ServerSummarize the changes in merge request #45 for the mobile app project"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GitLab MCP Server
MCP (Model Context Protocol) server for AI-assisted code review with GitLab on-premise instances.
Features
Merge Request Tools
List, get, create, update merge requests
Set MR draft status
List changed files, get one file's diff or all MR changes
Get MR commits and pipelines
Get notes and discussions, add notes, start discussions on the MR or on a diff line
Reply to, resolve, edit and delete comments
Approve, unapprove, merge MRs
Repository Tools
List projects
Browse repository tree
Get file content, whole or by line range, and blame
Search code
List branches and commits
Related MCP server: GitLab MCP Server
Security Model
Uses OAuth with intersection-based access control:
User authenticates via GitLab OAuth
AI access limited to repos both user AND service account can access
All API calls made with service account token for audit trail
Prerequisites
Python 3.11+
GitLab instance with OAuth application configured
SSL certificate for HTTPS
Setup
1. GitLab OAuth Application
Create in GitLab Admin > Applications:
Redirect URI:
https://<server-host>:<port>/oauth/callbackScopes:
read_user,read_api,read_repository,api(for write operations)Confidential: Yes
2. Secrets File
Create a JSON file with credentials:
{
"oauth_client_id": "<gitlab-oauth-app-id>",
"oauth_client_secret": "<gitlab-oauth-app-secret>",
"service_token": "<service-account-personal-access-token>"
}3. Environment Variables
Variable | Required | Description |
| yes | GitLab instance URL |
| yes | Path to secrets JSON file |
| yes | Bind URL with protocol and port (e.g., |
| yes | Client-facing URL (e.g., |
| when bind uses https | Path to SSL certificate |
| when bind uses https | Path to SSL private key |
| no | CA certificate for GitLab (self-signed certs) |
4. Install
pip install .Running
gitlab-mcpDocker
Each release is published to the GitHub Container Registry:
docker pull ghcr.io/synclyai/gitlab-mcp:1.1.1
docker pull ghcr.io/synclyai/gitlab-mcp:latestTo build locally instead, the image installs a pre-built wheel and dist/ is the build context:
make imageEquivalent to building the wheel into an emptied dist/ and running
docker build -f Dockerfile -t ghcr.io/synclyai/gitlab-mcp:<version> dist/, so a local build
carries the same name as the published image. The wheel is built
with venv/bin/python, so the dev extra must be installed.
Development
pip install -e ".[dev]"
pytestThis server cannot be deployed
Maintenance
Related MCP Connectors
AI-native git hosting — repos, PRs, issues, CI gates, and AI code review over MCP (60 tools).
Git-backed platform for skills, tools, and context for AI agents
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides GitLab integration for AI assistants using Model Context Protocol, enabling repository operations, file management, issue tracking, merge requests, and branch/tag administration through natural language.2-
- AlicenseBqualityBmaintenanceEnables AI-powered exploration and interaction with GitLab instances through comprehensive search, code browsing, and repository management. Supports both self-hosted and GitLab.com with flexible authentication for read and write operations.63166 npm10MIT
- AlicenseNot gradedqualityCmaintenanceIntegrates GitLab with AI assistants to manage merge requests, analyze CI/CD pipelines, and create Architecture Decision Records. It enables seamless code searching, pipeline triggering, and deployment management through the Model Context Protocol.1MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with GitLab by wrapping the REST API v4 into executable tools for repository and branch management. It supports operations like creating projects, managing branches, and retrieving user information through the Model Context Protocol.11 npm1ISC