GitLab MCP server security: scopes, permissions and lock down

The GitLab MCP server accepts OAuth tokens with the mcp scope or fine-grained personal access tokens, and limits tools through toolsets and, on Premium and Ultimate, per-tool governance. This page explains what to restrict before approval.

On this page

Does the GitLab MCP server meet our scope and permission requirements?

The GitLab MCP server is a built-in, generally available server from GitLab, not a community project, and an approver can lock it to specific tokens, tool groups and actions. Token acceptance and toolset limits are available across the Free, Premium and Ultimate tiers, while per-tool Always Allow, Always Ask or Always Deny rules apply only on Premium and Ultimate and are marked beta in the docs. Before approving, confirm which tier you hold, since the feature set differs by tier and by GitLab version.

On the token side, the server accepts an OAuth access token with the mcp scope or a fine-grained personal access token with the MCP tool resource and the Execute permission. It rejects legacy personal, project and group access tokens with a 403 and an insufficient_scope error, even when those tokens carry api or mcp. Use the GitLab MCP server docs to confirm the current token types, then require a written policy that names who may create fine-grained tokens and how long they last. Listing a tool does not grant access, because each call still checks the user's project and namespace permissions, so a broad token can still only reach what that user already may touch.

The toolset header X-Gitlab-Enabled-Mcp-Server-Toolsets narrows which tool groups the server returns. The default set includes core, merge_requests, work_items, repository and ci, while wikis, code_security and orbit are opt-in. The code_security tools (list_vulnerabilities, get_vulnerability and save_vulnerability) also need the security dashboard, an Ultimate feature. The gap to close is that toolsets limit discovery but not every write path, so review the tool reference for Write and Delete tools, set Always Ask or Always Deny for them where tier allows, and confirm in your own instance which toolsets each client actually receives.

Security controls by edition and deployment

This table shows which GitLab MCP server access controls apply on Free, Premium and Ultimate, including token types, toolset limits and tool governance. Read each row as a question to confirm for your tier and deployment before approving a client. The main takeaway is that token rules apply on every tier, while per-tool governance and the code_security tools depend on Premium or Ultimate.

ControlFreePremiumUltimate
OAuth access token with mcp scopeAccepted with the mcp scopeAccepted with the mcp scopeAccepted with the mcp scope
Fine-grained PAT with MCP tool resourceAccepted with Execute permission on the MCP tool resourceAccepted with Execute permission on the MCP tool resourceAccepted with Execute permission on the MCP tool resource
Legacy PATs, project and group access tokensRejected with 403 Forbidden and insufficient_scope, even with api or mcp scopeRejected with 403 Forbidden and insufficient_scope, even with api or mcp scopeRejected with 403 Forbidden and insufficient_scope, even with api or mcp scope
Toolset header (X-Gitlab-Enabled-Mcp-Server-Toolsets)Limits returned tool groups; default set includes core, merge_requests, work_items, repository and ciSame header and default set; opt-in sets are wikis, code_security and orbitSame header and default set; opt-in sets are wikis, code_security and orbit
Per-tool governance (beta)Not available on this tierAlways Allow, Always Ask or Always Deny per tool; Read, Write and Delete categoriesAlways Allow, Always Ask or Always Deny per tool; Read, Write and Delete categories
code_security tools (list, get and save vulnerability)Need the security dashboard, which is an Ultimate feature, so not usable hereNeed the security dashboard, which is an Ultimate feature, so not usable hereUsable when the security dashboard is in place
stdio transport through mcp-remoteAvailable; the client needs Node.jsAvailable; the client needs Node.jsAvailable; the client needs Node.js
Deployment availabilityGitLab.com, Self-Managed and Dedicated; moved to Free in GitLab 19.2GitLab.com, Self-Managed and DedicatedGitLab.com, Self-Managed and Dedicated; generally available since GitLab 19.5

How the server enforces scopes, toolsets and per-user permissions

