Back to MCP Servers

GitLab MCP Server

Official GitLab-hosted MCP server for accessing issues, merge requests, pipelines, and code search on GitLab.com or self-managed instances.

Developer Tools by GitLab OAuth2 active
Overview

The GitLab MCP server is an official, provider-hosted MCP endpoint built into GitLab. It exposes a curated set of tools for interacting with issues, merge requests, CI/CD pipelines, work item notes, and search across a GitLab instance. The server runs at /api/v4/mcp on any GitLab.com, GitLab Self-Managed, or GitLab Dedicated installation, so there is no separate process to deploy or container to run.

Authentication uses OAuth 2.0 Dynamic Client Registration. The first time an MCP client connects, it self-registers as an OAuth application and the user approves the authorization in a browser, after which scoped tokens are issued. The server implements both the MCP 2025-03-26 and 2025-06-18 protocol revisions and supports HTTP transport directly, or stdio transport via mcp-remote for clients that do not yet speak HTTP.

The capability is currently in Beta and requires a GitLab Premium or Ultimate tier with GitLab Duo enabled. It is documented for use with Claude Desktop, Claude Code, Cursor, GitHub Copilot, Gemini Code Assist, Continue, Kiro, OpenAI Codex, and Zed.

Tools

Tool Description
get_mcp_server_version Returns the current version of the GitLab MCP server.
create_issue Create a new issue in a GitLab project.
get_issue Retrieve detailed information about a specific GitLab issue.
create_merge_request Create a merge request in a GitLab project.
get_merge_request Retrieve detailed information about a specific merge request.
get_merge_request_commits Retrieve the list of commits in a specific merge request.
get_merge_request_diffs Retrieve file changes (diffs) for a specific merge request.
get_merge_request_pipelines Retrieve pipelines associated with a specific merge request.
get_pipeline_jobs Retrieve jobs for a specific CI/CD pipeline.
manage_pipeline List, create, update, retry, cancel, or delete CI/CD pipelines.
create_workitem_note Create a new comment on a GitLab work item.
get_workitem_notes Retrieve all comments for a specific work item.
search Search across the entire GitLab instance with global, group, or project scope.
search_labels Search for labels in a GitLab project or group.
semantic_code_search Semantic search for relevant code snippets within a GitLab project.
Setup Guide

Prerequisites

  • GitLab Premium or Ultimate tier (GitLab.com, Self-Managed, or Dedicated)
  • GitLab Duo enabled on the instance
  • Beta and experimental features activated (Self-Managed only)
  • Node.js 20+ only if you need stdio transport via mcp-remote

HTTP transport (recommended)

Point your MCP client at the /api/v4/mcp endpoint on your GitLab instance. The OAuth flow is triggered automatically on first connection.

{
  "mcpServers": {
    "GitLab": {
      "type": "http",
      "url": "https://gitlab.com/api/v4/mcp"
    }
  }
}

For a self-managed instance, replace the host:

{
  "mcpServers": {
    "GitLab": {
      "type": "http",
      "url": "https://gitlab.example.com/api/v4/mcp"
    }
  }
}

Stdio transport (for clients without HTTP support)

{
  "mcpServers": {
    "GitLab": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://gitlab.com/api/v4/mcp"]
    }
  }
}

Optional: tool name prefixing

If you connect multiple MCP servers and want to avoid tool name conflicts, set the X-Gitlab-Mcp-Server-Tool-Name-Prefix header (max 32 characters) on requests.

Authorization

On first connection the client performs OAuth 2.0 Dynamic Client Registration. A browser window opens prompting you to approve the scopes. Tokens are then issued and reused for subsequent calls.

Use Cases
  • Triage incoming issues by asking an agent to fetch open issues, summarize them, and create labeled follow-ups via create_issue and search_labels.
  • Review a merge request end to end: pull commits with get_merge_request_commits, inspect changes with get_merge_request_diffs, and check CI status with get_merge_request_pipelines.
  • Debug failing pipelines by listing jobs with get_pipeline_jobs and retrying or canceling them via manage_pipeline.
  • Find relevant code across a large monorepo using semantic_code_search before drafting changes or new merge requests.
  • Automate work item collaboration by reading existing notes with get_workitem_notes and posting structured updates with create_workitem_note.
Example Prompts
  • "Open the last failed pipeline on the main branch of project 1234, list its jobs, and retry the failed ones."
  • "Create a merge request from feature/login-fix into main in project acme/web titled 'Fix login redirect' and assign it to user 42."
  • "Search the GitLab instance for issues mentioning 'rate limit' in the backend group and summarize the top 5."
  • "Show me the diff and commits for MR !231 in project acme/api and tell me if there are any obvious regressions."
  • "Find code in project 987 that handles JWT validation using semantic search and propose a refactor."
Pros
  • Official, first-party server hosted directly inside GitLab with no infrastructure to manage.
  • OAuth 2.0 Dynamic Client Registration means scoped, user-approved auth without manual token creation.
  • Works against GitLab.com, Self-Managed, and Dedicated instances using the same /api/v4/mcp endpoint.
  • Includes a semantic code search tool backed by GitLab's indexed search, not just REST wrappers.
Limitations
  • Requires a paid Premium or Ultimate tier with GitLab Duo enabled.
  • Still in Beta, with a tool surface focused on issues, MRs, pipelines, and search rather than full API coverage (no direct repo file write, branch, or release management tools yet).
  • Self-Managed admins must enable beta and experimental features before the endpoint becomes available.
Alternatives
  • glab mcp serve: the official GitLab CLI ships a local MCP server that proxies through your glab authentication.
  • Community gitlab-mcp servers on npm and GitHub that wrap the REST API with a personal access token.
  • GitHub's official MCP server, if your workflow is on GitHub rather than GitLab.