Skip to content

Menu

GitLab MCP Server logo

GitLab MCP Server

Published

At a glance

Category
Code & Git
Hosted by the vendor
https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server/
Watch out for
On GitLab.com, MCP requests are rate limited per user at 60 per minute on Free and 600 on Premium and Ultimate, and they also count toward general rate limits.

GitLab builds this MCP server into GitLab itself. There's nothing separate to deploy: every GitLab instance exposes it at /api/v4/mcp, so on GitLab.com the endpoint is https://gitlab.com/api/v4/mcp and on a self-managed or Dedicated instance you swap in your own host. The docs list it as generally available from GitLab 19.5 on the Free, Premium and Ultimate tiers.

HTTP is the recommended transport and needs no extra software. For clients that only handle stdio, GitLab documents running it through the mcp-remote proxy, which needs Node.js 20 or later. Before anyone can connect, MCP server access has to be allowed for the top-level group on GitLab.com, or for the whole instance on self-managed.

Tools come in toolsets. meta, core, merge_requests, work_items, repository and ci are on by default, duo_agent_platform appears when GitLab Duo Agent Platform is available, and wikis, code_security and orbit are opt-in through the X-Gitlab-Enabled-Mcp-Server-Toolsets header.

How it connects

Your AI app

An assistant or agent that supports MCP

GitLab MCP Server

Runs as

  • npx (Node.js)
  • Remote (HTTP)

Gives the agent

  • Merge requests
  • Work items and issues
  • Repository access
  • CI/CD pipelines
  • Search
  • Duo sessions

GitLab

Signs in with

  • OAuth / browser sign-in
Your AI app talks to GitLab MCP Server over the Model Context Protocol, and the server carries out the work. Built from the setup and capability sections on this page.

What it can do

Merge requests
get_merge_request can pull diffs, commits, notes, pipelines and approvals in one call. save_merge_request creates or updates an MR, save_merge_request_review posts review comments or approvals, and accept_merge_request merges or schedules auto-merge.
Work items and issues
list_work_items, get_work_item and save_work_item cover issues and other work item types, and link_work_items connects them. save_note adds comments or resolves threads.
Repository access
get_repository_file and list_repository_tree read code at a ref, list_commits and get_commit inspect history, and add_branch plus add_commit can push file changes to a branch.
CI/CD pipelines
list_pipelines and get_pipeline show pipeline state, get_job can return a job log, get_artifact_file reads artifacts, and save_pipeline runs, retries or cancels a pipeline.
Search
search runs full-text search across GitLab resources, semantic_search does meaning-based search, and search_labels finds labels.
Duo sessions
With Duo Agent Platform available, start_duo_session, get_duo_session and send_duo_session_input start and steer asynchronous Duo agent sessions.

Setting it up

For Claude Code, run claude mcp add -s user --transport http GitLab https://<gitlab.example.com>/api/v4/mcp (using gitlab.com on GitLab.com), start claude, run /mcp, select GitLab and approve the OAuth page in your browser. In Cursor, go to Settings > Cursor Settings > Tools & MCP, add a new server and put an entry with "type": "http" and the same URL in mcp.json. Claude Desktop uses npx -y mcp-remote with the endpoint URL as a stdio command and needs Node.js on your PATH. Codex uses codex mcp add GitLab --url followed by the endpoint, then codex mcp login GitLab, with the rmcp_client feature enabled in ~/.codex/config.toml. Authentication is OAuth 2.0 with Dynamic Client Registration and the mcp scope. If an admin has turned DCR off, register an OAuth app with the mcp scope, untick Confidential and set its ID as clientId. Fine-grained personal access tokens with the MCP tool permission also work; legacy PATs and project or group tokens are rejected with 403.

Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)

Where it helps

  • Read a failing pipeline, pull the job log with get_job and propose a fix on a new branch.
  • Review an open merge request's diff and post review comments.
  • Create or update issues from a task list and link related work items.
  • Search a group's projects for where a function or config value is used.
  • Commit a small change across several files and open a merge request for it.

Limitations and things to watch

  • On GitLab.com, MCP requests are rate limited per user at 60 per minute on Free and 600 on Premium and Ultimate, and they also count toward general rate limits.
  • Dynamic Client Registration is limited to 10 registrations per IP per hour, which can block teams sharing one egress IP unless they use a pre-registered app.
  • code_security tools need Ultimate features, and duo_agent_platform tools only show up when Duo Agent Platform is available.
  • Write tools such as accept_merge_request and add_commit act with your permissions, and GitLab advises using the tools only on objects you trust because of prompt injection risk.

Sources

Written from the project's own documentation, checked November 2026.

How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…