GitLab MCP server
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
- Status: Generally available
To provide feedback on this feature, leave a comment on issue 630189.
With the GitLab Model Context Protocol (MCP) server, you can securely connect AI tools and applications to your GitLab instance. AI assistants like Claude Desktop, Claude Code, Cursor, and other MCP-compatible tools can then access your GitLab data and perform actions on your behalf.
The GitLab MCP server provides a standardized way for AI tools to:
- Access GitLab project information.
- Retrieve issue and merge request data.
- Interact with GitLab APIs securely.
- Perform GitLab-specific operations through AI assistants.
The GitLab MCP server supports OAuth 2.0 Dynamic Client Registration, which enables AI tools to register themselves with your GitLab instance. When an AI tool connects to your GitLab MCP server for the first time, it:
- Registers itself as an OAuth application.
- Requests authorization to access your GitLab data.
- Receives an access token for secure API access.
For a click-through demo, see GitLab Duo Agent Platform - GitLab MCP server.
Prerequisites
- Allow access to the MCP server:
- On GitLab.com, for the top-level group.
- On GitLab Self-Managed and GitLab Dedicated, for the instance.
Authentication
The GitLab MCP server accepts the following tokens:
- An OAuth access token with the
mcpscope. MCP clients get this token through the OAuth flow when they connect, either with dynamic client registration or with a pre-registered OAuth application. - A fine-grained personal access token with the MCP tool resource and the Execute permission.
These tokens cannot have the mcp scope, so the GitLab MCP server rejects them, even with scopes such as api:
- Legacy personal access tokens
- Project access tokens
- Group access tokens
If you use one of these tokens, the GitLab MCP server returns 403 Forbidden.
Support for these authentication methods is proposed in issue 586184.
Connect a client to the GitLab MCP server
The GitLab MCP server supports two transport types:
- HTTP transport (recommended): Direct connection without additional dependencies.
- stdio transport with
mcp-remote: Connection through a proxy (requires Node.js).
Common AI tools support the JSON configuration format for the mcpServers key
and provide different methods to configure the GitLab MCP server settings.
To limit which tools the server returns, see Select tool groups (toolsets).
HTTP transport (recommended)
To configure the GitLab MCP server by using HTTP transport, use this format:
- Replace
<gitlab.example.com>with: