GitLab MCP server enterprise setup: OAuth, tokens and admin access

Whether GitLab's official MCP server supports enterprise sign-in and admin control, which edition provides it, and what an organization must configure and decide before approving AI clients.

On this page

Does the GitLab MCP server meet our enterprise access requirement?

A security or platform lead who must approve AI clients such as Claude Code or Cursor should know first that the GitLab MCP server is built into GitLab rather than being a community add-on. According to GitLab's documentation, it is generally available on GitLab.com, GitLab Self-Managed and GitLab Dedicated, and it is listed in the Free, Premium and Ultimate tiers. On Self-Managed and Dedicated, an administrator decides whether any MCP client can connect at all through the Allow connection to GitLab checkbox under MCP client access, found at Admin, Settings, General, Visibility and access controls. The admin settings page states that when this setting is off, the MCP API rejects all requests. Confirm that setting before any pilot, and confirm which tier your contract covers, because the docs show the server moved from Premium to Free in GitLab 19.2.

Authentication has two paths. The first is OAuth 2.0 with Dynamic Client Registration, where an AI tool registers itself as an OAuth application on first connection, requests authorization and receives an access token. The second is reusing a single pre-registered OAuth application, which gives administrators a fixed client they can review and approve. The server also accepts fine-grained personal access tokens with the MCP tool Execute permission as an alternative to OAuth. Decide which path your organization permits, since dynamic registration lets any client that reaches the endpoint create its own application unless your review process catches it. On GitLab.com, access to the server is allowed for the top-level group, so confirm which groups can use it before rollout.

The identity provider configuration and the scopes each token carries are covered on the sibling pages on sign-in and on tool-level security, so this section does not repeat them. Your remaining check is the endpoint itself: the HTTP transport, which GitLab recommends, uses the instance URL followed by /api/v4/mcp, and the stdio transport through mcp-remote requires Node.js on each developer machine. Ask your GitLab administrator to confirm that the endpoint on your instance matches what you approve, and record who holds the admin right to flip the Allow connection setting off if an incident requires it.

Admin and authentication capabilities by deployment

This table compares how the GitLab MCP server's endpoint, sign-in options and admin controls differ between GitLab.com and GitLab Self-Managed or Dedicated. Read each row against your deployment, and treat any cell marked as a confirmation item as an open question for GitLab before you approve AI clients. The main takeaway is that the admin switch and group-level rules differ by deployment, so the controls you can enforce depend on where your instance runs.

CapabilityGitLab.comSelf-Managed and Dedicated
Availability and tiersGenerally available, listed in the Free, Premium and Ultimate tiersGenerally available, listed in the Free, Premium and Ultimate tiers
HTTP endpointHost gitlab.com with the path /api/v4/mcp (HTTP transport, recommended)Your instance URL followed by /api/v4/mcp (HTTP transport, recommended)
OAuth dynamic client registrationSupported: AI tool registers itself on first connection; confirm the consent flow for your groupSupported: AI tool registers itself on first connection; confirm steps for your version
Pre-registered OAuth applicationDocumented as an option to reuse one application; confirm setup and who creates itDocumented as an option to reuse one application; confirm setup and who creates it
Fine-grained PAT with MCP Execute permissionAccepted as an alternative to OAuth; confirm token expiry and owner rulesAccepted as an alternative to OAuth; confirm token expiry and owner rules
Allow connection to GitLab switchNot in the admin path described for this deployment; confirm with GitLab how to block clientsAdmin, Settings, General, Visibility and access controls, MCP client access; off rejects all MCP requests
Default state for existing instancesConfirm how the MCP access setting applies to the platformOn by default since GitLab 19.5 unless an administrator had turned it off
Top-level group access ruleAccess allowed for the top-level group; confirm how subgroups and projects inherit itConfirm whether a top-level group rule applies and how it interacts with the admin switch
stdio transport through mcp-remoteSeparate option; requires Node.js on each client machine; confirm support on this platformSeparate option; requires Node.js on each client machine; confirm support for your version

How the endpoint, OAuth and admin switch fit together

The first decision for an administrator is whether the admin switch allows MCP clients to reach the instance at all, because everything else depends on it. On GitLab Self-Managed and GitLab Dedicated, the switch sits under Admin, Settings, General, Visibility and access controls, where the Allow connection to GitLab checkbox under MCP client access governs the server. The settings page states that when this setting is turned off, the MCP API rejects all requests. Clients that use the recommended HTTP transport reach the server at the instance URL followed by /api/v4/mcp, so the endpoint is only useful once the switch is on. On GitLab.com, the docs instead say access to the MCP server is allowed for the top-level group, so the control an administrator reviews there is group-level access rather than this instance checkbox.

Once an AI client can reach the endpoint, it normally registers itself. With OAuth 2.0 Dynamic Client Registration, the tool registers as an OAuth application on first connection, requests authorization from the signed-in user and receives an access token, which then acts on that user's behalf. The docs also describe reusing one pre-registered OAuth application instead. That choice changes who can connect: dynamic registration lets each client create its own application record, while a single pre-registered application gives the organization one identity to review and revoke. The docs also accept fine-grained personal access tokens with the MCP tool Execute permission as an alternative to OAuth. Confirm which of these paths your users will take, because each one needs its own review of token lifetime and revocation.

The admin switch also needs a periodic check. The admin settings page says GitLab 19.5 turned the setting on by default for existing instances unless an administrator had turned it off, so an instance upgraded to that release may now accept MCP clients that nobody intended to enable. Record the current value on every Self-Managed and Dedicated instance, confirm it matches a documented decision, and repeat the check after each upgrade. Pair the switch with a list of who may sign in and which groups hold the MCP tool permissions, and test the result with a non-privileged account, since the access token inherits that user's rights.

OAuth dynamic registration or a pre-registered application

With dynamic client registration, each AI tool registers itself as an OAuth application the first time it connects. The tool requests authorization from the signed-in user, and GitLab issues an access token that acts on that user's behalf. This path needs the least setup, because the organization does not create OAuth applications in advance. The trade-off is that the set of clients grows as people connect new tools, so governance depends on reviewing what has registered.

  • Per-client registration: Each tool, such as Claude Code, Cursor or Claude Desktop, creates its own OAuth application record.
  • User-level consent: Each person authorizes the client, so access follows that person's existing GitLab permissions.
  • Visibility gap: Administrators must confirm which registered applications exist and who created them. Ask GitLab how registered clients appear in the admin views for your edition.
  • Revocation by client: Removing one tool's access is a per-application action, which can be quick but needs a current inventory.
  • Setup burden on users: Staff complete the flow themselves, so the admin switch and user guidance matter more.

Before approving this path, confirm the exact admin views and revocation steps for your GitLab version, and decide who reviews new registrations.

Decisions to make before enabling MCP clients

Five choices determine who can connect, with which credential, and how quickly access can be withdrawn. Each one shifts accountability between the instance administrator, group owners and individual users, so settle them together before staff receive the URL.

Dynamic registration or a pre-registered application

With dynamic client registration, each AI tool registers itself as an OAuth application on first connection, so the instance accumulates one registered client per tool installation. A single pre-registered OAuth application gives you one client to review, scope and revoke, at the cost of managing its redirect and approval flow yourself. Ask which option your GitLab edition and deployment support, and confirm how registered applications appear in your admin views before you choose.

GitLab MCP server docs

OAuth or personal access tokens

OAuth tokens are issued to a user through an authorization step, so each session traces back to a named person and expires under GitLab's OAuth settings. Fine-grained personal access tokens with the MCP tool Execute permission work as an alternative, but a token lives until its owner rotates or revokes it and leaves no separate approval step. Decide which path individuals may use, and whether tokens are allowed at all for service accounts that run unattended agents.

Instance-wide switch on or off

The Allow connection to GitLab setting under MCP client access is the single gate for the whole Self-Managed or Dedicated instance. When it is off, the MCP API rejects all requests, and GitLab 19.5 turned it on by default for existing instances unless an administrator had already disabled it. Check the current value now, because leaving it on by default means any user can attempt a connection until you decide otherwise.

