GitLab MCP Server
Aembit supports the official GitLab MCP server, which lets AI Agent: A software workload that authenticates to systems, requests credentials, and accesses resources, either on behalf of a person or on its own. Aembit secures AI agents with the same identity-first model it uses for any workload. User-driven agents such as Claude Desktop also carry a blended identity that ties access to both the user and the agent.Learn more access GitLab project data through Model Context Protocol: A standard protocol for AI agent and server interactions that defines how AI assistants communicate with external tools and data sources.Learn more(opens in new tab) tools.
This page describes how to configure GitLab as an MCP Server: A server that implements the Model Context Protocol to provide tools, resources, or data to AI agents and MCP clients.Learn more(opens in new tab) behind the Aembit MCP Identity Gateway: A component that brokers MCP traffic between MCP clients and target MCP servers, validating authorization and presenting Aembit-managed credentials on each request.Learn more. Each user authenticates with their own GitLab identity, and the Gateway injects their token into MCP requests.
This guide builds the Gateway-to-Server Policy: The Access Policy that authorizes the MCP Identity Gateway to access an MCP server on behalf of authenticated users—the Gateway itself is the Client Workload. Also called right-side auth; each MCP server behind the Gateway needs its own.Learn more—the second of the two Access Policy: Access Policies define, enforce, and audit access between Client and Server Workloads by cryptographically verifying workload identity and contextual factors rather than relying on static secrets.Learn more the MCP Identity Gateway requires. You create the first, the Client-to-Gateway Policy: The Access Policy that validates which MCP client can connect to the MCP Identity Gateway and authenticates users through your Identity Provider. Also called left-side auth; you create one per MCP client and Gateway combination.Learn more, during Gateway setup.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have the following:
- The Owner role for a GitLab.com top-level group, which is what enabling the MCP server requires
- A configured Aembit MCP Identity Gateway
Requirements and considerations
Section titled “Requirements and considerations”Before you configure GitLab, review these requirements and behaviors specific to GitLab’s MCP server.
- Use User-Based Auth. Aembit supports User-Based Auth for GitLab.
- GitLab.com only. Aembit verified this configuration against GitLab.com. GitLab also offers the MCP server on GitLab Self-Managed and GitLab Dedicated, which Aembit hasn’t tested.
- The MCP server is a GitLab Beta feature. GitLab can change the server’s behavior between releases.
- Request the
mcpscope alone. GitLab rejects the authorization request when the scope list includesoffline_access.
Enable the MCP server in GitLab
Section titled “Enable the MCP server in GitLab”GitLab turns the MCP server off by default, so a group Owner enables it on the top-level group before users can authenticate.
- In GitLab, open the top-level group and go to Settings > General.
- Expand Permissions and group features.
- In the MCP client access section, select Allow connection to GitLab.
- Click Save changes.
Configure the Credential Provider
Section titled “Configure the Credential Provider”Create an MCP User-Based Access Token Credential Provider: Credential Providers obtain the specific access credentials—such as API keys, OAuth tokens, or temporary cloud credentials—that Client Workloads need to authenticate to Server Workloads.Learn more in Aembit.
-
Log into your Aembit Tenant.
-
Go to Credential Providers in the left sidebar and click + New.
-
Configure the following fields:
Field Value Name A user-friendly name Credential Type MCP User-Based Access Token MCP Server URL https://gitlab.com/api/v4/mcpClient ID Auto-populated—no pre-registration needed Client Secret Auto-populated by Discover Scopes mcpPKCE Required On For MCP Server URL, click Discover to populate the Authorization URL and Token URL.
-
Click Save.
-
Copy the read-only Callback URL from the Credential Provider.
Finish configuring the OAuth client
Section titled “Finish configuring the OAuth client”GitLab supports OAuth Dynamic Client Registration, so you don’t need to register an application in GitLab.
When you create the MCP User-Based Access Token Credential Provider and click Discover, GitLab fills in the client registration automatically—Client ID, Client Secret, and URLs. GitLab grants access when each user completes the OAuth consent flow in the browser.
Authorize the Credential Provider
Section titled “Authorize the Credential Provider”-
Return to the Credential Provider in Aembit and click Authorize.
-
Complete the GitLab sign-in and approve access. The Credential Provider status changes to Ready when the flow completes.
Create the Server Workload
Section titled “Create the Server Workload”-
Go to Server Workloads in the left sidebar and click + New.
-
Configure the following fields:
Field Value Name A user-friendly name Host gitlab.comApplication Protocol MCP Port 443 with TLS URL Path /api/v4/mcpAuthentication method HTTP Authentication Authentication scheme Bearer -
Click Save.
Create an Access Policy
Section titled “Create an Access Policy”This section creates the Gateway-to-Server Access Policy, which authorizes the MCP Identity Gateway to access GitLab on behalf of authenticated users.
Create an Access Policy linking the MCP Identity Gateway (as the Client Workload: Client Workloads represent software applications, scripts, or automated processes that initiate access requests to Server Workloads, operating autonomously without direct user interaction.Learn more), the Credential Provider you created, and the Server Workload for GitLab.
For step-by-step instructions, including the Client Workload settings that identify the Gateway, see Create the gateway-to-server Access Policy.
Verify
Section titled “Verify”After a user authorizes access, the Aembit AI Access Authorized page lists the GitLab MCP Server as Ready. The AI agent can then call GitLab MCP tools through the Gateway.