Back to Marketplace
GitLab MCP server

GitLab MCP server

Installable
gitlab
GitHub

About

GitLab MCP server

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:

  1. Registers itself as an OAuth application.
  2. Requests authorization to access your GitLab data.
  3. Receives an access token for secure API access.

For a click-through demo, see GitLab Duo Agent Platform - GitLab MCP server.

<!-- Demo published on 2025-09-11 -->

Prerequisites

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.

HTTP transport (recommended)

To configure the GitLab MCP server by using HTTP transport, use this format:

  • Replace <gitlab.example.com> with:
    • On GitLab Self-Managed, your GitLab instance URL.
    • On GitLab.com, gitlab.com.
{
  "mcpServers": {
    "GitLab": {
      "type": "http",
      "url": "https://<gitlab.example.com>/api/v4/mcp"
    }
  }
}

You can add a prefix to tool names by configuring an X-Gitlab-Mcp-Server-Tool-Name-Prefix HTTP header. Prefixing can help you avoid tool name conflicts with other MCP servers or with multiple GitLab instances in your configuration.

The prefix is truncated to the first 32 characters if it exceeds this limit.

{
  "mcpServers": {
    "GitLab": {
      "type": "http",
      "url": "https://<gitlab.example.com>/api/v4/mcp",
      "headers": {
        "X-Gitlab-Mcp-Server-Tool-Name-Prefix": "gitlab_"
      }
    }
  }
}

stdio transport with mcp-remote

Prerequisites:

  • Install Node.js version 20 or later.

To configure the GitLab MCP server by using stdio transport, use this format:

  • For the "command": parameter, if npx is installed locally instead of globally, provide the full path to npx.
  • Replace <gitlab.example.com> with:
    • On GitLab Self-Managed, your GitLab instance URL.
    • On GitLab.com, gitlab.com.
{
  "mcpServers": {
    "GitLab": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://<gitlab.example.com>/api/v4/mcp"
      ]
    }
  }
}
0Installs
0Tools
0Resources
0Prompts

Categories

Development

Links

Tags

Official