Visibility and access controls

Top-level groups on GitLab.com

On GitLab.com, access to the MCP server is allowed for the top-level group, so the decision is which top-level groups hold the access, not which projects. Every subgroup and project beneath an allowed group inherits that reach, which makes the group boundary your main accountability line. Map which teams belong to each top-level group and confirm with the group owners who should be allowed in before enabling it.

Publishing the instance URL

The HTTP endpoint is the instance URL followed by /api/v4/mcp, and on GitLab.com it is gitlab.com under the same path. Publish only the endpoint your approved clients need, through the internal channel your onboarding uses, so staff connect to the correct instance and not a look-alike host. Keep a record of who received the URL and when, since that list is what you check when access must be withdrawn.

Client connection and admin gate: how a request reaches GitLab

The diagram starts with an AI client such as Claude Code or Cursor sending a request to the instance's /api/v4/mcp endpoint. The MCP API first checks the admin switch under MCP client access: when Allow connection to GitLab is off, every request is rejected. When it is on, the client either registers itself through OAuth 2.0 Dynamic Client Registration or reuses a pre-registered OAuth application, then receives an access token. GitLab still applies the permission check on the user's own account for every action, so the reviewer should confirm both gates.

Admin switch and OAuth gates sit in front of every GitLab MCP action.

What the admin switch and OAuth do not settle

The Allow connection to GitLab setting and OAuth sign-in decide whether MCP clients can connect at all, but they do not decide what a connected client can do. The cards below cover the gaps that remain after the switch is on and sign-in works, and the controls an organization should put around each one.

The switch is instance-wide

The Allow connection to GitLab checkbox under MCP client access applies to the whole instance. Turning it off blocks every MCP client, and turning it on does not limit which tools an approved client may call. A team that needs some MCP access but not all of it has no per-tool control at this level. Treat the switch as an on or off gate only, and plan tool restrictions as a separate review, covered in the sibling topic on GitLab MCP server security.

Visibility and access controls

Dynamic registration lets clients self-register

With OAuth 2.0 Dynamic Client Registration, an AI tool registers itself as an OAuth application on first connection, so no administrator has to approve each client by name. Ask whether your GitLab setup allows this path for your users, or whether you prefer a single pre-registered OAuth application that the security team owns. Document which path is in use, and review the list of registered applications on a schedule.

GitLab MCP server docs

Personal access tokens inherit user rights

The server accepts fine-grained personal access tokens with the MCP tool Execute permission as an alternative to OAuth. A token acts with the rights of the user who created it, so a token scoped to MCP can still reach any project that user can reach. Set a token policy in GitLab that limits who may create these tokens and how long they live, and tell engineers to use OAuth where the client supports it.

Confirm revocation and session lifetime

The supplied documentation does not state how long an OAuth access token or MCP session lasts, or how quickly a revoked grant or a disabled user stops working on the MCP endpoint. Ask GitLab for these answers in writing, including how a departing employee's sessions and personal access tokens are ended. Record the answers in your access review, because they determine how fast an offboarding or a compromised laptop is contained.

Stdio setup runs on every machine

The docs describe a stdio transport through mcp-remote, which requires Node.js on the machine running the client. That moves the MCP bridge onto each developer laptop, where versions, updates and local configuration files are outside central control. Use the HTTP transport where possible, keep an approved list of machines and Node.js versions for any stdio use, and check client configuration files as part of endpoint management.

Monitor the endpoint and roll out managed

Neither the switch nor OAuth tells you which clients are connecting, how often, or from where. Publish one approved endpoint, the instance URL followed by the MCP path, and a list of supported clients with their configuration. Then review GitLab audit and server logs for connections from unlisted clients. Confirm with GitLab what the MCP server records about each request before you rely on it for investigations.

How the answer changes by deployment

On GitLab.com, the MCP server is generally available and reached at the host gitlab.com through the /api/v4/mcp path. Because GitLab operates the instance, your organization does not toggle the server on at the instance level. The access boundary the docs describe is the top-level group: access to the MCP server is allowed for the top-level group, so the people and clients that can reach it depend on how your groups are structured and who has membership in them.

  • Group boundary: Confirm which top-level group holds your GitLab.com projects, because MCP access is evaluated at that level.
  • Plan tier: The docs list the server in the Free, Premium and Ultimate tiers, so check which tier your group is on before assuming features are available.
  • Token choice: Decide whether staff use OAuth with dynamic client registration or fine-grained personal access tokens with the MCP tool Execute permission.
  • Operator control: GitLab runs the service, so ask GitLab which controls it documents for your group and which are left to your own group settings.

Before approval, check the top-level group membership and the token policy your security team expects, then confirm both with GitLab's current documentation.

Order of work before the first client connects

This sequence confirms the GitLab edition and version, fixes the identity and token model, sets the MCP access switch on purpose, and proves on a test group that only approved clients reach the endpoint before anyone else is onboarded. Each step ends with a written record that a reviewer can check.

  1. Confirm the GitLab edition and version

    The platform team confirms whether the organization runs GitLab.com, GitLab Self-Managed or GitLab Dedicated, and which release is installed. The GitLab docs list the MCP server as generally available on all three deployment types, and they say it changed from beta in GitLab 19.5, so a release earlier than that should be treated as a different maturity level to confirm with GitLab. The tier (Free, Premium or Ultimate) should also be recorded, since the docs say the server moved from Premium to Free in GitLab 19.2. The step is done when the deployment type, exact version and tier are written into the rollout record and checked against the current MCP server docs.

  2. Decide the identity and token model

    The security lead and identity team choose how clients will authenticate. The main options are OAuth 2.0 with Dynamic Client Registration, where each AI tool registers itself on first connection, or a single pre-registered OAuth application reused by approved clients. Fine-grained personal access tokens with the MCP tool Execute permission are the documented alternative. Each option has different audit attribution and revocation behavior, so the team should confirm with GitLab how each token type is issued, scoped and revoked in their version. The step is done when a signed decision names the approved identity path and rules out the others in writing.

  3. Set the Allow connection to GitLab switch deliberately

    On GitLab Self-Managed and GitLab Dedicated, a GitLab administrator sets the Allow connection to GitLab checkbox under Admin, Settings, General, Visibility and access controls in MCP client access. The admin settings page says that when this is off, the MCP API rejects all requests. It also says GitLab 19.5 turned the setting on by default for existing instances unless an administrator had turned it off, so the admin should check the current value instead of assuming it. The step is done when the admin records the setting's state, the date it was changed, and the name of the approver.

  4. Pilot one client on a test group

    The platform team connects one approved client, such as Claude Code or Cursor, using the chosen identity path against a test group that contains no production repositories or sensitive data. On GitLab.com, the docs say access to the MCP server is allowed for the top-level group, so the pilot group should sit under a top-level group that the team controls. The pilot should exercise a read action and a write action in the test group and confirm that the actions are attributed to the expected user. The step is done when the test log shows the expected user, the expected scope and no access outside the test group.

  5. Verify the endpoint is reached only through approved paths

    The network and security team confirms that the MCP endpoint, which is the instance URL followed by /api/v4/mcp on the HTTP transport, is reachable only from the client paths the organization has approved. They also check any stdio setups that use mcp-remote and Node.js, since those run on developer machines and need their own review. Reviewers should check egress rules, proxy or gateway policies, and whether personal devices can reach the instance. The step is done when the team has a documented list of permitted clients, paths and network routes, and a test from an unapproved route fails.

  6. Record the decision for review

    The security or compliance lead writes a single rollout record that holds the edition and version, the identity model, the state of the MCP access switch, the pilot results, the approved client list and the network paths. The record should also name who can change the switch and who reviews changes to the approved client list. A reviewer should be able to rebuild the configuration from this record alone. The step is done when the record is signed off and stored where the security review team can find it before wider rollout.

Evidence a security reviewer asks for

This table maps the evidence a security reviewer usually requests for the GitLab MCP server to the GitLab admin area, docs or instance record that holds it. Use it to build an evidence request before approval, and to confirm which items exist on your edition, since Self-Managed, Dedicated and GitLab.com expose them differently. Items marked to confirm should be verified in your own instance rather than assumed.

Reviewer requestWhere it livesNotes for the reviewer
MCP client access setting and its current valueAdmin, Settings, General, Visibility and access controls, MCP client access, Allow connection to GitLab checkboxRecord the value and date. When off, the MCP API rejects all requests. Confirm the value on Self-Managed and Dedicated instances.
Change history for the MCP access settingInstance audit events and the admin settings history (confirm availability on your tier and version)GitLab 19.5 turned the setting on by default for existing instances unless an administrator had turned it off, so check whether the setting was changed afterward.
Registered OAuth applications or clientsAdmin area OAuth applications list, plus any pre-registered application reused in place of dynamic registrationDynamic client registration creates applications on first connection, so the list shows which AI tools have registered. Confirm how your instance records them.
Accepted token types and token policyFine-grained personal access tokens with the MCP tool Execute permission, plus the OAuth access pathConfirm which token types your policy allows and who may create tokens with the MCP permission. Ask for a written list of approved token types.
Top-level group list with MCP access (GitLab.com)Top-level group settings for MCP server access on GitLab.comAccess is allowed for the top-level group. Ask for the full list of top-level groups and confirm no unintended group is included.
GitLab version and editionAdmin area version information and the subscription or plan recordThe MCP server is generally available from GitLab 19.5, and the Free, Premium and Ultimate tiers list it. Record the exact version because the access model may change between releases.
GitLab Duo data usage statementGitLab Duo data usage documentation, plus the instance's Duo settings and contract termsCovers how AI processing handles data. Confirm whether it applies to the AI client or only to GitLab Duo features, since the MCP server and Duo are separate.

Questions buyers ask before approving GitLab MCP access

Does the GitLab MCP server cost extra to use?

The GitLab docs list the MCP server in the Free, Premium and Ultimate tiers, so no separate MCP add-on is required for those tiers. The docs also note that it moved from Premium to Free in GitLab 19.2, so a Free or Premium instance should confirm its own tier on the current docs page before rollout. Your recurring cost is your existing GitLab subscription plus whatever the AI tools themselves charge for their own seats or usage. Ask your GitLab account contact to confirm which tier applies to your deployment, and ask your AI tool vendor for its own price, since those charges sit outside GitLab.

Does SSO apply to GitLab MCP OAuth consent?

The GitLab MCP server uses OAuth 2.0, so an AI client sends the user to GitLab to approve access, and the user's existing GitLab sign-in is the basis for that approval. Whether your identity provider's SSO policies, such as enforced sign-in methods or session length, apply to that consent step depends on how your instance is configured. Confirm this with GitLab and your instance owner before approval, and test it with a non-admin account. Also check whether personal access tokens are used as an alternative path, since they follow different sign-in rules than OAuth consent.

Who must turn on the MCP switch in GitLab?

On GitLab Self-Managed and GitLab Dedicated, an instance administrator controls MCP access under Admin, Settings, General, Visibility and access controls, using the Allow connection to GitLab checkbox in the MCP client access section. Only an administrator can change it, so your platform or GitLab administration team owns the decision. When the setting is off, the MCP API rejects all requests. The admin settings page also says GitLab 19.5 turned it on by default for existing instances unless an administrator had turned it off, so check the current value on your instance before anyone is told it is off.

How long does GitLab MCP setup take?

No duration was supplied for this, so treat any timeline as unknown until you confirm it. The work splits into three parts: reviewing and setting the admin switch, deciding between dynamic client registration and a single pre-registered OAuth application, and configuring each AI client. The client configuration formats differ by tool, so the number of clients you approve is a main driver of effort. Ask GitLab and your instance owner to confirm the steps for your edition and version, and ask your security team to set the test scope before anyone starts.

Can internal staff set up GitLab MCP access without outside help?

