🔌

GitLab MCP

DevTools450

Connect to GitLab repositories, merge requests, issues, and CI/CD pipelines.

Claude DesktopCursor

Overview

Connect to GitLab repositories, merge requests, issues, and CI/CD pipelines.

Setup

Run with npx:

npx -y @modelcontextprotocol/server-gitlab

Configuration

GITLAB_PERSONAL_ACCESS_TOKEN environment variable

Documentation

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

  1. Go to User SettingsAccess Tokens in GitLab
  2. Click Add new token
  3. Give it a name and set expiration
  4. Select scopes: read_api, write_repository, read_repository
  5. Click Create personal access token
  6. Copy the token and add it to your configuration

Available Tools

ToolDescription
list_projectsList accessible GitLab projects
get_projectGet detailed project information
list_merge_requestsList merge requests for a project
get_merge_requestGet detailed merge request information
create_merge_requestCreate a new merge request
list_issuesList issues for a project
create_issueCreate a new issue
get_issueGet detailed issue information
list_pipelinesList CI/CD pipelines for a project
trigger_pipelineTrigger a new CI/CD pipeline
get_pipeline_statusGet pipeline status and jobs
list_filesList files in a repository
get_fileGet file content from repository
search_codeSearch 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

  1. Install the MCP server:

    npm install -g @modelcontextprotocol/server-gitlab
    
  2. Add to claude_desktop_config.json:

    {
      "mcpServers": {
        "gitlab": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-gitlab"],
          "env": {
            "GITLAB_PERSONAL_ACCESS_TOKEN": "glpat-xxxxxxxxxxxx"
          }
        }
      }
    }
    
  3. 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

Resources