MCP ServerOfficialHTTP

GitLab MCP Server

GitLab ships an official MCP server on its own API, exposing merge requests, CI/CD pipelines, job logs, issues, work items and semantic code search as tools. Any MCP client can review a merge request, read why a pipeline failed, or search a codebase — on GitLab.com or your own Self-Managed instance.

Hosted URL

https://gitlab.com/api/v4/mcp

Suggested model

Claude Sonnet 5

Chat with 60+ AI models on the same workflow — switch to a different model mid-conversation and re-run the same prompt, or use Compare mode to put several side-by-side and balance quality vs. cost.

Auth

OAuth against GitLab with the `mcp` scope, or a personal access token. Self-Managed uses the same path on your own host.

What the GitLab MCP server does

How models use it and what it is built for.

The GitLab MCP server lives on the GitLab API itself at /api/v4/mcp rather than being a wrapper someone else maintains, so it tracks the platform directly and works the same way against GitLab.com and Self-Managed instances. Its strongest area is the merge-request and pipeline loop: an agent can list and read merge requests, pull their diffs, commits, notes and pipelines, and post review comments back. On the CI side it can list pipelines, fetch jobs and — most usefully for debugging — retrieve raw job logs, then run, retry or cancel a pipeline. It also covers issues and work items, wiki pages, label and instance-wide search, and semantic code search that returns relevant snippets rather than literal string matches.

Tools the GitLab MCP server exposes

Typical tools an AI model can call. Exact names vary by version.

  • list_merge_requests / get_merge_request — search MRs and read them with diffs, commits, notes and pipelines
  • get_merge_request_diffs / get_merge_request_commits — the actual change under review
  • create_merge_request / create_merge_request_note — open MRs and post review comments
  • list_pipelines / get_pipeline / get_pipeline_jobs — CI/CD state
  • get_job_log — raw trace output for a failed job, which is what you actually need to debug
  • save_pipeline / manage_pipeline — run, retry, cancel or delete a pipeline
  • create_issue / get_issue / create_workitem_note / link_work_items — issue and work-item tracking
  • search / search_labels / semantic_code_search — instance-wide search and meaning-based code lookup
  • get_repository_file / add_branch / list_wiki_pages — repository and wiki reads

Connecting to GitLab

Taken from the official GitLab documentation — see GitLab MCP server docs for the full reference.

URL format

https://<your-gitlab-host>/api/v4/mcp

Examples

GitLab.com

https://gitlab.com/api/v4/mcp

The hosted instance. Authorises over OAuth with the `mcp` scope.

GitLab Self-Managed

https://gitlab.example.com/api/v4/mcp

Same path on your own host — swap in your instance domain.

Example prompts to try

Copy any of these into MCP Agent Studio after connecting.

  • Read the diffs on merge request !412 and tell me what could break in production.

  • Pipeline 88231 failed — pull the job log and explain the root cause.

  • Find where we handle refund idempotency in this project using semantic code search.

  • List open merge requests older than two weeks and summarise what each is blocked on.

Models on MCP Playground

This is not a single-model product: you get the same MCP connection with 60+ models (Claude, GPT, Gemini, DeepSeek, open-weight, and more), you can switch mid-conversation, and you can open Compare mode to run the same prompt against multiple models at once. The card above is a suggested starting point for this server — not the only choice.

Default pick for GitLab

Claude Sonnet 5

Reading a diff and a failed job log together is a reasoning task, not a retrieval one — Sonnet 5 holds both in context and explains the failure rather than restating the log.

Check an AI agent can actually use the GitLab MCP server

Listing tools proves the server is reachable, not that a model can work with it. Evals go further: they read every tool on the server, write a test suite from its real schemas, and run it — code decides pass/fail on the responses (schema conformance, error codes, pagination, result caps) while a scoring model grades plain-English tasks driven through the tools.

Get a pass/fail report per tool with the evidence behind each verdict — and replay the same suite after every schema change. Destructive tools are excluded from the run.

Run evals

Try the GitLab MCP server in your browser

Open MCP Agent Studio with the connection pre-filled. Add your token, pick any of 60+ models, and start chatting — no install required.

Open Agent Studio

GitLab MCP server — FAQ

Common questions about connecting, scoping and using it safely.

Does GitLab have an official MCP server?

Yes. It is served by the GitLab API itself at /api/v4/mcp — on GitLab.com that is https://gitlab.com/api/v4/mcp — and documented in GitLab's own docs. Because it is part of the API rather than a third-party wrapper, it tracks platform changes directly and does not depend on an outside maintainer keeping up.

Does it work with GitLab Self-Managed?

Yes, at the same path on your own host: https://gitlab.example.com/api/v4/mcp. This is one of the clearer advantages over community GitLab MCP servers, which often assume gitlab.com. For self-managed instances behind a VPN, your MCP client needs network access to the host like any other API consumer.

What authentication does the GitLab MCP server use?

OAuth against GitLab, with a dedicated `mcp` scope — its protected-resource metadata lists gitlab.com as the authorization server and `mcp` as the only supported scope. A personal access token also works. Either way the agent acts with your permissions, so scope the token to the projects you actually want reachable.

What can it do that a plain Git clone cannot?

The useful surface is everything around the code rather than the code itself: merge-request discussions, CI pipeline state, and raw job logs via get_job_log. "Why did this pipeline fail" is a question a clone cannot answer. It also offers semantic_code_search, which returns relevant snippets by meaning rather than the literal-string matching you get from grep.

Can an agent approve or merge my merge requests?

The documented tools cover creating merge requests, posting notes, and managing pipelines — running, retrying, cancelling and deleting. Pipeline control is the one to think about before granting write access, since retrying a deploy pipeline has real consequences. Start read-only and watch the calls in MCP Agent Studio before you widen the token.

Other MCP servers

More on MCP Playground

GitLab MCP Server — Official Hosted MCP at gitlab.com