MetorialDocs

Set up GitLab in Metorial for Claude, ChatGPT and Cursor

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'll 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

Sign-in methods

MethodTypeWhat a person provides
Personal Access Token (Self-Hosted)API tokentoken and instanceUrl
Self-Hosted (default)OAuthSigns in to GitLab after entering instanceUrl
GitLab.comOAuthSigns in to GitLab
Personal Access Token (GitLab.com)API tokentoken

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:

ScopeNameWhat it allows
apiAPIComplete read/write access to the API, including all groups, projects, registries, and packages
read_apiRead APIRead-only access to the API
read_userRead UserRead-only access to the authenticated user's profile
read_repositoryRead RepositoryRead-only access to repositories via Git-over-HTTP
write_repositoryWrite RepositoryRead-write access to repositories via Git-over-HTTP
read_registryRead RegistryRead-only access to container registry images
write_registryWrite RegistryWrite access to container registry images
create_runnerCreate RunnerPermission to create runners
manage_runnerManage RunnerPermission to manage runners
ai_featuresAI FeaturesAccess to GitLab Duo AI-related endpoints
openidOpenIDAuthenticate via OpenID Connect; read-only access to profile and group memberships
profileProfileRead-only access to user profile via OpenID Connect
emailEmailRead-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.

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.

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.

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

Open Shared Resources

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

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.

Limit the tools

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

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:

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

Employee: connect GitLab

In the portal

Open GitLab in the catalog

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

Authenticate

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

Confirm

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

With the CLI

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.

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.

Check it worked

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