Yes, in principle. The setup is documented by GitLab, the admin switch is in the instance settings, and the endpoint is the instance URL followed by /api/v4/mcp. An internal team with GitLab administration access and someone who knows the AI clients can cover the basics. The harder parts are the security decisions: which clients to allow, whether to use dynamic client registration or a pre-registered application, which token types to accept, and what tools a user should be able to run. Many organizations keep those decisions with their security team and use an outside reviewer for a fixed-scope test before wider rollout.

What drives the effort of an external consultant on GitLab MCP?

DeployOpen works from a written scope, so the main drivers are the parts of the work you ask for. Those include the number of GitLab instances and editions in scope, how many AI clients you need to review, whether you use dynamic client registration or a pre-registered OAuth application, how your SSO and admin roles are set up, and whether you want a findings report with fixes and a retest. Fixed-scope engagements and retainers are both available. The quote follows from the written scope, and DeployOpen does not publish a price list.

Which GitLab MCP access decision needs security sign-off first?

Before approving access, security should sign off on four decisions: whether the admin switch stays on, which AI clients are allowed, whether dynamic client registration is accepted or a single pre-registered OAuth application is used, and whether personal access tokens with the MCP tool Execute permission are permitted as an alternative to OAuth. Each decision changes who can connect and how revocation works. Record the decisions in writing, confirm them against the current GitLab MCP server documentation for your version, and set a re-review date for when GitLab changes the feature or your clients change.

What to confirm with GitLab before approval

Before approving the GitLab MCP server, get written answers on the points the public docs leave open. First, confirm how SSO and your identity provider interact with OAuth consent. Dynamic Client Registration lets an AI tool register itself as an OAuth application on first connection, so ask whether your sign-in policies, group restrictions and multi-factor requirements apply to that consent step, and whether an administrator can review or revoke the applications that were registered. Ask the same question about the alternative of a single pre-registered OAuth application, since it changes who approves the client.

Second, ask about token lifetimes and revocation. Confirm how long access tokens issued through OAuth remain valid, whether refresh tokens are issued, how a user or administrator revokes an MCP client's access, and whether revoking a user's account or removing them from a group also cuts off MCP access. Repeat the check for fine-grained personal access tokens with the MCP tool Execute permission, including expiry limits your organization can enforce and how those tokens appear in audit records.

Third, confirm the scope of the admin switch. Ask GitLab whether turning off Allow connection to GitLab in MCP client access blocks every MCP path, including the stdio transport through mcp-remote, and whether it also covers Dedicated instances, where operations are handled differently. Ask who runs that setting on Dedicated, how changes are logged, and how quickly they take effect. Test the switch on a non-production tenant before you rely on it.

How DeployOpen supports a GitLab MCP server rollout

DeployOpen plans, implements and tests the GitLab MCP server setup inside your own GitLab instance, including OAuth, token choices and the admin switch that allows or blocks MCP clients. Each engagement is fixed-scope, with the scope, deliverables and timelines agreed in writing before work starts.

How we scope

  • Confirm which GitLab edition and deployment you run: GitLab.com, Self-Managed or Dedicated.
  • Record which AI clients will connect and whether they use OAuth dynamic registration or a pre-registered application.
  • Define in writing how the admin switch, token types and group-level access will be set and who approves changes.

How we build

  • Configure the HTTP endpoint and the admin setting under Visibility and access controls for your instance.
  • Test how each approved client registers, authorizes and receives its access token, and check what happens when the switch is off.
  • Review fine-grained personal access token use against the MCP tool Execute permission and document the approved token policy.

How we hand over

  • Deliver a written configuration record covering the endpoint, admin settings, approved clients and token rules.
  • Provide a findings report with fixes and a retest, so your security and compliance reviewers can verify the setup.
  • Walk your administrators through the change process for adding a client, rotating tokens and turning the switch off.

How we support

  • Re-test the configuration after GitLab upgrades or changes to client settings, as agreed in the written scope.
  • Offer ongoing support, upgrades and continuous testing as a retainer if your team wants them after handover.
  • Prepare evidence for internal reviews of the MCP setup, without issuing audit reports or certifications ourselves.

Sources and further reading

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.