The authoritative access decision for the GitLab MCP server happens when a tool is called, not when it is listed. An AI client authenticates to the instance endpoint at /api/v4/mcp using an accepted token, which is either an OAuth access token carrying the mcp scope or a fine-grained personal access token with the MCP tool resource and the Execute permission. The server rejects legacy personal access tokens, project access tokens and group access tokens with 403 Forbidden and an insufficient_scope error, even when their scope is mcp or api, so reviewers should confirm that no team is relying on a token type outside that list. The X-Gitlab-Enabled-Mcp-Server-Toolsets header controls which tool groups the server returns to the client. The opt-in toolsets are wikis, code_security and orbit, and the default set includes core, merge_requests, work_items, repository and ci. Reducing that header is the first lever for narrowing what a client can see.

Listing a tool does not grant access. According to the GitLab docs, each tool still checks the user's project and namespace permissions when it is called, so an agent acting for a developer can only read or change what that developer could already reach in the UI or API. The practical consequence is that the identity behind the token matters more than the client configuration. Before rollout, confirm with the GitLab administrator which accounts will authorize clients, whether any of them hold elevated roles on sensitive projects, and whether service accounts are being used to share one token across many people. Shared tokens would blur the per-user boundary that these checks depend on.

Agent tool governance sits on top of these checks, not in place of them. On Premium and Ultimate, GitLab's governance feature can set Always Allow, Always Ask or Always Deny per tool for tools served by the GitLab MCP server, and the docs sort those tools into Read, Write and Delete categories. Because the rules apply only to tools served by the GitLab MCP server, they do not cover actions a client takes through its own shell, a separate MCP server or a direct API call, so those paths need their own controls. The docs mark this feature as beta, so reviewers should confirm its current behavior and tier with GitLab before writing it into an approval policy. The code_security tools list_vulnerabilities, get_vulnerability and save_vulnerability also depend on the security dashboard, which is an Ultimate feature.

Decisions to make before enabling AI clients

Each GitLab MCP server choice changes what an AI client can see and change in your instance. The decisions below connect token type, toolsets, approval rules, write permissions, developer token creation and transport, so review them together before any client is connected.

Token type for each client

Decide whether each AI client authenticates with an OAuth access token carrying the mcp scope or with a fine-grained personal access token that has the MCP tool resource and the Execute permission. OAuth ties access to an individual user's sign-in and is easier to revoke per person. A fine-grained token is a standing credential that someone must store and rotate. The server rejects legacy personal, project and group access tokens even when they carry the api scope, so confirm every client uses one of the two accepted types before rollout.

MCP server docs

Toolsets beyond the defaults

The default toolsets cover core, merge_requests, work_items, repository and ci. The opt-in toolsets are wikis, code_security and orbit, and each is enabled through the X-Gitlab-Enabled-Mcp-Server-Toolsets header. Enabling wikis widens what the client can read in documentation, while code_security exposes vulnerability tools that need the security dashboard, an Ultimate feature. Enable only the groups a team has a documented use for, and confirm the tier before assuming a tool is available.

MCP server tools

Relying on beta per-tool rules

On Premium and Ultimate, agent tool governance lets admins set Always Allow, Always Ask or Always Deny for each tool. The docs mark this feature as beta, so its behavior may change between releases. Use Always Deny for delete and high-risk write tools as a backstop, but do not treat Always Ask as the only control for sensitive actions. Test the rules against your own tiers and tool names before depending on them, and pair them with token scope and toolset limits.

Tool governance docs

Allowing write and delete categories

The docs sort tools into Read, Write and Delete categories. Read tools let a client list and retrieve GitLab data, while write tools can create or change issues, merge requests and pipelines, and delete tools remove content. Decide per team whether write access is needed at all, since a read-only use case avoids most change risk. Where writes are allowed, keep them tied to the user's own project and namespace permissions, because listing a tool does not grant access to act on it.

Developer-created fine-grained tokens

Decide whether developers may create their own fine-grained personal access tokens for the MCP server or whether tokens are issued centrally. Self-service tokens spread standing credentials across laptops and tools, and each one needs an owner, an expiry and a revocation path. Centrally issued tokens or OAuth sign-in give security teams a shorter list of credentials to review. Confirm with your administrators which token creation settings your instance and tier provide.

HTTP transport or stdio through mcp-remote

