Documentation Index Fetch the complete documentation index at: https://prismeai-legacy.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
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)
Usage as App
Usage as MCP
Installation
Go to Apps in your workspace
Search for GitLab and install it
Open the app instance configuration and fill in the required fields
Configuration Field Description GitLab API Base URL Base URL of the GitLab API (default https://gitlab.com/api/v4). Override for self-hosted instances. Personal Access Token GitLab PAT with api scope, stored as a workspace secret. Optional if OAuth2 is configured. Passed as Authorization: Bearer <token>. OAuth2 Client ID GitLab OAuth Application Client ID. Create an OAuth application at https://gitlab.com/-/user_settings/applications. OAuth2 Client Secret OAuth Application Client Secret (shown once on creation), stored as a workspace secret. OAuth Callback URL Auto-populated on install — paste this value into the OAuth application’s Redirect URI at GitLab. OAuth Scopes Space-separated scopes (default: api). MCP Endpoint Auto-populated on install — URL of the MCP endpoint for this instance. MCP API Key Auto-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 Instruction Arguments listProjectssearch, visibility, owned, membership, order_by, sort, per_page, pagecreateProjectname*, path, namespace_id, description, visibility, default_branch, initialize_with_readmegetProjectid*updateProjectid*, name, path, description, visibility, default_branchdeleteProjectid*archiveProjectid*unarchiveProjectid*forkProjectid*, namespace, namespace_id, name, path
Issues Instruction Arguments listIssuesid*, state, labels, milestone, search, assignee_username, per_page, pagecreateIssueid, title , description, labels, assignee_ids, milestone_id, confidential, due_dategetIssueid, iid updateIssueid, iid , title, description, labels, assignee_ids, milestone_id, state_eventdeleteIssueid, iid closeIssueid, iid reopenIssueid, iid listIssueNotesid, iid , sort, order_by, per_pagecreateIssueNoteid, iid , body*, confidentialgetIssueNoteid, iid , note_id*updateIssueNoteid, iid , note_id, body deleteIssueNoteid, iid , note_id*
Merge Requests Instruction Arguments listMergeRequestsid*, state, source_branch, target_branch, labels, search, per_pagecreateMergeRequestid, source_branch , target_branch, title , description, assignee_ids, reviewer_ids, labels, milestone_id, remove_source_branch, squashgetMergeRequestid, iid updateMergeRequestid, iid , title, description, target_branch, assignee_ids, labels, milestone_id, state_eventdeleteMergeRequestid, iid mergeMergeRequestid, iid , merge_commit_message, squash_commit_message, squash, should_remove_source_branch, merge_when_pipeline_succeeds, shaapproveMergeRequestid, iid , shaunapproveMergeRequestid, iid listMergeRequestNotesid, iid , sort, order_by, per_pagecreateMergeRequestNoteid, iid , body*getMergeRequestNoteid, iid , note_id*updateMergeRequestNoteid, iid , note_id, body deleteMergeRequestNoteid, iid , note_id*
Branches Instruction Arguments listBranchesid*, search, per_pagecreateBranchid, branch , ref*getBranchid, branch deleteBranchid, branch
Commits Instruction Arguments listCommitsid*, ref_name, since, until, path, author, per_pagecreateCommitid, branch , commit_message, start_branch, start_sha, author_email, author_name, actions getCommitid, sha cherryPickCommitid, sha , branch*, dry_run, messagerevertCommitid, sha , branch*, dry_run
Instruction Arguments listTagsid*, search, order_by, sort, per_pagecreateTagid, tag_name , ref*, messagegetTagid, tag_name
Releases Instruction Arguments listReleasesid*, order_by, sort, per_pagecreateReleaseid, name, tag_name , description, ref, released_atgetReleaseid, tag_name deleteReleaseid, tag_name
Pipelines & Jobs Instruction Arguments listPipelinesid*, status, ref, sha, username, order_by, sort, per_pagecreatePipelineid, ref , variablesgetPipelineid, pipeline_id retryPipelineid, pipeline_id cancelPipelineid, pipeline_id listPipelineJobsid, pipeline_id , scope, per_pagegetJobid, job_id retryJobid, job_id
Environments Instruction Arguments listEnvironmentsid*, name, search, states, per_pagegetEnvironmentid, environment_id stopEnvironmentid, environment_id
Labels Instruction Arguments listLabelsid*, with_counts, search, per_pagecreateLabelid, name , color*, description, priorityupdateLabelid*, name, label_id, new_name, color, description, prioritydeleteLabelid*, name, label_id
Milestones Instruction Arguments listMilestonesid*, state, search, per_pagecreateMilestoneid, title , description, due_date, start_dategetMilestoneid, milestone_id updateMilestoneid, milestone_id , title, description, due_date, start_date, state_event
Wiki Instruction Arguments listWikiPagesid*, with_contentcreateWikiPageid, title , content*, formatgetWikiPageid, slug , render_html, version
Webhooks Instruction Arguments listProjectHooksid*, per_pagecreateProjectHookid, url , token, push_events, issues_events, merge_requests_events, tag_push_events, note_events, job_events, pipeline_events, wiki_page_events, enable_ssl_verificationdeleteProjectHookid, hook_id
CI/CD Variables Instruction Arguments listProjectVariablesid*, per_pagecreateProjectVariableid, key , value*, variable_type, protected, masked, raw, environment_scope, descriptionupdateProjectVariableid, key , filter[environment_scope], value, variable_type, protected, masked, raw, environment_scope, descriptiondeleteProjectVariableid, key , filter[environment_scope]
Deploy Keys Instruction Arguments listDeployKeysid*, per_pagecreateDeployKeyid, title , key*, can_pushdeleteDeployKeyid, key_id
Project Members Instruction Arguments listProjectMembersid*, query, per_pageaddProjectMemberid, user_id , access_level*, expires_atremoveProjectMemberid, user_id
Users Instruction Arguments getCurrentUser– getUseruser_id*listUsersactive, blocked, username, per_page, pagesearchUserssearch*, per_page
Groups Instruction Arguments listGroupssearch, owned, min_access_level, top_level_only, per_pagecreateGroupname, path , description, visibility, parent_idgetGroupid*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
The GitLab app ships with a built-in MCP server. Each app instance gets its own signed mcp-api-key that encodes the workspace ID and a credentials lookup URL — the GitLab API key itself is never passed through headers and is resolved server-side from the app configuration. Use this flow to plug the GitLab MCP into an AI Knowledge agent that does not yet support the native MCP picker.
Install the GitLab app
Install and configure the app in the same workspace as your agent (see the Usage as App tab). Once configured, mcpEndpoint and mcpApiKey are auto-populated.
Copy the MCP credentials
Open the app instance config and copy the values of MCP Endpoint and MCP API Key .
Open your AI Knowledge project
Navigate to Advanced > Tools .
Add an MCP tool
Click Add and select the MCP tab.
Fill in the endpoint
Paste the MCP Endpoint URL copied from the app instance.
Add the auth header
In the Headers field, add the signed API key: {
"mcp-api-key" : "your-mcp-api-key"
}
Save
The agent can now list and call GitLab tools through the MCP endpoint.
The signed mcp-api-key encodes the workspace ID and the getConfig webhook URL. The MCP server validates the signature using the central app secret and transparently fetches the GitLab API key and base URL from the installed app. Credentials are cached per tenant for 10 minutes.
Every tool accepts an outputFormat parameter that controls the MCP response shape:
verbose (default) — human-readable text for LLM consumption
structured — machine-readable JSON in structuredContent
both — both text and structured content
Projects Tool Description listProjectsList GitLab projects accessible to the authenticated user. Important : by default this returns ALL accessible projects including publi… createProjectCreate a new project. getProjectGet a project by ID or URL-encoded namespace/path. updateProjectUpdate an existing project. deleteProjectDelete a project. archiveProjectArchive a project. unarchiveProjectUnarchive a project. forkProjectFork a project into the authenticated user’s namespace or given namespace.
Issues Tool Description listIssuesList issues of a project. createIssueCreate a new issue in a project. getIssueGet a single issue by iid. updateIssueUpdate an existing issue. deleteIssueDelete an issue. closeIssueClose an issue (via state_event=close). reopenIssueReopen a closed issue (via state_event=reopen). listIssueNotesList notes (comments) of an issue. createIssueNoteCreate a new note (comment) on an issue. getIssueNoteGet a specific note from an issue. updateIssueNoteUpdate an existing issue note. deleteIssueNoteDelete an issue note.
Merge Requests Tool Description listMergeRequestsList merge requests of a project. createMergeRequestCreate a new merge request. getMergeRequestGet a single merge request by iid. updateMergeRequestUpdate an existing merge request. deleteMergeRequestDelete a merge request. mergeMergeRequestAccept and merge an open merge request. approveMergeRequestApprove a merge request. unapproveMergeRequestUnapprove a merge request. listMergeRequestNotesList notes (comments) of a merge request. createMergeRequestNoteCreate a note (comment) on a merge request. getMergeRequestNoteGet a specific note from a merge request. updateMergeRequestNoteUpdate an existing MR note. deleteMergeRequestNoteDelete a merge request note.
Branches Tool Description listBranchesList branches of a project repository. createBranchCreate a new branch from a ref. getBranchGet a single branch. deleteBranchDelete a branch.
Commits Tool Description listCommitsList commits of a project repository. createCommitCreate a commit with one or more file actions. getCommitGet a single commit by SHA. cherryPickCommitCherry-pick a commit onto a target branch. revertCommitRevert a commit on a target branch.
Tool Description listTagsList tags of a project repository. createTagCreate a new tag from a ref. getTagGet a single tag.
Releases Tool Description listReleasesList releases of a project. createReleaseCreate a new release for a tag. getReleaseGet a single release by tag name. deleteReleaseDelete a release.
Pipelines & Jobs Tool Description listPipelinesList pipelines of a project. createPipelineTrigger a new pipeline for a given ref. getPipelineGet a single pipeline. retryPipelineRetry failed jobs in a pipeline. cancelPipelineCancel running jobs in a pipeline. listPipelineJobsList jobs belonging to a pipeline. getJobGet a single CI job. retryJobRetry a single job.
Environments Tool Description listEnvironmentsList environments of a project. getEnvironmentGet a single environment. stopEnvironmentStop a running environment.
Labels Tool Description listLabelsList labels of a project. createLabelCreate a new project label. updateLabelUpdate an existing project label (by name or id). deleteLabelDelete a project label (by name or id).
Milestones Tool Description listMilestonesList milestones of a project. createMilestoneCreate a new milestone in a project. getMilestoneGet a single milestone. updateMilestoneUpdate a milestone.
Wiki Tool Description listWikiPagesList wiki pages of a project. createWikiPageCreate a new wiki page. getWikiPageGet a single wiki page by slug.
Webhooks Tool Description listProjectHooksList project webhooks. createProjectHookAdd a new project webhook. deleteProjectHookDelete a project webhook.
CI/CD Variables Tool Description listProjectVariablesList CI/CD variables of a project. createProjectVariableCreate a new project CI/CD variable. updateProjectVariableUpdate an existing project CI/CD variable. deleteProjectVariableDelete a project CI/CD variable.
Deploy Keys Tool Description listDeployKeysList deploy keys of a project. createDeployKeyAdd a new deploy key to a project. deleteDeployKeyDelete a deploy key from a project.
Project Members Tool Description listProjectMembersList direct members of a project. addProjectMemberAdd a user as a member to a project. removeProjectMemberRemove a member from a project.
Users Tool Description getCurrentUserGet the currently authenticated user. getUserGet a single user by ID. listUsersList users (admin-scoped or filtered). searchUsersSearch users by name, username or email.
Groups Tool Description listGroupsList groups accessible to the authenticated user. createGroupCreate a new group. getGroupGet a single group by ID or URL-encoded path. updateGroupUpdate a group.
OAuth Session Tool Description disconnectDisconnect the current GitLab OAuth session and revoke the access token at the provider (RFC 7009). Only call when the user explicitly as… connectInitiate an OAuth connection to GitLab. Returns a connect_url for the user to click. **Prefer calling data tools directly (listProjects, …
createIssue Open an issue in a GitLab project. {
"name" : "createIssue" ,
"arguments" : {
"id" : "123456" ,
"title" : "Investigate 500s on /api/v1/search" ,
"description" : "Spike of 500s since 14:00 UTC." ,
"labels" : "BUG,Incident" ,
"assignee_ids" : [ 987654 ]
}
}
Parameter Required Description idYes Project ID (numeric) or URL-encoded namespace/project titleYes Issue title descriptionNo Markdown body labelsNo Comma-separated label names assignee_idsNo Array of user IDs milestone_idNo Milestone ID to associate confidentialNo true to make the issue confidentialdue_dateNo YYYY-MM-DD
createMergeRequest {
"name" : "createMergeRequest" ,
"arguments" : {
"id" : "123456" ,
"source_branch" : "feature/auto-deploy" ,
"target_branch" : "main" ,
"title" : "Automate staging deploy" ,
"description" : "Closes #42" ,
"remove_source_branch" : true
}
}
source_branch, target_branch and title are required. Accepts assignee_id, reviewer_ids, labels, milestone_id, squash, allow_collaboration.createPipeline Trigger a new pipeline on a given ref. Requires a .gitlab-ci.yml at the ref. {
"name" : "createPipeline" ,
"arguments" : {
"id" : "123456" ,
"ref" : "main" ,
"variables" : [
{ "key" : "DEPLOY_ENV" , "value" : "staging" }
]
}
}
Parameter Required Description idYes Project ID refYes Branch or tag to run against variablesNo Array of {key, value, variable_type?} overrides
listProjects List accessible projects. By default returns ALL accessible projects including public ones. Pass membership: true or owned: true to limit to the user’s own projects. {
"name" : "listProjects" ,
"arguments" : {
"membership" : true ,
"order_by" : "last_activity_at" ,
"sort" : "desc" ,
"per_page" : 20
}
}
Parameter Required Description membershipNo true → only projects the user is a member ofownedNo true → only projects the user ownssearchNo Free-text filter on project name/path visibilityNo public / internal / privateorder_byNo e.g. last_activity_at, created_at, name sortNo asc / descper_pageNo 1-100 (default 20)
createBranch {
"name" : "createBranch" ,
"arguments" : {
"id" : "123456" ,
"branch" : "feature/auto-deploy" ,
"ref" : "main"
}
}
ref is the source branch or commit SHA. To delete a branch later use deleteBranch with {id, branch}.mergeMergeRequest Merge an open merge request. The MR must be in a mergeable state. {
"name" : "mergeMergeRequest" ,
"arguments" : {
"id" : "123456" ,
"iid" : 1 ,
"squash" : true ,
"should_remove_source_branch" : true
}
}
Accepts merge_commit_message, squash_commit_message, sha (to fail if HEAD changed).
Error Handling
HTTP Status Error Solution 400 Bad request Check argument shapes (IDs, dates, enum values) 401 Unauthorized Verify the PAT has api scope, or re-authorize OAuth 403 Forbidden The token lacks permission on this project/group — check access level 404 Not Found Verify the project ID (numeric or URL-encoded path) and resource IID 409 Conflict Common on merge conflicts or concurrent updates 429 Rate Limited GitLab.com enforces 2000 req/min per-token; back off and retry 500 Server Error Transient 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