OfficialDev & code hostingremote HTTP

GitLab MCP Server

Lets agents read and act on GitLab projects, issues, merge requests, repositories and CI through GitLab's own endpoint.

Install

Claude Code

(user scope, then run /mcp in a session, select GitLab and approve in the browser)

claude mcp add -s user --transport http GitLab https://<gitlab.example.com>/api/v4/mcp

To limit the toolsets from Claude Code, pass the header:

claude mcp add -s user --transport http GitLab https://<gitlab.example.com>/api/v4/mcp \
  --header "X-Gitlab-Enabled-Mcp-Server-Toolsets: core,work_items"

Codex

(add the server, enable rmcp_client in ~/.codex/config.toml, then log in)

codex mcp add GitLab --url "https://<gitlab.example.com>/api/v4/mcp"
[features]
"rmcp_client" = true

[mcp_servers.GitLab]
url = "https://<gitlab.example.com>/api/v4/mcp"
codex mcp login GitLab

Cursor

(Settings > Cursor Settings > Tools & MCP > New MCP Server, then add to mcp.json)

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

GitHub Copilot in VS Code

(Command Palette > MCP: Add Server > HTTP, server URL https://<gitlab.example.com>/api/v4/mcp, server ID GitLab, then save globally or in the workspace and approve the OAuth request)

Gemini CLI

(add to ~/.gemini/settings.json, then run /mcp auth GitLab)

{
  "mcpServers": {
    "GitLab": {
      "httpUrl": "https://<gitlab.example.com>/api/v4/mcp"
    }
  }
}

OpenCode

(add to ~/.config/opencode/opencode.json, then authenticate)

{
  "mcp": {
    "gitlab-mcp": {
      "type": "remote",
      "url": "https://<gitlab.example.com>/api/v4/mcp",
      "enabled": true
    }
  }
}
opencode mcp auth gitlab-mcp

Claude Desktop

(Settings > Developer > Edit Config; needs Node.js 20 or later on the PATH)

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

Commands and configuration as given in GitLab’s MCP server docs. Replace <gitlab.example.com> with gitlab.com on GitLab.com, or with your instance URL on Self-Managed.

The GitLab MCP server is GitLab’s built-in server that lets coding agents work with projects, issues, MRs and CI.

The GitLab MCP server is part of GitLab itself: an endpoint at https://<gitlab.example.com>/api/v4/mcp on GitLab.com, GitLab Self-Managed and GitLab Dedicated, generally available since GitLab 19.5 and in the Free, Premium and Ultimate tiers since 19.2 (GitLab docs). Through it, an agent such as Claude Code, Codex or Cursor can read project information, retrieve issue and merge request data and call GitLab APIs on your behalf.

The endpoint’s code lives in the public gitlab-org/gitlab repository under lib/api/mcp, outside the ee/ directory, which the repository’s LICENSE puts under the MIT Expat license.

Before any client connects, access to the MCP server has to be allowed: on GitLab.com for the top-level group, on Self-Managed and Dedicated for the instance. Sign-in is OAuth 2.0 with dynamic client registration, so a client registers itself as an OAuth application on first connect and asks you to approve access in the browser. GitLab also accepts a fine-grained personal access token with the MCP tool resource and the Execute permission; legacy personal, project and group access tokens are rejected with 403 Forbidden and insufficient_scope.

Tools come in toolsets. core, merge_requests, work_items, repository and ci are on by default, duo_agent_platform is listed when GitLab Duo Agent Platform is available to you, and wikis, code_security and orbit are opt-in. The X-Gitlab-Enabled-Mcp-Server-Toolsets header narrows the list (for example core,work_items) or requests all, and X-Gitlab-Mcp-Server-Tool-Name-Prefix adds a prefix to tool names. Listing a tool grants nothing: each call still checks your project and namespace permissions.

GitLab warns: “You’re responsible for guarding against prompt injection when you use these tools. Exercise extreme caution or use MCP tools only on GitLab objects you trust.”

Questions

Is the GitLab MCP server official?
Yes. GitLab builds it into GitLab and documents it on docs.gitlab.com, where it is generally available from GitLab 19.5.
Is the GitLab MCP server free?
It is available in the Free, Premium and Ultimate tiers since GitLab 19.2. Some toolsets depend on paid features: code_security tools need Ultimate features, and duo_agent_platform tools need GitLab Duo Agent Platform.
Can I use a personal access token instead of OAuth?
Only a fine-grained personal access token with the MCP tool resource and the Execute permission. Legacy personal access tokens and project or group access tokens are rejected, even with the api scope.
Does it work with GitLab Self-Managed?
Yes. Point the client at https://<your instance>/api/v4/mcp after an administrator allows access to the MCP server for the instance.

Sources

Checked October 20, 2026.

Dev & code hosting

View all
Aftergradient

What are you looking for?

Search commands, errors, tools