The docs recommend the HTTP transport at the instance's /api/v4/mcp endpoint. The stdio path runs through mcp-remote and requires Node.js on each developer machine, which adds a local runtime and package to manage. HTTP keeps the connection under the server's own authentication and is simpler to review centrally. Choose stdio only where a client requires it, and record the Node.js version and mcp-remote package each workstation uses.

How the lockdown differs by tier and deployment

The GitLab MCP server is generally available on GitLab.com, GitLab Self-Managed and GitLab Dedicated, after moving from beta in GitLab 19.5. The deployment model changes who operates the instance and which settings your team can change, but the token rules and per-call permission checks are the same across all three. Confirm the version each instance runs before you assume a control exists.

  • GitLab.com: The endpoint is the instance URL followed by /api/v4/mcp, with the host set to gitlab.com. GitLab operates the service, so your team controls user access and client configuration rather than server upgrades.
  • Self-Managed: Your administrators control the upgrade schedule, so the governance and toolset behavior you test must match the version you actually run.
  • GitLab Dedicated: Ask GitLab which administrative settings your tenant exposes for MCP access and tool governance, since the available switches may differ from Self-Managed.
  • Token rules on every deployment: Legacy personal access tokens, project access tokens and group access tokens receive 403 Forbidden with an insufficient_scope error, so the same credential policy applies everywhere.

Before approval, record the GitLab version, the tier and the deployment model for each instance, then confirm the controls against that exact combination.

Gaps to cover before approval

The GitLab MCP server narrows what an AI client sees, but several controls depend on the plan tier, the beta status of some features, and the user's own rights. Each gap below names what the reviewer must confirm and the usual way to close it before approval.

Per-tool governance is beta

Always Allow, Always Ask and Always Deny rules for GitLab MCP tools exist only on Premium and Ultimate, and the docs mark this feature as beta. Treat it as a control to verify in your own instance, not a guarantee. Confirm the tier, test that a Read, Write or Delete tool actually prompts or is blocked as configured, and keep a documented fallback such as narrowing user permissions for tools that matter most.

Tool governance docs

Token rejection has limits

The server rejects legacy personal, project and group access tokens, but staff can still create fine-grained personal access tokens with the MCP tool resource and Execute permission, or use OAuth tokens with the mcp scope. Review which token types your policy permits, check how fine-grained tokens are created and expiring, and decide whether each user's token should be the only credential route approved for MCP clients.

MCP server docs

Toolsets narrow the listing only

The X-Gitlab-Enabled-Mcp-Server-Toolsets header limits which tool groups the server returns, but listing a tool does not grant access, and each call still checks the user's project and namespace permissions. A toolset choice therefore reduces what a client sees, not what the user can do. Pair toolset limits with least-privilege user roles and a review of project memberships for anyone using an AI client.

Dedicated service accounts

Because every tool call runs with the connected user's rights, an AI client used by an account with broad access can reach far more than its purpose requires. Consider a dedicated service account with narrow group and project membership for automation, and confirm with GitLab how that account's tokens and audit trail appear. Document who owns the account and how it is reviewed.

Code security needs Ultimate

The code_security tools list_vulnerabilities, get_vulnerability and save_vulnerability depend on the security dashboard, which is an Ultimate feature. Premium and Free instances cannot expose these tools in practice, and a team that expects them should confirm its tier before planning the rollout. Limit the code_security toolset to Ultimate groups, and check that save_vulnerability, which writes, is restricted to named reviewers.

MCP server tools

Audit of individual tool calls

The supplied documentation does not establish what GitLab records for each MCP tool call, including which tool ran, with what arguments, and whether it was allowed, prompted or denied. Before approval, ask GitLab in writing which audit events and retention apply to MCP activity, and confirm whether instance audit events cover it. Until that is answered, do not assume a complete record of agent actions exists.

Client machine sandboxing

The GitLab server controls what the connected client may request, but it does not sandbox the AI client itself. Commands the client runs, files it reads on a laptop, and credentials stored in its configuration sit outside the server's control. Review the client's own permission and sandbox settings, the stdio transport that requires Node.js, and where tokens are stored in each client configuration before approving it.

Order of work to lock down the GitLab MCP server

