MCP Gitlab logo

MCP Gitlab

Connects AI assistants to GitLab for project, code, merge approval, pipeline, and repository operations.

Install MCP Gitlab

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mcp-gitlab-2": {
      "command": "uvx",
      "args": [
        "mcp-gitlab"
      ],
      "env": {
        "GITLAB_URL": "YOUR_VALUE_HERE",
        "GITLAB_TOKEN": "YOUR_VALUE_HERE",
        "GITLAB_PAT": "YOUR_VALUE_HERE",
        "GITLAB_PERSONAL_ACCESS_TOKEN": "YOUR_VALUE_HERE",
        "GITLAB_API_TOKEN": "YOUR_VALUE_HERE",
        "MCP_READ_ONLY": "YOUR_VALUE_HERE",
        "GITLAB_READ_ONLY": "YOUR_VALUE_HERE",
        "GITLAB_AUTH": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Install not yet sandbox-tested— we haven't run this command through our automated sandbox yet. Not a red flag; we're working through the catalog.

Overview

mcp-gitlab exposes GitLab's REST API to AI assistants through MCP, covering projects, merge requests, pipelines, CI/CD, approvals, issues, and code review. It supports GitLab.com and self-hosted CE/EE instances and can run with write access or in a locked read-only mode. Use it when an agent needs to inspect or change GitLab projects, branches, commits, files, groups, or approval rules. The server works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, and other MCP-compatible clients.

Use cases

  • Inspect GitLab projects, branches, commits, and repository files
  • Create branches and commits through GitLab tools
  • Manage project and merge-request approval rules
  • Compare refs and search code in a GitLab project
  • Enforce read-only access for repository assistants

Key features

  • GitLab.com and self-hosted CE/EE support
  • Project, group, branch, commit, and file operations
  • Merge and approval rule management
  • Project code search and ref comparison
  • Configurable read-only mode
  • Token and OAuth-based authentication

Tools80

What MCP Gitlab lets your agent do. Expand a tool for its parameters.

Self-reported~949 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

4/4 checks healthy over the last 45d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · mcp-gitlab (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars6Stargazers on the source repository.
Last commit2d agoMost recent push to the default branch.
Tools exposed80Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How MCP Gitlab works

What mcp-gitlab does

mcp-gitlab connects MCP clients to the GitLab REST API. Its toolset covers project administration, groups, repository content, branches, commits, comparisons, approval configuration, and code search. The broader package provides 91 tools, 7 resources, and 6 prompts for GitLab workflows involving projects, merge requests, pipelines, CI/CD variables, approvals, issues, and code reviews.

It works with both GitLab.com and self-managed GitLab CE/EE installations. GitLab Duo and a Premium subscription are not required. The server belongs in workflows where an AI assistant needs to retrieve GitLab state or perform authenticated changes through explicit API operations.

How it works

The server runs over MCP and uses GitLab's REST API behind the tool calls. It is built with FastMCP 4.x, httpx, and Pydantic. The standard command starts it through uvx:

bash
uvx mcp-gitlab

By default, write tools are available. Setting MCP_READ_ONLY=true removes the write tools and write-workflow prompts from the server's advertised interface. GITLAB_READ_ONLY provides a server-specific equivalent, and the command-line read-only option can also enforce the lock.

Setup and configuration

Install uv before using the uvx flow, or install the package with uv pip install mcp-gitlab. Set GITLAB_URL to the target GitLab instance. Authentication normally uses a token supplied through GITLAB_TOKEN; the server also recognizes GITLAB_PAT, GITLAB_PERSONAL_ACCESS_TOKEN, and GITLAB_API_TOKEN in that order when selecting a token.

A personal access token uses the glpat- format and needs the api scope. OAuth2 tokens and GitLab CI job tokens are also supported. For local stdio use, mcp-gitlab auth login can sign in through GitLab's OAuth flow and store credentials locally. The stored account is associated with the GitLab URL, and an environment token takes precedence over stored credentials.

Optional settings include GITLAB_TIMEOUT, GITLAB_SSL_VERIFY, and GITLAB_AUTH. Remote HTTP deployments can require GITLAB_HTTP_BEARER_TOKEN when binding to a non-loopback host.

Tools and capabilities

The exposed operations include:

  • Retrieve, create, update, and delete projects.
  • Read and change project merge settings and approval configuration.
  • Create, list, update, and delete project and merge-request approval rules.
  • List groups and share or unshare projects and groups.
  • List, create, and delete branches.
  • List commits, retrieve commit details with an optional diff, create commits with file actions, and compare refs.
  • Read decoded file content, including optional line ranges and metadata.
  • List repository tree entries and search project code.

Code search uses the project's blob scope and depends on the search backend configured for the GitLab instance.

Limitations and notes

Read-only mode is enforced before write tools are offered and cannot be disabled at runtime once enabled. Token authentication requires suitable GitLab permissions for the requested operations. OAuth device flow requires GitLab 17.9 or later; older self-managed instances can use the browser login flow instead. The server supports the MCP 2026-07-28 specification while remaining compatible with clients using the 2025-11-25 specification.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about MCP Gitlab

mcp-gitlab is an MCP server that connects AI assistants to the GitLab REST API. Its main tools manage projects, groups, branches, commits, files, approval rules, merge settings, comparisons, and code search. It supports GitLab.com and self-hosted GitLab CE/EE instances, with configurable write or read-only operation.

Install it with `uv pip install mcp-gitlab` or run it directly with `uvx mcp-gitlab`. Configure `GITLAB_URL` and a GitLab token, then add the command to an MCP client such as Claude Code, Cursor, Windsurf, VS Code, Gemini CLI, or Codex.

Yes, mcp-gitlab works with Cursor. Add it through the available Cursor installation flow or configure the server using `uvx mcp-gitlab`, `GITLAB_URL`, and the appropriate GitLab authentication settings.

Set `MCP_READ_ONLY=true` when starting mcp-gitlab. The server then omits its write tools and write-workflow prompts, preventing the model from using those operations. `GITLAB_READ_ONLY=true` provides a per-server alias for the same lock.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewMCP Gitlab AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mcp-gitlab-2?style=directory)](https://allmcps.com/mcp/mcp-gitlab-2)
HTML Embed
<a href="https://allmcps.com/mcp/mcp-gitlab-2"><img src="https://allmcps.com/api/badge/mcp-gitlab-2?style=directory" alt="MCP Gitlab on AllMCPs" /></a>