Resources / MCP Server Risk Directory / GitLab MCP server
Is the GitLab MCP server safe? Risks, permissions and safe setup
GitLab teams connecting Claude, Cursor or other MCP clients to work items, merge requests and CI pipelines. Here is what an AI agent can do through it, its published vulnerabilities and how to set it up safely.
Baseline risk
- Capabilities: 40 of 40
- Read-plus-exfiltrate: +20
- Hidden instructions (publicly verified): none known
- Third-party publisher: no (official)
Before your own factors: version pinning, number of users and policy coverage. How we score
- Maker
- GitLab
- Publisher
- Official (published by the maker)
- Runs
- Remote (hosted by the maker)
- Transport
- streamable-http, stdio (via mcp-remote proxy)
- Authentication
- OAuth 2.0 via GitLab (Dynamic Client Registration, mcp scope) or a fine-grained personal access token with the MCP tool resource and Execute permission; legacy personal, project and group tokens are rejected
- Tools
- 68
- Built-in limits
- X-Gitlab-Enabled-Mcp-Server-Toolsets header selects toolsets (meta always; core, merge_requests, work_items, repository, ci and duo_agent_platform on by default; wikis, code_security, orbit opt-in); access must be allowed per top-level group (GitLab.com) or instance; no read-only mode documented
- Last verified
- 2026-11-23
What an agent can do through it
| Tool | Type | What it does |
|---|---|---|
| get_repository_file | Read | Reads a file's contents at a ref in any project the user can access |
| search | Read | Full-text search across resource types |
| get_job | Read | Retrieves a CI job, optionally with its log or artifacts |
| add_commit | Write | Commits one or more file changes to a branch |
| accept_merge_request | Write | Merges a merge request or schedules auto-merge |
| save_pipeline | Execute | Runs, retries, cancels or renames a pipeline |
| fork_repository | Write | Forks a project into a namespace |
| save_note | Send | Adds a comment or resolves a thread on issues and merge requests |
| start_duo_session | Execute | Starts an asynchronous Duo session that can push commits and open merge requests |
| save_vulnerability | Write | Changes a vulnerability record (code_security toolset) |
Read-plus-exfiltrate: this server can both read sensitive data and send data out, so a single prompt injection in content the agent reads could move private data to an outside party without any other server involved.
Known vulnerabilities
| ID | Issue | Published | Fixed in |
|---|---|---|---|
| CVE-2026-92874 Medium (CVSS 5.4) | Incorrect Authorization issue in MCP API scope enforcement impacts GitLab CE/EE Affected: 18.3 before 19.2.7, 19.3 before 19.3.3, 19.4 before 19.4.1. | 2026-09-23 | 19.2.7, 19.3.3, 19.4.1 |
| CVE-2026-92628 Low (CVSS 3.1) | Race Condition issue in MCP gitlab_search tool impacts GitLab CE/EE Affected: 18.6 before 19.2.7, 19.3 before 19.3.3, 19.4 before 19.4.1. | 2026-09-23 | 19.2.7, 19.3.3, 19.4.1 |
| CVE-2026-123142 Medium (CVSS 4.3) | Incorrect Authorization issue in GitLab MCP server impacts GitLab CE/EE Affected: 18.4 before 19.3.9, 19.4 before 19.4.8, 19.5 before 19.5.6. | 2026-11-16 | 19.3.9, 19.4.8, 19.5.6 |
Main risks
Prompt injection from issues, merge requests and job logs
LLM01:2025 Prompt Injection
GitLab's docs say users are responsible for guarding against prompt injection and should use the tools only on GitLab objects they trust. Work items, MR descriptions and CI logs can all carry attacker text into the model.
MCP token acting beyond its intended scope
ASI03 Identity and Privilege Abuse
CVE-2026-92874 and CVE-2026-123142 let MCP-scoped tokens act outside their scope, including approving and merging merge requests. Self-managed instances below the fixed versions remain exposed.
Agent merges code or runs pipelines without review
LLM06:2025 Excessive Agency
accept_merge_request, add_commit, save_pipeline and start_duo_session are in toolsets enabled by default. With no read-only mode documented, a hijacked agent can land code or run CI with the user's full role.
Private code or CI artifacts leak through public projects or comments
LLM02:2025 Sensitive Information Disclosure
The same session can read private files and job artifacts and then commit, fork or comment into a project with wider visibility. Cross-user search results were also possible under CVE-2026-92628.
How to set it up safely
- On self-managed or Dedicated, upgrade to 19.5.6, 19.4.8 or 19.3.9 or later before enabling MCP.
- Use the X-Gitlab-Enabled-Mcp-Server-Toolsets header to enable only the toolsets a task needs; leave ci, duo_agent_platform and code_security off unless required.
- Allow MCP access only for the top-level groups (GitLab.com) or instances that need it.
- Prefer OAuth with the mcp scope or a fine-grained personal access token limited to specific projects; legacy tokens are rejected by design.
- Give the agent's user the lowest project role that works (for example Reporter for read-only tasks) since no read-only mode is documented.
- Keep protected branches and required approvals so accept_merge_request cannot land unreviewed code.
- Follow GitLab's guidance to use MCP tools only on GitLab objects you trust, and avoid pointing agents at public projects with open issue comments.
- Admins who need it can turn off Dynamic Client Registration and require a pre-registered OAuth application.
How we score
Baseline scores use the method from our guide to scoring every MCP server on employee laptops. Score the servers in your own environment with the free MCP Server Risk Checklist.
1. What the server can do (capped at 40)
- Sends messages externally: 15
- Fetches arbitrary URLs: 15
- Writes to code repositories: 15
- Reads and writes databases: 15
- Writes or deletes local files: 10
- Automates a browser: 10
- Reads and writes SaaS data: 10
- Reads local files: 5
- Runs code or commands: 15 (added for this directory)
- Changes cloud infrastructure: 15 (added for this directory)
- Moves money or changes payments: 15 (added for this directory)
2. What we found
- Read-plus-exfiltrate: reads sensitive data and can also send data out: 20
- Hidden instructions in a tool description (publicly verified): 30, and always Critical
- Third-party: not published by the maker of the system it connects to: 10
3. Band
0–24 Low · 25–49 Medium · 50–74 High · 75–100 Critical.
This is a baseline. The full method also adds points for unpinned package versions, how many employees use the server and whether a policy covers it; those depend on your setup, so check them in your own environment.
How AccuroAI helps
The AccuroAI Endpoint Agent finds the MCP servers configured in AI clients on managed devices and lists the tools each local server exposes. Each server gets a risk level with its capabilities, and you can block a server once in the console to enforce the block on every device: Claude Code and Cursor refuse calls to it, and for other clients the agent stops the server process. Tool calls from coding agents can be graded by risk, then allowed, confirmed with the employee or blocked.
MCP security · MCP server inventory · How to red team an MCP server
Questions about the GitLab MCP server
Is the GitLab MCP server safe to use?
It can be, with the right setup. At baseline it scores 60 (High) in the AccuroAI method because an agent using it can writes to code repositories, reads and writes saas data, runs code or commands. Limit its scopes or tools, keep a person in the loop for write actions and pin the version you reviewed.
Does the GitLab MCP server have known vulnerabilities?
Yes. 3 published issues are listed on this page with the affected versions and the fix, as of 2026-11-23. Update to a fixed version and check the maker's advisories before approving a new release.
How do I restrict the GitLab MCP server?
Use the controls the maker provides: X-Gitlab-Enabled-Mcp-Server-Toolsets header selects toolsets (meta always; core, merge_requests, work_items, repository, ci and duo_agent_platform on by default; wikis, code_security, orbit opt-in); access must be allowed per top-level group (GitLab.com) or instance; no read-only mode documented. Then grant the narrowest token or account, approve the server centrally and block other copies of it.
Related servers
Context7 MCP Server · Git MCP Server (mcp-server-git) · GitHub MCP Server · Sentry MCP Server · All servers
Sources
- https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server/
- https://docs.gitlab.com/user/gitlab_duo/model_context_protocol/mcp_server_tools/
- https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-4-1-released/
- https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-6-released
Facts were verified on 2026-11-23 against the server’s own repository and documentation and public vulnerability records. Servers change often: check the maker’s latest release notes before approving a new version. This page is general security guidance, not a guarantee about any product.