> For the complete documentation index, see [llms.txt](https://docs.mobb.ai/mobb-user-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mobb.ai/mobb-user-docs/more-info/update-broker-token/gitlab-server-pat.md).

# GitLab Server — PAT

{% hint style="warning" %}
This guide applies **only to on-premises Mobb deployments** where the [Mobb Broker](/mobb-user-docs/more-info/mobb-broker.md) is used to connect to a self-hosted GitLab Server instance.
{% endhint %}

## Overview

When Mobb connects to an on-premises GitLab Server through the Mobb Broker using **Personal Access Token (PAT)** authentication, it requires a valid GitLab access token to interact with the GitLab API. This guide explains how to generate a new token and update it in Mobb.

## Prerequisites

* Access to a Mobb on-premises deployment with the Mobb Broker configured for GitLab Server
* Permission to create a Personal Access Token or Project Access Token in your GitLab Server instance
* Admin or Owner access to the relevant Mobb organization

## Steps

### Step 1: Generate a New GitLab Access Token

You can use either a **Personal Access Token** or a **Project Access Token**.

#### Option A: Personal Access Token

1. In GitLab Server, click your **user icon** in the top-right corner and select **Edit profile**.
2. In the left sidebar, navigate to **Access Tokens**.
3. Click **Add new token**.

<figure><img src="/files/zA7sVvSqJGB4cyWTyVi5" alt="GitLab Server Personal Access Tokens page"><figcaption><p>GitLab Server — Navigate to User Settings → Access Tokens and click Add new token</p></figcaption></figure>

4. Give the token a name and set an expiration date.
5. Enable the following scopes:

   * `api`
   * `read_user`

   <figure><img src="/files/E8rgqt7CTLRpRSP85j7v" alt="GitLab Personal Access Token scope selection"><figcaption><p>Select the <code>api</code> and <code>read_user</code> scopes</p></figcaption></figure>
6. Click **Create personal access token** and copy the generated token value.

#### Option B: Project Access Token

1. In GitLab Server, navigate to your project.
2. Go to **Settings** → **Access Tokens**.
3. Click **Add new token**.
4. Give the token a name and set an expiration date.
5. Set the role to **Developer** or higher.
6. Enable the following scope:

   * `api`

   <figure><img src="/files/IhMID2WSmYsGTEVhScN8" alt="GitLab Project Access Token settings"><figcaption><p>Set the role to Developer and select the <code>api</code> scope</p></figcaption></figure>
7. Click **Create project access token** and copy the generated token value.

### Step 2: Update the Access Token in Mobb

1. In the Mobb interface, click the **Integrations** icon in the left sidebar.
2. Locate **GitLab Server** under the "Hosted Code Platforms" section and click **+ Connect** or **Configure**.

   <figure><img src="/files/VSHbTtHLuYPO8b2u7yJD" alt="Mobb Integrations page"><figcaption><p>Locate GitLab Server and click Configure</p></figcaption></figure>
3. Select your **GitLab Server URL** from the list and click **Continue**.

   <figure><img src="/files/bR0tEbSXRvQyY5aLTVVE" alt="GitLab Server URL selection"><figcaption><p>Select your GitLab Server URL</p></figcaption></figure>
4. In the next screen, enter your new GitLab Server access token (either Personal Access Token or Project Access Token) and complete the configuration.

   <figure><img src="/files/7wyn26ZHahAM15vdp8mW" alt="Enter GitLab access token"><figcaption><p>Paste your GitLab access token and complete setup</p></figcaption></figure>

## Verification

After updating the access token, verify that Mobb can successfully connect to your GitLab Server:

1. On the configuration screen, you should see a **"Connected"** status indicating successful authentication.

   <figure><img src="/files/5VJeF8nTzFlZ3GedZ3d5" alt="GitLab Server connection successful"><figcaption><p>GitLab Server shows as Connected</p></figcaption></figure>
2. You can also verify by returning to the **Integrations** page—the GitLab Server integration should display a **Connected** checkmark.

   <figure><img src="/files/jDybvnAdmS4P6fzr4iEz" alt="Integrations page with GitLab Server connected"><figcaption><p>Integrations page confirms GitLab Server is connected</p></figcaption></figure>

## Troubleshooting

If you see connection errors, verify that:

* The access token has not expired
* The token has the correct scopes (`api` and `read_user`)
* Your GitLab Server is reachable from the Mobb Broker network

### Verify Mobb Broker Connectivity

To verify that the Mobb Broker can reach your GitLab Server, you can use the [Mobb REST API to check SCM connection status](https://apidocs.mobb.ai/mobb-rest-api#tag/broker-management/get/api/rest/checkscmconnectionstatus):

```bash
GET /api/rest/checkscmconnectionstatus
```

This endpoint will return the current connection status of your Mobb Broker to the SCM. If the broker cannot reach GitLab Server, reach out to us via <support@mobb.ai>.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.mobb.ai/mobb-user-docs/more-info/update-broker-token/gitlab-server-pat.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
