Overview
Connect to GitLab repositories, merge requests, issues, and CI/CD pipelines.
Setup
Run with npx:
npx -y @modelcontextprotocol/server-gitlabConfiguration
GITLAB_PERSONAL_ACCESS_TOKEN environment variableDocumentation
GitLab MCP
Overview
GitLab MCP provides seamless integration between AI assistants and GitLab, enabling developers to work with repositories, merge requests, issues, and CI/CD pipelines directly from their AI coding environment. This MCP server brings GitLab's powerful DevOps platform capabilities into Claude Desktop, Cursor, and other MCP-compatible clients.
With GitLab MCP, you can search code, review merge requests, manage issues, trigger pipelines, and more — all through natural language conversations with your AI assistant.
Features
- Repository Access: Browse files, search code, and explore project structures
- Merge Request Management: Create, review, and manage merge requests
- Issue Tracking: Create, update, and search issues
- CI/CD Pipeline Control: Trigger pipelines, view job logs, and manage deployments
- Snippet Management: Create and manage code snippets
- Wiki Access: Read and edit project wikis
Installation
npx -y @modelcontextprotocol/server-gitlab
Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"gitlab": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-gitlab"],
"env": {
"GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxx"
}
}
}
}
Or set as environment variable:
export GITLAB_PERSONAL_ACCESS_TOKEN="glpat-xxxxxxxxxxxx"
npx -y @modelcontextprotocol/server-gitlab
Creating a GitLab Personal Access Token
- Go to User Settings → Access Tokens in GitLab
- Click Add new token
- Give it a name and set expiration
- Select scopes:
read_api,write_repository,read_repository - Click Create personal access token
- Copy the token and add it to your configuration
Available Tools
| Tool | Description |
|---|---|
list_projects | List accessible GitLab projects |
get_project | Get detailed project information |
list_merge_requests | List merge requests for a project |
get_merge_request | Get detailed merge request information |
create_merge_request | Create a new merge request |
list_issues | List issues for a project |
create_issue | Create a new issue |
get_issue | Get detailed issue information |
list_pipelines | List CI/CD pipelines for a project |
trigger_pipeline | Trigger a new CI/CD pipeline |
get_pipeline_status | Get pipeline status and jobs |
list_files | List files in a repository |
get_file | Get file content from repository |
search_code | Search code across repositories |
Usage Examples
Search for Code
Search for all files containing "authentication" in the my-project repository
Review a Merge Request
Show me the details and diff for merge request #42 in my-project
Create an Issue
Create an issue in my-project titled "Fix login bug" with description "Users are unable to log in when using SSO"
Trigger a Pipeline
Trigger a CI/CD pipeline for the main branch in my-project
Get Pipeline Logs
Show me the logs for the latest failed pipeline job in my-project
Claude Desktop Setup
-
Install the MCP server:
npm install -g @modelcontextprotocol/server-gitlab -
Add to
claude_desktop_config.json:{ "mcpServers": { "gitlab": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-gitlab"], "env": { "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxx" } } } } -
Restart Claude Desktop
Pros
- ✅ Direct GitLab API integration
- ✅ Full repository access
- ✅ CI/CD pipeline management
- ✅ Issue and merge request workflows
- ✅ Code search capabilities
Cons
- ❌ Requires personal access token
- ❌ Self-hosted GitLab may need additional configuration
- ❌ Rate limits apply for API calls
