GitLab MCP Server
Enables AI-assisted code review and repository management for on-premise GitLab instances. It provides tools for interacting with merge requests, browsing source code, and searching repositories via the Model Context Protocol.
README
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.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/callback - Scopes:
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 |
|---|---|---|
GITLAB_URL |
yes | GitLab instance URL |
GITLAB_SECRETS_PATH |
yes | Path to secrets JSON file |
MCP_SERVER_BASE_URL |
yes | Server URL with https and port (e.g., https://localhost:8443) |
MCP_SSL_CERT_PATH |
yes | Path to SSL certificate |
MCP_SSL_KEY_PATH |
yes | Path to SSL private key |
SSL_CERT_FILE |
no | CA certificate for GitLab (self-signed certs) |
4. Install
pip install .
Running
gitlab-mcp
Development
pip install -e ".[dev]"
pytest
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.