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 "Install 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 merge requests
Get MR changes, commits, pipelines
Get and add discussions/comments
Approve, unapprove, merge MRs
Repository Tools
List projects
Browse repository tree
Get file content and blame
Search code
List branches and commits
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.10+
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:
3. Environment Variables
Variable | Required | Description |
| yes | GitLab instance URL |
| yes | Path to secrets JSON file |
| yes | Server URL with https and port (e.g., |
| yes | Path to SSL certificate |
| yes | Path to SSL private key |
| no | CA certificate for GitLab (self-signed certs) |