This sequence takes the GitLab MCP server from a default connection to a locked configuration in which only the intended users, tokens, toolsets and tools remain reachable, with evidence for each control.

  1. Confirm tier and GitLab version

    The platform owner confirms the GitLab edition (GitLab.com, Self-Managed or Dedicated), the exact version, and the tier. The MCP server is generally available on all three deployment types, and it is listed in the Free, Premium and Ultimate tiers. Per-tool governance requires Premium or Ultimate, and the code_security tools list_vulnerabilities, get_vulnerability and save_vulnerability need the security dashboard, an Ultimate feature. Record the tier and version in the change ticket, because the available controls depend on both. Done when the tier and version are written down and each later control is checked against them.

  2. Restrict accepted token types at admin level

    The GitLab administrator decides which credential types AI clients may use. The server accepts an OAuth access token with the mcp scope or a fine-grained personal access token with the MCP tool resource and the Execute permission. It rejects legacy personal, project and group access tokens with 403 Forbidden and an insufficient_scope error, even when those tokens carry the mcp or api scope. Confirm that your standard client configurations use only the accepted types, and test one rejected token to confirm the refusal. Done when a legacy token fails with the expected error and every approved client authenticates with an accepted type.

  3. Set the toolsets header to the smallest set

    The X-Gitlab-Enabled-Mcp-Server-Toolsets header controls which tool groups the server returns. The default set includes core, merge_requests, work_items, repository and ci, while wikis, code_security and orbit are opt-in. Start from the set each team needs, leave out opt-in groups unless a documented use case requires them, and set the header in each client configuration the same way. Confirm the result by listing tools from a test client and checking that only the expected groups appear. Done when the tool list for each team matches its written justification.

  4. Review each user's project and namespace permissions

    Listing a tool does not grant access, because each tool checks the calling user's project and namespace permissions when it runs. The security reviewer checks the groups and projects of the users who will connect AI clients, and removes access that is broader than the task needs. Pay attention to users with maintainer or owner roles, since their tool calls can change more data. Confirm the review by running a read and a write request as a standard user against a project they should not change. Done when every connected user's effective permissions are documented and the test request is refused where it should be.

  5. Configure per-tool rules after confirming beta behavior

    On Premium and Ultimate, agent tool governance can set each tool served by the GitLab MCP server to Always Allow, Always Ask or Always Deny, with tools sorted into Read, Write and Delete categories. The docs mark this feature as beta, so the platform owner first tests in a non-production instance how the setting behaves for each category and what the approval prompt shows. Then set Always Deny for Delete tools and Always Ask for Write tools across the intended users, and keep Read tools as needed. Done when the rule set is recorded per tool and the beta behavior observed in testing is noted in the runbook.

  6. Test that write and delete tools are blocked

    The security tester runs a scripted set of calls as each intended user type, covering a read, a write and a delete on a test project. The expected outcome for each user is written beforehand, so the result is a pass or fail rather than an impression. Where per-tool rules are set to Always Deny, confirm the call is refused, and where permissions are missing, confirm the server returns an authorization error. Keep the output as evidence for the approval file. Done when every test matches the expected outcome and any mismatch has an open fix ticket.

  7. Retest after every upgrade

    Repeat the checks in this sequence after each GitLab upgrade, because the tier, the beta status of governance features and the default toolsets can change between releases. The docs record that the server moved from beta to generally available in GitLab 19.5 and that its tier listing changed in GitLab 19.2, so the platform owner reads the release notes for these items before approving an upgrade. Confirm that the token rules, toolset header, permission review and tool rules still produce the expected results. Done when the retest log is filed against the new version and any change in behavior has been reviewed and signed off.

Request path from AI client to GitLab tool execution

The diagram starts at the AI client, which sends a request with an accepted token to the instance's /api/v4/mcp endpoint. The server first checks the token type: OAuth tokens with the mcp scope and fine-grained personal access tokens with the MCP tool resource and Execute permission pass, while legacy personal, project and group access tokens are rejected with 403 Forbidden and insufficient_scope. Next, the toolsets header narrows the tools returned, and on Premium and Ultimate the per-tool governance setting decides whether each call is allowed, asked for or denied. Reviewers should check that the token types, toolsets and governance settings match their policy, because a listed tool still runs the user's own project and namespace permission check at call time.

