GitLab MCP server CI/CD tools
- Tier: Free, Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
To provide feedback on this feature, leave a comment on issue 630189.
These tools are part of the ci toolset.
Use them to read pipelines, jobs, job artifacts, and pipeline schedules.
You can also run, retry, cancel, rename, and delete pipelines, and play manual jobs.
For a list of all tools, see GitLab MCP server tools.
get_pipeline
Retrieves a pipeline, and optionally its jobs, downstream pipelines, bridge (trigger) jobs, or the
artifacts its jobs produced. For pipelines in an active state (created, canceling, scheduled,
preparing, pending, running, waiting_for_callback, or waiting_for_resource), the response
includes a poll_after_seconds: 30 hint indicating when callers should poll again.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
pipeline_id | integer | Yes | ID of the pipeline. |
include | array | No | Facet to include alongside the pipeline, one per call: jobs, downstream_pipelines, bridge_jobs, or artifacts. |
job_status | string | No | Filters the jobs facet by status (for example, failed). Only applies when include is jobs. |
first | integer | No | Number of items to return for the selected include facet. For the artifacts facet, this is the number of jobs whose artifacts are returned. Default is 20, maximum is 100. |
after | string | No | Cursor for forward pagination of the selected include facet. Use page_info.end_cursor from a previous response. |
A bridge job’s downstream_pipeline is omitted (null) both when the trigger job hasn’t
triggered a downstream pipeline yet, and when you don’t have access to that pipeline.
Each downstream pipeline includes a project_full_path, because a downstream pipeline can belong to
a different project. Use that value as the id of a follow-up call.
To inspect a child pipeline, use the id of a pipeline in the downstream_pipelines facet, or the
downstream_pipeline.id of a job in the bridge_jobs facet, as the pipeline_id of a follow-up
call.
For example, pass it with include: ["jobs"] and job_status: "failed" to find the failed jobs
of a child pipeline.
The artifacts facet returns a flat list of artifacts. Each artifact carries its name, size,
file_type, expiry information, and the job_id and job_name of the job that produced it.
Pagination pages over the pipeline’s jobs, not over the artifacts.
Examples:
Get a pipeline:
Get the status of pipeline 12345 in project gitlab-org/gitlabGet a pipeline’s failed jobs:
Show me the failed jobs in pipeline 12345 for project gitlab-org/gitlabGet a pipeline’s downstream pipelines:
Show me the downstream pipelines triggered by pipeline 12345 in project gitlab-org/gitlabGet the artifacts a pipeline produced:
List the artifacts of pipeline 12345 in project gitlab-org/gitlab
get_pipeline_jobs
Superseded by get_pipeline with include: ["jobs"], which returns jobs alongside
the rest of the pipeline’s data in a single call. The jobs facet returns fewer fields per job:
it does not include failure_reason, duration, queued_duration, or timestamps. This tool no
longer appears in tools/list but remains callable while callers migrate.
Retrieves the jobs for a specific GitLab CI/CD pipeline.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
pipeline_id | integer | Yes | ID of the pipeline. |
per_page | integer | No | Number of jobs per page. |
page | integer | No | Current page number. |
Example:
Show me all jobs in pipeline 12345 for project gitlab-org/gitlabget_job
Gets a CI/CD job’s metadata, and optionally its trace/log or the artifacts it produced.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
job_id | integer | Yes | ID of the job. |
include | array | No | Facets to include alongside the job: log, artifacts, or both. |
from | string | No | Read from the start or end of the log. Default is start. Only applies to the log facet. Cannot combine end with byte_offset. |
byte_offset | integer | No | Byte offset to start reading the job’s log from. Only applies when include contains log and from is start. Default is 0. |
byte_limit | integer | No | Maximum number of bytes of the job’s log to return. Only applies when include contains log. Default and maximum is 512000. |
When the log is longer than byte_limit, the response reports the total size and tells you the
byte_offset to use for the next window.
To read the last 32 KiB, set from: "end" and byte_limit: 32768.
The response includes log.metadata.returned.start and log.metadata.returned.end,
which identify the returned byte range. The end offset is exclusive.
If earlier bytes exist, log.system_instruction provides arguments for the preceding window.
Use all of those arguments, including from: "start", to replace the tail request’s parameters.
For more earlier windows, subtract the desired window size from the returned start,
clamp the result to zero, and set byte_limit to the distance between those offsets.
log.metadata.truncated indicates that bytes remain after the returned window.
It is false for a tail window that reaches the end, even when earlier bytes exist.
Byte offsets refer to the original log, before replacement of incomplete UTF-8 characters.
The artifacts facet lists every artifact the job produced, with its name, size, file_type,
and expiry information.
Examples:
Get a job’s metadata:
Get the status of job 88 in project gitlab-org/gitlabGet a job’s log:
Show me the log output for job 88 in project gitlab-org/gitlabGet the end of a job’s log:
Show me the last 32 KiB of log output for job 88 in project gitlab-org/gitlabGet a job’s artifacts:
What artifacts did job 88 in project gitlab-org/gitlab produce?
get_artifact_file
Reads a file from the artifacts of a CI/CD job as text: either a file inside the artifacts archive, or a
report artifact stored as its own file, such as a junit or sast report. To discover what a job or
pipeline produced, use the get_job or get_pipeline tool with include: artifacts.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | No | URL of the job. Provide this, or project_id and job_id. |
project_id | string | No | ID or full path of the project. Required if url is not provided. |
job_id | integer | No | ID of the job. Required if url is not provided. |
artifact_path | string | No | Path of the file inside the artifacts archive, for example coverage/index.html. Required when file_type is archive. |
file_type | string | No | Type of artifact to read. Default is archive. For a report stored as its own file, set the artifacts:reports type, for example junit or sast. artifact_path is then not needed. |
byte_offset | integer | No | Byte offset to start reading the file from. Default is 0. |
byte_limit | integer | No | Maximum number of bytes to return. Default and maximum is 1048576 (1 MB). |
Report artifacts from artifacts:reports are stored as separate files, not inside the archive. To read
one, set file_type to the report type. Compressed reports are decompressed before they are returned.
When the file is longer than byte_limit, the response reports the total size and tells you the
byte_offset to use for the next window. Binary files are not returned; the error names the file,
its size and type, and where to view it in the browser.
Examples:
Read a test report from a job’s artifacts:
Read coverage/index.html from the artifacts of job 88 in project gitlab-org/gitlabInvestigate a failed end-to-end test:
Find the JUnit report in the artifacts of job 88 in gitlab-org/gitlab and summarize the failuresRead a report artifact that is not in the archive:
Read the sast report of job 88 in gitlab-org/gitlab
list_pipelines
Lists pipelines in a GitLab project, with optional filters.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
ref | string | No | Branch or tag name. Filters pipelines by ref. |
status | string | No | Filters pipelines by status (for example, running, success, failed). |
source | string | No | Filters pipelines by source (for example, push, web, schedule). |
created_after | string | No | Returns pipelines created after the specified datetime (ISO 8601 format). |
created_before | string | No | Returns pipelines created before the specified datetime (ISO 8601 format). |
order_by | string | No | Orders pipelines by id, status, ref, updated_at, or user_id. Default is id. |
sort | string | No | Sort direction, asc or desc. Default is desc. |
page | integer | No | Current page number. Default is 1. |
per_page | integer | No | Number of items per page. Default is 20. |
Child pipelines are excluded from the results by default. To return only child pipelines, set source to parent_pipeline.
The default order (id, desc) returns pipelines with the highest ID first. ID order usually matches creation order, but the two aren’t guaranteed to agree. Use created_after or created_before to filter by an explicit time boundary. A caller can page through results and stop at the first pipeline outside its target range.
Example:
List all failed pipelines on the main branch for project gitlab-org/gitlablist_pipeline_schedules
Lists pipeline schedules for a GitLab project.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
scope | string | No | Filters schedules by status: active or inactive. |
page | integer | No | Page number to retrieve. Default is 1. |
per_page | integer | No | Number of items per page. Default is 20, maximum is 100. |
The response includes inputs only for the schedule owner and users with the Maintainer or Owner role.
Example:
List active pipeline schedules for project gitlab-org/gitlabsave_pipeline
Runs, retries, cancels, or renames a CI/CD pipeline in a GitLab project. To list pipelines,
use the list_pipelines tool instead.
If a fine-grained token can create, retry, or cancel a pipeline but cannot read the result, the tool reports success and lists the missing read permissions. Do not repeat a successful create call because it creates another pipeline.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | No | GitLab URL of the project. Used only to create a pipeline. Provide this, or project_id. |
project_id | string | No | ID or full path of the project. Used only to create a pipeline. Provide this, or url. |
merge_request_iid | integer | No | Internal ID of a merge request to create a pipeline for. |
pipeline_id | integer | No | ID of an existing pipeline to target. When set, requires action. Omit to create a new pipeline. |
action | string | No | Lifecycle action to perform on pipeline_id: retry, cancel, or update. Required when pipeline_id is set. |
ref | string | No | Branch or tag name. Required to create a pipeline on a branch or tag (when pipeline_id and merge_request_iid are absent). |
name | string | No | New pipeline name. Required for action: "update". |
variables | array | No | Pipeline variables in array format ([{key, value, variable_type}]). |
inputs | hash | No | Pipeline input parameters as key-value pairs. |
Examples:
Create a pipeline:
Create a pipeline on the main branch for project gitlab-org/gitlabCreate a pipeline for a merge request:
Create a pipeline for merge request 42 in project gitlab-org/gitlabRetry a pipeline:
Retry failed jobs in pipeline 12345 for project gitlab-org/gitlabCancel a pipeline:
Cancel pipeline 12345 in project gitlab-org/gitlabRename a pipeline:
Rename pipeline 12345 to "Nightly security scan" in project gitlab-org/gitlab
save_pipeline_job
Prerequisites:
- The job must belong to the specified project, be in the manual state, and be playable.
- You must have permission to play the job, including access to any protected environment it deploys to.
- To pass variables, the authenticated user must have permission to override pipeline variables in the project.
The save_pipeline_job plays an existing manual CI/CD job in a GitLab project, optionally with CI/CD variables.
If you play a job, it might trigger a deployment.
Before you play the job, check it with get_job.
Provide either the job’s url, or both project_id and job_id.
You can also provide url with project_id, job_id, or both.
All supplied identifiers must refer to the same project and job.
| Parameter | Type | Required | Description |
|---|---|---|---|
url | string | No | Full job URL, for example https://gitlab.example.com/group/project/-/jobs/12345. Required if project_id and job_id are not provided. |
project_id | string | No | ID or full path of the project. Required if url is not provided. |
job_id | integer | No | ID of the manual job to play. Required if url is not provided. |
variables | array | No | CI/CD variables in array format ([{key, value, variable_type}]). Each variable requires key and value. The optional variable_type is env_var (default) or file. |
If a fine-grained token can play the job but cannot read the result, the tool reports success and lists the missing read permissions instead of returning job details.
Returns the following job details:
| Field | Type | Description |
|---|---|---|
id | integer | Job ID. |
name | string | Job name. |
status | string | Job status after playing, in lowercase (for example, pending). |
stage | string | Stage name. |
pipeline_id | integer | Pipeline ID. |
web_url | string | URL of the job. |
pipeline_web_url | string | URL of the pipeline. |
Example:
Check job 12345 in project example/my-project, then play it with DEPLOY_ENV set to stagingdelete_pipeline
Deleting a pipeline expires all pipeline caches and deletes all immediately related objects, such as jobs, logs, artifacts, and triggers. This action cannot be undone. Deleting a pipeline does not delete its child pipelines, but it can cancel their running jobs.
Prerequisites:
- You must have the Owner role for the project.
Deletes a specified pipeline in a GitLab project.
Pipeline deletion is rate limited.
To create, retry, cancel, or rename a pipeline, use the save_pipeline tool
instead. To list pipelines, use the list_pipelines tool instead.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
pipeline_id | integer | Yes | ID of the pipeline to delete. |
Example:
Delete pipeline 12345 in project gitlab-org/gitlabvalidate_ci_file
Validates the syntax and structure of a CI/CD configuration. The tool does not create a pipeline.
The response includes valid (true or false), errors, and warnings.
Prerequisites:
- You must have at least the Developer role for the project.
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | Yes | CI/CD YAML content to validate. |
url | string | No | GitLab URL of the project. Provide this, or project_id. |
project_id | string | No | ID or full path of the project. Provide this, or url. |
ref | string | No | Branch or tag used to resolve include: entries. Omit to use the default branch of the project. |
Example:
Check whether this CI/CD configuration is valid for project gitlab-org/gitlab before I commit itmanage_pipeline
This tool is no longer listed but remains callable by agents that have an outdated tools list
or have stored the tool name. To rename a pipeline, use save_pipeline with
action: "update" instead. To delete a pipeline, use delete_pipeline.
Renames a pipeline in a GitLab project. To create, retry, or cancel a pipeline, use the
save_pipeline tool instead. To list pipelines, use the list_pipelines tool instead. To delete a
pipeline, use the delete_pipeline tool.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | string | Yes | ID or full path of the project. |
pipeline_id | integer | Yes | ID of the pipeline to update. |
name | string | Yes | New name of the pipeline. |
Example:
Rename pipeline 12345 to "My deploy pipeline" in project gitlab-org/gitlab