Skip to main content
The GitLab app provides read/write access to the GitLab DevOps platform via its REST v4 API. It can be used either as a Builder app (automations call GitLab instructions directly) or as a remote MCP server consumed by an AI Knowledge agent — covering projects, issues, merge requests, pipelines, branches, commits, releases, CI/CD variables, deploy keys, webhooks, wikis, groups and users. Supports both static Personal Access Tokens and OAuth2 authorization-code per-user delegation.

Project Management

Projects, issues, merge requests, labels, milestones and wikis

CI/CD & DevOps

Pipelines, jobs, environments, CI variables, deploy keys and webhooks

Flexible Auth

Static PAT shared across the tenant, or OAuth2 per-user delegation (each user signs in with their own GitLab account)

Prerequisites

  • A GitLab account (gitlab.com or self-hosted)
  • Either a Personal Access Token with api scope (Preferences > Access Tokens), or an OAuth application registered at User Settings > Applications (https://gitlab.com/-/user_settings/applications) with api scope
  • Base URL (default: https://gitlab.com/api/v4 — override for self-hosted instances)

Installation

  1. Go to Apps in your workspace
  2. Search for GitLab and install it
  3. Open the app instance configuration and fill in the required fields

Configuration

FieldDescription
GitLab API Base URLBase URL of the GitLab API (default https://gitlab.com/api/v4). Override for self-hosted instances.
Personal Access TokenGitLab PAT with api scope, stored as a workspace secret. Optional if OAuth2 is configured. Passed as Authorization: Bearer <token>.
OAuth2 Client IDGitLab OAuth Application Client ID. Create an OAuth application at https://gitlab.com/-/user_settings/applications.
OAuth2 Client SecretOAuth Application Client Secret (shown once on creation), stored as a workspace secret.
OAuth Callback URLAuto-populated on install — paste this value into the OAuth application’s Redirect URI at GitLab.
OAuth ScopesSpace-separated scopes (default: api).
MCP EndpointAuto-populated on install — URL of the MCP endpoint for this instance.
MCP API KeyAuto-populated on install — signed key used in the mcp-api-key header. Do not modify.
MCP Endpoint and MCP API Key are generated automatically by the onInstall flow and are only needed to expose this instance as an MCP server (see the next tab).

Available Instructions

Every instruction resolves credentials from the workspace configuration.

Projects

InstructionArguments
listProjectssearch, visibility, owned, membership, order_by, sort, per_page, page
createProjectname*, path, namespace_id, description, visibility, default_branch, initialize_with_readme
getProjectid*
updateProjectid*, name, path, description, visibility, default_branch
deleteProjectid*
archiveProjectid*
unarchiveProjectid*
forkProjectid*, namespace, namespace_id, name, path

Issues

InstructionArguments
listIssuesid*, state, labels, milestone, search, assignee_username, per_page, page
createIssueid, title, description, labels, assignee_ids, milestone_id, confidential, due_date
getIssueid, iid
updateIssueid, iid, title, description, labels, assignee_ids, milestone_id, state_event
deleteIssueid, iid
closeIssueid, iid
reopenIssueid, iid
listIssueNotesid, iid, sort, order_by, per_page
createIssueNoteid, iid, body*, confidential
getIssueNoteid, iid, note_id*
updateIssueNoteid, iid, note_id, body
deleteIssueNoteid, iid, note_id*

Merge Requests

InstructionArguments
listMergeRequestsid*, state, source_branch, target_branch, labels, search, per_page
createMergeRequestid, source_branch, target_branch, title, description, assignee_ids, reviewer_ids, labels, milestone_id, remove_source_branch, squash
getMergeRequestid, iid
updateMergeRequestid, iid, title, description, target_branch, assignee_ids, labels, milestone_id, state_event
deleteMergeRequestid, iid
mergeMergeRequestid, iid, merge_commit_message, squash_commit_message, squash, should_remove_source_branch, merge_when_pipeline_succeeds, sha
approveMergeRequestid, iid, sha
unapproveMergeRequestid, iid
listMergeRequestNotesid, iid, sort, order_by, per_page
createMergeRequestNoteid, iid, body*
getMergeRequestNoteid, iid, note_id*
updateMergeRequestNoteid, iid, note_id, body
deleteMergeRequestNoteid, iid, note_id*

Branches

InstructionArguments
listBranchesid*, search, per_page
createBranchid, branch, ref*
getBranchid, branch
deleteBranchid, branch

Commits

InstructionArguments
listCommitsid*, ref_name, since, until, path, author, per_page
createCommitid, branch, commit_message, start_branch, start_sha, author_email, author_name, actions
getCommitid, sha
cherryPickCommitid, sha, branch*, dry_run, message
revertCommitid, sha, branch*, dry_run

Tags

InstructionArguments
listTagsid*, search, order_by, sort, per_page
createTagid, tag_name, ref*, message
getTagid, tag_name

Releases

InstructionArguments
listReleasesid*, order_by, sort, per_page
createReleaseid, name, tag_name, description, ref, released_at
getReleaseid, tag_name
deleteReleaseid, tag_name

Pipelines & Jobs

InstructionArguments
listPipelinesid*, status, ref, sha, username, order_by, sort, per_page
createPipelineid, ref, variables
getPipelineid, pipeline_id
retryPipelineid, pipeline_id
cancelPipelineid, pipeline_id
listPipelineJobsid, pipeline_id, scope, per_page
getJobid, job_id
retryJobid, job_id

Environments

InstructionArguments
listEnvironmentsid*, name, search, states, per_page
getEnvironmentid, environment_id
stopEnvironmentid, environment_id

Labels

InstructionArguments
listLabelsid*, with_counts, search, per_page
createLabelid, name, color*, description, priority
updateLabelid*, name, label_id, new_name, color, description, priority
deleteLabelid*, name, label_id

Milestones

InstructionArguments
listMilestonesid*, state, search, per_page
createMilestoneid, title, description, due_date, start_date
getMilestoneid, milestone_id
updateMilestoneid, milestone_id, title, description, due_date, start_date, state_event

Wiki

InstructionArguments
listWikiPagesid*, with_content
createWikiPageid, title, content*, format
getWikiPageid, slug, render_html, version

Webhooks

InstructionArguments
listProjectHooksid*, per_page
createProjectHookid, url, token, push_events, issues_events, merge_requests_events, tag_push_events, note_events, job_events, pipeline_events, wiki_page_events, enable_ssl_verification
deleteProjectHookid, hook_id

CI/CD Variables

InstructionArguments
listProjectVariablesid*, per_page
createProjectVariableid, key, value*, variable_type, protected, masked, raw, environment_scope, description
updateProjectVariableid, key, filter[environment_scope], value, variable_type, protected, masked, raw, environment_scope, description
deleteProjectVariableid, key, filter[environment_scope]

Deploy Keys

InstructionArguments
listDeployKeysid*, per_page
createDeployKeyid, title, key*, can_push
deleteDeployKeyid, key_id

Project Members

InstructionArguments
listProjectMembersid*, query, per_page
addProjectMemberid, user_id, access_level*, expires_at
removeProjectMemberid, user_id

Users

InstructionArguments
getCurrentUser
getUseruser_id*
listUsersactive, blocked, username, per_page, page
searchUserssearch*, per_page

Groups

InstructionArguments
listGroupssearch, owned, min_access_level, top_level_only, per_page
createGroupname, path, description, visibility, parent_id
getGroupid*
updateGroupid*, name, path, description, visibility
Arguments flagged with * are required.

DSUL Examples

List the user’s own projects

- GitLab.listProjects:
    membership: true
    order_by: last_activity_at
    sort: desc
    per_page: 20
    output: myProjects

Create an issue with labels and an assignee

- GitLab.createIssue:
    id: '{{projectId}}'
    title: Investigate 500s on /api/v1/search
    description: |
      Spike of 500s since 14:00 UTC. Logs in Kibana (link).
    labels: BUG,Incident
    assignee_ids:
      - '{{oncallUserId}}'
    output: issue

Open a merge request from a feature branch

- GitLab.createBranch:
    id: '{{projectId}}'
    branch: feature/auto-deploy
    ref: main
    output: branch
- GitLab.createMergeRequest:
    id: '{{projectId}}'
    source_branch: feature/auto-deploy
    target_branch: main
    title: Automate staging deploy
    description: Closes #{{issue.iid}}
    remove_source_branch: true
    output: mr

Trigger a pipeline on a specific ref

- GitLab.createPipeline:
    id: '{{projectId}}'
    ref: main
    variables:
      - key: DEPLOY_ENV
        value: staging
    output: pipeline

Error Handling

HTTP StatusErrorSolution
400Bad requestCheck argument shapes (IDs, dates, enum values)
401UnauthorizedVerify the PAT has api scope, or re-authorize OAuth
403ForbiddenThe token lacks permission on this project/group — check access level
404Not FoundVerify the project ID (numeric or URL-encoded path) and resource IID
409ConflictCommon on merge conflicts or concurrent updates
429Rate LimitedGitLab.com enforces 2000 req/min per-token; back off and retry
500Server ErrorTransient GitLab issue; retry after a few seconds

Common Issues

“Not configured” — The app instance has no API key. Generate one at the provider and paste it in the app configuration. “Invalid API key” (MCP) — The mcp-api-key header does not match the central app secret. Reinstall the app instance to regenerate a signed key. “Credentials lookup failed” — The MCP endpoint could not reach the getConfig webhook of the installed app. Verify that the app instance is still installed in the expected workspace. “Can’t approve own MR” — A GitLab project access token’s bot user counts as the MR author and cannot approve its own merge requests. Use a different token (PAT for a human user) for the approval step. “pipeline creation 404” — The target ref has no .gitlab-ci.yml at its root. Either commit a CI config first or pick a ref that has one. OAuth per-user delegation — Each GitLab user must click the connect tool once (from the AI agent) to authorize; the agent stores a per-user refresh token. Use disconnect to revoke.

External Resources

GitLab REST API

Official GitLab REST v4 API reference

Tool Agents

Plug MCP servers into AI Knowledge agents