Each request passes token, toolset, governance and per-user permission checks before GitLab data is read or changed.

Evidence a security reviewer asks for

This table lists the artifacts a security reviewer should collect before approving the GitLab MCP server, with where each comes from in GitLab and which edition or tier is needed to produce it. Use it as a checklist: a row is complete only when the reviewer has seen the artifact from the live instance, not from a plan or a configuration file someone wrote.

EvidenceWhere it comes from in GitLabEdition needed
Accepted token types and rejection behaviorTest calls to the /api/v4/mcp endpoint with an OAuth token holding the mcp scope, a fine-grained token with the MCP tool resource and Execute permission, and a legacy or project or group token, which should return 403 with insufficient_scopeFree, Premium and Ultimate
Toolset configurationThe X-Gitlab-Enabled-Mcp-Server-Toolsets header in each client configuration file, plus the tool list the server returns for that headerFree, Premium and Ultimate
Tools by Read, Write and Delete categoryThe GitLab MCP server tools documentation, exported or captured against the toolsets actually enabled for the pilot groupFree, Premium and Ultimate
Governance rule export or screenshotAgent tool governance settings showing Always Allow, Always Ask or Always Deny for each tool, noting the feature is marked betaPremium and Ultimate
User permission review for project and namespaceProject and group membership and role reports for the users who will connect, since each tool call checks those permissionsFree, Premium and Ultimate
Security dashboard tools in code_securityConfiguration showing whether list_vulnerabilities, get_vulnerability and save_vulnerability are reachable and whether the security dashboard is in useUltimate
Client configuration filesThe MCP client config for each approved tool (for example Claude Code, Cursor or Claude Desktop), showing the URL, transport and toolset header, with no stored credentialsFree, Premium and Ultimate
Retest resultsA dated test run after each change to scopes, toolsets or governance rules, confirming the expected accept and reject resultsFree, Premium and Ultimate

Questions buyers ask before approving the GitLab MCP server

Is the GitLab MCP server free to turn on?

Yes, the server is listed in the Free tier, so enabling the MCP server itself does not require a Premium or Ultimate license according to the GitLab docs. The paid tiers matter for governance. Agent tool governance, which sets Always Allow, Always Ask or Always Deny per tool, is listed for Premium and Ultimate, and the code_security tools that work with vulnerabilities need the security dashboard, an Ultimate feature. Before approving, confirm with GitLab which tier your instance or GitLab.com group is on, since a Free setup cannot enforce per-tool approval. Also confirm the current tier mapping, because the server moved from Premium to Free in GitLab 19.2.

How much effort does locking down the GitLab MCP server take?

The effort depends on how many toolsets you keep, how many tiers of user groups you must separate, and whether you need per-tool rules. The default toolsets include core, merge_requests, work_items, repository and ci, while wikis, code_security and orbit are opt-in, so narrowing the toolset list is a short configuration task. Per-tool governance adds work because each Read, Write and Delete tool needs a decision, and the feature is in beta. Token policy adds work if you have many legacy personal, project or group access tokens to replace. Ask your GitLab contact or partner to estimate effort from your written scope, and ask what changes after upgrades.

Can our team configure the GitLab MCP server without outside help?

A team with GitLab administration experience and someone who owns identity and token policy can usually do the configuration in house, because the controls are documented settings rather than custom code. Outside help is most useful for testing whether the limits hold, for example confirming that a tool call still checks the user's project and namespace permissions, and for documenting evidence for a review. DeployOpen can plan, implement and harden self-hosted GitLab in your environment and test the setup against prompt injection and permission misuse under a fixed-scope written agreement. Confirm the instance type first, since GitLab.com, Self-Managed and Dedicated are all listed as generally available.

What must we provide before approving the GitLab MCP server?

Prepare four decisions in writing before the approval meeting:

  • The GitLab tier your instance or group holds, confirmed with GitLab, since it decides whether per-tool governance is available.
  • The token policy: whether you accept only OAuth access tokens with the mcp scope or fine-grained personal access tokens with the MCP tool resource and Execute permission, and confirmation that legacy personal, project and group access tokens will be rejected.
  • The toolset list passed in the X-Gitlab-Enabled-Mcp-Server-Toolsets header, with the opt-in sets you accept.
  • The user groups allowed to connect, with the AI clients each group may use.

