> Documentation index: https://metorial.com/llms.txt. Every page is available as Markdown by adding .md to its URL.

# Set up GitLab in Metorial for Claude, ChatGPT and Cursor
URL: https://metorial.com/docs/integrations/gitlab
Last updated: 2026-11-24

Share GitLab with your team in Claude, ChatGPT and Cursor through Metorial: OAuth or personal access token sign-in, 30 tools (13 read-only).

---

To give your team GitLab in Claude, ChatGPT, Cursor and other AI clients, an admin shares the GitLab integration in a Metorial portal, and each person signs in to GitLab with their own account. Agents can manage GitLab projects, repositories, issues, merge requests, releases, and CI/CD workflows from one provider. The integration has 30 tools, 13 read-only, 11 write and 6 destructive, plus 6 triggers.

**What you will learn**

- How an admin shares GitLab in a portal and how each person connects
- The 13 OAuth scopes GitLab can request, and what each one allows
- How to keep the 13 read-only tools and reject the other 17

**Before you start**

- A [portal](https://metorial.com/docs/platform/workforce/portals) with at least one access group
- An account with GitLab for each person who connects
- For the CLI steps: the [Metorial CLI](https://metorial.com/docs/platform/cli), signed in to your portal

## Sign-in methods

| Method | Type | What a person provides |
| --- | --- | --- |
| **Personal Access Token (Self-Hosted)** | API token | `token` and `instanceUrl` |
| **Self-Hosted** (default) | OAuth | Signs in to GitLab after entering `instanceUrl` |
| **GitLab.com** | OAuth | Signs in to GitLab |
| **Personal Access Token (GitLab.com)** | API token | `token` |

The portal and `metorial setup` use **Self-Hosted** unless someone picks another method.

### Personal Access Token (Self-Hosted)

To connect, a person enters these values:

- `token`: GitLab personal, project, or group access token
- `instanceUrl`: Your self-hosted GitLab instance URL (e.g. https://gitlab.example.com).

### Self-Hosted

Before the sign-in, setup asks for:

- `instanceUrl`: Your self-hosted GitLab instance URL (e.g. https://gitlab.example.com).

People sign in to GitLab and approve the scopes you allow. The integration can request:

| Scope | Name | What it allows |
| --- | --- | --- |
| `api` | API | Complete read/write access to the API, including all groups, projects, registries, and packages |
| `read_api` | Read API | Read-only access to the API |
| `read_user` | Read User | Read-only access to the authenticated user's profile |
| `read_repository` | Read Repository | Read-only access to repositories via Git-over-HTTP |
| `write_repository` | Write Repository | Read-write access to repositories via Git-over-HTTP |
| `read_registry` | Read Registry | Read-only access to container registry images |
| `write_registry` | Write Registry | Write access to container registry images |
| `create_runner` | Create Runner | Permission to create runners |
| `manage_runner` | Manage Runner | Permission to manage runners |
| `ai_features` | AI Features | Access to GitLab Duo AI-related endpoints |
| `openid` | OpenID | Authenticate via OpenID Connect; read-only access to profile and group memberships |
| `profile` | Profile | Read-only access to user profile via OpenID Connect |
| `email` | Email | Read-only access to the user's primary email via OpenID Connect |

### GitLab.com

It requests the same scopes as **Self-Hosted**.

### Personal Access Token (GitLab.com)

To connect, a person enters:

- `token`: GitLab personal, project, or group access token

### Setup settings

Whichever method you pick, setup also asks for:

- `projectId` (optional): Default GitLab project ID or URL-encoded path for project-scoped CI/CD tools.

## Use your own GitLab OAuth app

With your own OAuth app, people see your company's name on the GitLab consent screen, and the client ID and secret belong to you.

1. **Start the credentials in Metorial**

   In the dashboard, select **Settings**, then **Organization Settings**. Under **Integrations and MCP**, select **Provider Auth**, then **Create Auth Credentials**. Choose GitLab and copy the **Redirect URI**.

2. **Register the app with GitLab**

   Create the app on GitLab.com or on your self-hosted instance, whichever people sign in to. For a group-owned app, open the group, select **Settings**, then **Applications**. For a personal app, select your avatar, **Edit profile**, then **Access**, **Applications**, and **Add new application**. Enter a **Name**, paste the redirect URI from Metorial as the **Redirect URI**, select the scopes, and click **Save application**. The **Application ID** is the client ID. Copy the **Secret** now, because GitLab stores it hashed and does not show it again.

   On a self-hosted instance, an administrator can create an instance-wide app under **Admin**, then **Applications**.

3. **Finish in Metorial**

   Copy the app's client ID and client secret. Back in Metorial, enter a **Name**, the **Client ID** and the **Client Secret**, review **Scopes**, and select **Create**. Then pick these credentials for the GitLab integration.

## Admin: share GitLab in a portal

### In the dashboard

1. **Open Shared Resources**

   Open **Workforce**, choose the portal, and select **Shared Resources** under **Access**.

2. **Share a new integration**

   Select **Share a Resource**, then **New Integration**, and choose GitLab. Under **Auth Method**, keep **Self-Hosted** or pick another. For how members connect, choose **Each person connects**, so everyone signs in to GitLab as themselves.

3. **Limit the tools**

   Under **Tool Filters**, set the write and destructive groups to **Reject** if agents should only read from GitLab.

4. **Choose who gets it**

   Add the access groups that should see GitLab. When a person asks for access from the portal, the request appears under **Access Requests**.

### With the CLI

The CLI cannot create the per-user GitLab integration. Once it exists, check which groups have it:

```bash
metorial-admin portals access list <portal-id> --type provider_template --search gitlab
```

## Employee: connect GitLab

### In the portal

1. **Open GitLab in the catalog**

   Sign in to your portal and open GitLab. The status reads **Available**.

2. **Authenticate**

   Under **Quick setup**, select **Authenticate**. A GitLab sign-in tab opens. Sign in and approve the permissions listed.

3. **Confirm**

   The status changes to **Configured**. If it later reads **Needs reconnect**, select **Reconnect** and sign in again.

### With the CLI

```bash
metorial catalog search gitlab
metorial setup <catalog-item-id>
```

`catalog search` prints the catalog item ID. `metorial setup` uses **Self-Hosted**. To connect with **Personal Access Token (Self-Hosted)** instead, find its ID with `metorial catalog get <catalog-item-id>` and add `--auth-method <auth-method-id>`.

### Add it to your AI client

`metorial install` adds your GitLab connection to a local MCP client such as Claude Code, Cursor or Codex. `metorial list` prints the integration ID and `metorial client list` the client identifiers.

```bash
metorial list gitlab
metorial client list
metorial install <client-identifier> <integration-id>
```

For a client that takes a server URL, such as ChatGPT, `metorial install custom <integration-id>` creates an installation token and shows the endpoint details.

## Make it read-only

Open the integration's **Tool Filters** and set the write and destructive groups to **Reject**. Agents keep the 13 read-only tools, such as `search` and `list_jobs`, and lose the 11 write tools, such as `manage_job` or `add_comment`, and the 6 destructive tools, such as `manage_file` or `manage_issue`.

Employees see the result on the integration's page in the portal under **Tool access**. For the full walkthrough, see [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions).

## Check it worked

```bash
metorial list gitlab
metorial tools <integration-id>
metorial call <integration-id> list_jobs -d '{}'
```

`metorial tools` lists the 30 tools, minus any you rejected. `list_jobs` takes no input. It lists CI/CD jobs for a specific pipeline or across a project.

To see every input a tool takes, run `metorial schema <integration-id> <tool-key>`.

## Tools

### Read-only tools (13)

- `list_merge_requests`: List GitLab merge requests, optionally scoped to a project.
- `list_issues`: List GitLab issues filtered by project, state, labels, milestone, assignee, author, or search term.
- `list_pipelines`: List CI/CD pipelines for a project.
- `get_project`: Retrieve detailed information about a specific GitLab project by its ID or URL-encoded path (e.g. "my-group/my-project"). Needs `projectId`.
- `browse_repository`: Browse a project's repository tree, read file contents, or compare branches. Needs `projectId` and `action`.
- `search`: Search across GitLab for projects, issues, merge requests, milestones, code (blobs), commits, wiki content, and users. Needs `scope` and `query`.
- `list_groups`: List GitLab groups accessible to the authenticated user.
- `list_projects`: List GitLab projects accessible to the authenticated user.
- `lint_ci_config`: Validate a `.gitlab-ci.yml` configuration file for syntax errors and configuration issues. Needs `content`.
- `list_deployments`: List deployments for a project, optionally filtered by environment or status.
- `list_jobs`: List CI/CD jobs for a specific pipeline or across a project.
- `get_pipeline`: Retrieve detailed information about a specific pipeline, including status, duration, coverage, source, and associated user. Needs `pipelineId`.
- `get_test_report`: Retrieve the unit test report for a pipeline, including total counts, success/failure breakdowns, test suites, and individual test case details. Needs `pipelineId`.

### Write tools (11)

- `create_release`: Create a new release for a project, or list existing releases. Needs `action` and `projectId`.
- `manage_pipeline`: Trigger, retry, or cancel a CI/CD pipeline. Needs `action`.
- `add_comment`: Add a comment (note) to an issue or merge request. Needs `action`, `projectId`, `targetType` and `targetIid`.
- `get_pipeline_jobs`: List all jobs in a CI/CD pipeline, or get details and logs for a specific job.
- `run_pipeline`: Create and run a new pipeline on a specified branch or tag. Needs `action`.
- `manage_environments`: List, create, update, stop, or delete deployment environments for a project. Needs `action`.
- `manage_job`: Perform actions on a CI/CD job: get details, retry a failed job, cancel a running job, play a manual job, erase job artifacts/logs, or retrieve the job log output. Needs `jobId` and `action`.
- `manage_variables`: List, create, update, or delete CI/CD variables at the project or group level. Needs `action`.
- `manage_triggers`: Create, list, update, or delete pipeline trigger tokens. Needs `action`.
- `manage_schedules`: Create, list, update, or delete scheduled pipelines that run at recurring intervals using cron syntax. Needs `action`.
- `manage_runners`: List, view, update, pause/resume, or delete CI/CD runners. Needs `action`.

### Destructive tools (6)

- `manage_project`: Create, update, fork, or delete a GitLab project. Needs `action`.
- `manage_issue`: Create, update, close, reopen, or delete a GitLab issue. Needs `action` and `projectId`.
- `manage_merge_request`: Create, update, or merge a GitLab merge request. Needs `action` and `projectId`.
- `manage_branch`: List, create, or delete branches in a project repository. Needs `action` and `projectId`.
- `manage_file`: Create, update, or delete a file in a GitLab repository. Needs `action`, `projectId`, `filePath`, `branch` and `commitMessage`.
- `delete_pipeline`: Permanently delete a pipeline and all of its associated resources (jobs, artifacts, logs). Needs `pipelineId`.

## Triggers

GitLab has 6 triggers, which fire on events in GitLab:

- `pipeline_events`: Triggers when a CI/CD pipeline status changes (e.g. pending, running, success, failed, canceled).
- `push_events`: Triggers when code is pushed to a repository or when tags are created/deleted.
- `deployment_events`: Triggers when a deployment starts, succeeds, fails, or is canceled.
- `comment_events`: Triggers when a comment (note) is posted or edited on a commit, merge request, issue, or snippet.
- `issue_events`: Triggers when an issue is created, updated, closed, or reopened in a GitLab project.
- `merge_request_events`: Triggers when a merge request is created, updated, merged, closed, reopened, or approved.

## Next steps

- [Claude Code](https://metorial.com/docs/platform/clients/claude-code), [Cursor](https://metorial.com/docs/platform/clients/cursor), [Codex](https://metorial.com/docs/platform/clients/codex) and [ChatGPT](https://metorial.com/docs/platform/clients/chatgpt): connect each client to your portal and use GitLab there
- [Create custom OAuth credentials](https://metorial.com/docs/platform/integrations/create-custom-oauth-credentials): the Provider Auth screens in more detail
- [Tool permissions](https://metorial.com/docs/platform/guides/tool-permissions): tool filters and what employees see
- [GitLab on metorial.com](https://metorial.com/integrations/gitlab): the integration overview