# GitLab (official)

> GitLab's own MCP server, built into every GitLab instance - merge requests, work items, pipelines and code, over OAuth.

[Canonical HTML page](https://top-mcps.com/mcp/gitlab-mcp-server) · [server.json](https://top-mcps.com/mcp/gitlab-mcp-server.json) · [methodology](https://top-mcps.com/about/methodology)

## Install

### Claude Desktop — `claude_desktop_config.json`

Claude Desktop launches stdio servers, so mcp-remote bridges to the hosted endpoint and opens the sign-in in your browser. On Pro, Max, Team and Enterprise you can skip the file: Settings → Connectors → Add custom connector → https://gitlab.com/api/v4/mcp. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

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

### Claude Code — `CLI or .mcp.json`

Then run /mcp inside Claude Code to finish the sign-in. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```shell
claude mcp add --transport http gitlab-mcp-server https://gitlab.com/api/v4/mcp
```

### Cursor — `.cursor/mcp.json`

Global path: ~/.cursor/mcp.json. Cursor shows "Needs login" once it connects — click it to authorize. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```json
{
  "mcpServers": {
    "gitlab-mcp-server": {
      "url": "https://gitlab.com/api/v4/mcp"
    }
  }
}
```

### VS Code — `.vscode/mcp.json`

VS Code uses the "servers" key. Run MCP: List Servers → Start Server and allow the sign-in. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```jsonc
{
  "servers": {
    "gitlab-mcp-server": {
      "type": "http",
      "url": "https://gitlab.com/api/v4/mcp"
    }
  }
}
```

### Windsurf — `~/.codeium/windsurf/mcp_config.json`

Windsurf uses "serverUrl" for hosted servers. Open via Cascade → hammer icon → Configure. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```json
{
  "mcpServers": {
    "gitlab-mcp-server": {
      "serverUrl": "https://gitlab.com/api/v4/mcp"
    }
  }
}
```

### Cline — `cline_mcp_settings.json`

Bridged through mcp-remote. Open via the Cline sidebar → MCP Servers → Edit. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

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

### Continue — `~/.continue/config.json`

Continue takes the hosted URL directly in the transport block. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```json
{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "transport": {
          "type": "streamable-http",
          "url": "https://gitlab.com/api/v4/mcp"
        }
      }
    ]
  }
}
```

### Codex CLI — `CLI`

Codex detects OAuth support and opens the browser to authorize. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```shell
codex mcp add gitlab-mcp-server --url https://gitlab.com/api/v4/mcp
```

### Zed — `~/.config/zed/settings.json`

Bridged through mcp-remote under "context_servers". Settings live-reload on save. Authorization happens in the browser on first use (OAuth); no token goes in the config file.

```jsonc
{
  "context_servers": {
    "gitlab-mcp-server": {
      "command": {
        "path": "npx",
        "args": [
          "-y",
          "mcp-remote",
          "https://gitlab.com/api/v4/mcp"
        ]
      }
    }
  }
}
```

### ChatGPT — `ChatGPT → Settings → Connectors (remote URL)`

Paste this into Settings → Connectors → Add custom connector. Requires ChatGPT Pro / Team / Enterprise / Edu with Developer mode enabled.

```json
{
  "name": "GitLab (official)",
  "transport": "http",
  "url": "https://gitlab.com/api/v4/mcp"
}
```

## At a glance

- **Maintainer:** GitLab
- **Transport:** Streamable HTTP
- **Auth model:** OAuth 2.1
- **Required secrets:** None
- **Supported clients:** Claude, Claude Code, Cursor, VS Code, Any MCP-compatible client
- **Latest version:** remote
- **MCP spec:** 2025-11-25 (1 revision behind)
- **Ships in official plugins:** [gitlab](https://github.com/anthropics/claude-plugins-official/tree/main/external_plugins/gitlab) (Claude plugin directory, install: `/plugin install gitlab@claude-plugins-official`)
- **Evidence:** GitLab docs (mcp_server page) list supported protocol versions 2025-11-25, 2025-06-18 and 2025-03-26; https://gitlab.com/api/v4/mcp answers 401 without a token; plugin: claude-plugins-official external_plugins/gitlab .mcp.json; read 2026-11-09
- **Last verified:** 2026-11-09
- **Score:** 58/100 (rubric 2027-01 — see https://top-mcps.com/about/methodology)
- **Homepage:** https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server/

## Tools & permissions

| Tool | Description | Args | Side effects |
|------|-------------|------|--------------|
| `get_merge_request` | Retrieve a merge request, optionally with diffs, commits, notes, pipelines and conflicts. | `—` | read |
| `list_merge_requests` | List or search merge requests in a project or group. | `—` | read |
| `save_merge_request` | Create a merge request, or update one when an IID is given. | `—` | write |
| `save_merge_request_review` | Post review notes or diff comments, and approve or unapprove. | `—` | write |
| `accept_merge_request` | Merge a merge request now, or schedule auto-merge. | `—` | write |
| `get_work_item` | Retrieve a work item, optionally with notes, discussions and related MRs. | `—` | read |
| `save_work_item` | Create or update a work item (recommended over create_issue). | `—` | write |
| `get_repository_file` | Read a file's committed content at a given ref. | `—` | read |
| `add_commit` | Commit one or more file changes to a branch in one call. | `—` | write |
| `get_pipeline` | Retrieve a pipeline, optionally with jobs, downstream pipelines or artifacts. | `—` | read |
| `get_job` | Retrieve a job's metadata, and optionally its log or artifacts. | `—` | read |
| `save_pipeline` | Create, retry, cancel or rename a pipeline. | `—` | write |
| `search` | Search across GitLab. | `—` | read |

## Security & scope

- **Access scope:** read-write
- **Sandbox:** Runs inside GitLab and acts as the authorising user, within that user's project and group permissions. OAuth grants carry the `mcp` scope; fine-grained tokens carry the MCP tool resource.
- **Gotchas:**
  - accept_merge_request and add_commit act immediately under the user's permissions; branch protection and merge rules are the guard, so keep them on default branches.
  - On Self-Managed and Dedicated an administrator must enable MCP access before any client can connect.
  - Over stdio the server is reached through the mcp-remote proxy, which needs Node.js 20 or later.

## Quick answer

**What it does.** Exposes GitLab through toolsets: core (projects, users, to-dos, search, comments), merge_requests (get, list, save, review, accept), work_items (get, list, save, link, saved views), repository (files, tree, branches, commits, tags, releases, fork, add_commit), ci (pipelines, jobs, artifacts, save_pipeline) and duo_agent_platform, with wikis, code_security and orbit opt-in through the X-Gitlab-Enabled-Mcp-Server-Toolsets header.

**Best for:**
- Merge request review and approval
- Work item triage and linking
- Reading and retrying pipelines
- Committing file changes from an agent
- Self-managed GitLab at 19.5 or later

**Not for:**
- GitLab instances before 19.5
- Setups that only have legacy personal access tokens
- Security dashboards without GitLab Ultimate (code_security toolset)

## Description

The official GitLab MCP server ships inside GitLab itself at `https://<your-instance>/api/v4/mcp` (https://gitlab.com/api/v4/mcp on GitLab.com). It is generally available since GitLab 19.5, in the Free tier since 19.2, on GitLab.com, Self-Managed and Dedicated. Agents review and merge MRs, create and link work items, read files and commits, commit changes, and inspect or retry pipelines, authorised per user through OAuth with the `mcp` scope.

## Why it matters

It runs inside GitLab, so it follows the instance's own permissions and audit trail and works on self-managed GitLab without a separate process. Authorisation is an OAuth grant or a fine-grained token with the MCP permission rather than a broad personal access token exported into a config file.

## Key features

- Built into GitLab at /api/v4/mcp - no separate server
- Generally available since GitLab 19.5; Free tier since 19.2
- OAuth 2.0 with the mcp scope via dynamic client registration, or fine-grained tokens
- Toolsets selectable per connection by header
- GitLab.com, Self-Managed and Dedicated

## FAQ

### Is this different from the community GitLab MCP?

Yes, and both are listed. This server is built into GitLab and authorised per user through OAuth or a fine-grained token. The community server (zereight/gitlab-mcp) runs locally with a personal access token, which is the route for instances older than GitLab 19.5 or where an administrator has not enabled MCP access.

### Does it work on self-managed GitLab?

Yes, from GitLab 19.5, on Self-Managed and Dedicated as well as GitLab.com. Use `https://<your-instance>/api/v4/mcp` as the URL; an administrator must allow MCP server access for the instance first.

### Which tokens does it accept?

An OAuth 2.0 access token with the `mcp` scope, obtained through dynamic client registration or a pre-registered OAuth application, or a fine-grained personal access token with the MCP tool resource and Execute permission. Legacy personal, project and group access tokens are rejected.

### Is it free?

The server is in the Free tier since GitLab 19.2. Some toolsets need more: code_security tools need GitLab Ultimate features, and the duo_agent_platform tools need GitLab Duo Agent Platform.

### Can I limit which tools the agent sees?

Yes. Send the `X-Gitlab-Enabled-Mcp-Server-Toolsets` header to pick toolsets. meta, core, merge_requests, work_items, repository, ci and duo_agent_platform are on by default; wikis, code_security and orbit are opt-in.

## Changelog

- **2026-11-09** — Added alongside the community GitLab server: GitLab's built-in MCP server is generally available since GitLab 19.5 and bundled by the Claude gitlab plugin.