A reviewer can check these four items against the setup and against the tool list in the GitLab docs.

Can we rely on tool governance while it is in beta?

Treat per-tool governance as a useful control with a documented limit, not as the only barrier. GitLab's docs mark agent tool governance as beta, so behavior, naming and settings can change between releases. Do not depend on it alone: pair it with a narrow toolset list, fine-grained tokens and the project and namespace permission checks that apply to every tool call, which the docs say still run even when a tool is listed. Ask GitLab for the release notes and support commitments for the feature, and set a review step for each GitLab upgrade so your tool decisions are retested.

Do GitLab MCP controls cover the AI client's own machine?

No, the GitLab server controls what the connected tool may call on GitLab, not what the AI client does on the laptop or build host. Claude Code, Cursor, Claude Desktop and other clients can still read local files, run shell commands and send local content to their own model providers, depending on their settings. Review each client's permission mode, sandbox and data handling separately, and confirm with the client vendor what runs locally. Also decide where the stdio transport through mcp-remote runs, since it requires Node.js on the endpoint and adds a local process to manage.

Official GitLab pages to check each claim against

Before approving the GitLab MCP server, a reviewer should check each claim in this topic against GitLab's own documentation, because the endpoint, token rules, toolsets and governance settings all change between releases. Start with the GitLab MCP server page. Confirm that the /api/v4/mcp endpoint is the one your clients will call, that the server accepts an OAuth access token with the mcp scope or a fine-grained personal access token with the MCP tool resource and the Execute permission, and that legacy personal, project and group access tokens are rejected with 403 Forbidden. Also confirm which tier your instance is on, because the page lists the server across Free, Premium and Ultimate, and the tier history matters for governance features.

Next, read the GitLab MCP server tools page against your own control list. Check which tools belong to each toolset, including the default groups and the opt-in wikis, code_security and orbit sets that the X-Gitlab-Enabled-Mcp-Server-Toolsets header controls. Confirm that listing a tool does not grant access and that each call re-checks the user's project and namespace permissions. For code_security tools, verify the Ultimate dependency on the security dashboard, and record which tools can write, so the governance policy in the next step covers them.

Finally, check the agent tool governance page, which sets Always Allow, Always Ask or Always Deny per tool on Premium and Ultimate. Note that the docs mark this feature as beta, and ask GitLab whether the Read, Write and Delete categories are stable enough to base an approval policy on. Record the version of each page you reviewed and the date, and repeat the check after every GitLab upgrade, since the docs are the only authoritative source for which settings your instance actually enforces.

How DeployOpen tests and locks down a GitLab MCP rollout

DeployOpen reviews the GitLab MCP server as a deployed system: which tokens reach it, which toolsets and tool rules are active, and what each connected AI client can read or change. The work is scoped in writing first, then tested, hardened and handed over with documentation the security and admin teams can review.

How we scope

  • Written scope lists the GitLab instances, deployment types and AI clients included in the review
  • Scope records which token types are in use and whether any legacy tokens remain in circulation
  • Scope names the toolsets enabled, the tool governance settings in force, and the admin switches to review
  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts

How we build

  • We confirm each client's token path and check that the server accepts only the documented OAuth or fine-grained token types
  • We test whether listed tools are blocked for users who lack project or namespace permissions when called
  • We review toolset header settings and tool governance rules against the read, write and delete categories GitLab documents
  • We test prompt injection and misuse paths against the tools that change code, merge requests, pipelines and work items

How we hand over

  • Findings report covers each issue with its severity, affected tool or setting, and the recommended fix
  • Lockdown guide documents the recommended toolsets, approval rules and token policy for each AI client
  • We retest after fixes are applied and document what changed and what remains open
  • Handover includes evidence the compliance team can file, without DeployOpen issuing any audit report or certification

How we support

  • Ongoing support covers reviews after GitLab upgrades that change MCP server features or tool governance
  • Continuous testing is available as a retainer for teams that add new AI clients or new toolsets over time
  • We confirm feature availability by edition and plan with the client before recommending a control
  • Retainer scope, like the initial engagement, is agreed in writing and quoted from that written scope

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.