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.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
pipeline_idintegerYesID of the pipeline.
includearrayNoFacet to include alongside the pipeline, one per call: jobs, downstream_pipelines, bridge_jobs, or artifacts.
job_statusstringNoFilters the jobs facet by status (for example, failed). Only applies when include is jobs.
firstintegerNoNumber 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.
afterstringNoCursor 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/gitlab
  • Get a pipeline’s failed jobs:

    Show me the failed jobs in pipeline 12345 for project gitlab-org/gitlab
  • Get a pipeline’s downstream pipelines:

    Show me the downstream pipelines triggered by pipeline 12345 in project gitlab-org/gitlab
  • Get 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.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
pipeline_idintegerYesID of the pipeline.
per_pageintegerNoNumber of jobs per page.
pageintegerNoCurrent page number.

Example:

Show me all jobs in pipeline 12345 for project gitlab-org/gitlab

get_job

Gets a CI/CD job’s metadata, and optionally its trace/log or the artifacts it produced.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
job_idintegerYesID of the job.
includearrayNoFacets to include alongside the job: log, artifacts, or both.
fromstringNoRead from the start or end of the log. Default is start. Only applies to the log facet. Cannot combine end with byte_offset.
byte_offsetintegerNoByte offset to start reading the job’s log from. Only applies when include contains log and from is start. Default is 0.
byte_limitintegerNoMaximum 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/gitlab
  • Get a job’s log:

    Show me the log output for job 88 in project gitlab-org/gitlab
  • Get the end of a job’s log:

    Show me the last 32 KiB of log output for job 88 in project gitlab-org/gitlab
  • Get 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.

ParameterTypeRequiredDescription
urlstringNoURL of the job. Provide this, or project_id and job_id.
project_idstringNoID or full path of the project. Required if url is not provided.
job_idintegerNoID of the job. Required if url is not provided.
artifact_pathstringNoPath of the file inside the artifacts archive, for example coverage/index.html. Required when file_type is archive.
file_typestringNoType 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_offsetintegerNoByte offset to start reading the file from. Default is 0.
byte_limitintegerNoMaximum 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/gitlab
  • Investigate a failed end-to-end test:

    Find the JUnit report in the artifacts of job 88 in gitlab-org/gitlab and summarize the failures
  • Read 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.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
refstringNoBranch or tag name. Filters pipelines by ref.
statusstringNoFilters pipelines by status (for example, running, success, failed).
sourcestringNoFilters pipelines by source (for example, push, web, schedule).
created_afterstringNoReturns pipelines created after the specified datetime (ISO 8601 format).
created_beforestringNoReturns pipelines created before the specified datetime (ISO 8601 format).
order_bystringNoOrders pipelines by id, status, ref, updated_at, or user_id. Default is id.
sortstringNoSort direction, asc or desc. Default is desc.
pageintegerNoCurrent page number. Default is 1.
per_pageintegerNoNumber 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/gitlab

list_pipeline_schedules

Lists pipeline schedules for a GitLab project.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
scopestringNoFilters schedules by status: active or inactive.
pageintegerNoPage number to retrieve. Default is 1.
per_pageintegerNoNumber 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/gitlab

save_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.

ParameterTypeRequiredDescription
urlstringNoGitLab URL of the project. Used only to create a pipeline. Provide this, or project_id.
project_idstringNoID or full path of the project. Used only to create a pipeline. Provide this, or url.
merge_request_iidintegerNoInternal ID of a merge request to create a pipeline for.
pipeline_idintegerNoID of an existing pipeline to target. When set, requires action. Omit to create a new pipeline.
actionstringNoLifecycle action to perform on pipeline_id: retry, cancel, or update. Required when pipeline_id is set.
refstringNoBranch or tag name. Required to create a pipeline on a branch or tag (when pipeline_id and merge_request_iid are absent).
namestringNoNew pipeline name. Required for action: "update".
variablesarrayNoPipeline variables in array format ([{key, value, variable_type}]).
inputshashNoPipeline input parameters as key-value pairs.

Examples:

  • Create a pipeline:

    Create a pipeline on the main branch for project gitlab-org/gitlab
  • Create a pipeline for a merge request:

    Create a pipeline for merge request 42 in project gitlab-org/gitlab
  • Retry a pipeline:

    Retry failed jobs in pipeline 12345 for project gitlab-org/gitlab
  • Cancel a pipeline:

    Cancel pipeline 12345 in project gitlab-org/gitlab
  • Rename 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.

ParameterTypeRequiredDescription
urlstringNoFull job URL, for example https://gitlab.example.com/group/project/-/jobs/12345. Required if project_id and job_id are not provided.
project_idstringNoID or full path of the project. Required if url is not provided.
job_idintegerNoID of the manual job to play. Required if url is not provided.
variablesarrayNoCI/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:

FieldTypeDescription
idintegerJob ID.
namestringJob name.
statusstringJob status after playing, in lowercase (for example, pending).
stagestringStage name.
pipeline_idintegerPipeline ID.
web_urlstringURL of the job.
pipeline_web_urlstringURL of the pipeline.

Example:

Check job 12345 in project example/my-project, then play it with DEPLOY_ENV set to staging

delete_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.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
pipeline_idintegerYesID of the pipeline to delete.

Example:

Delete pipeline 12345 in project gitlab-org/gitlab

validate_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.
ParameterTypeRequiredDescription
contentstringYesCI/CD YAML content to validate.
urlstringNoGitLab URL of the project. Provide this, or project_id.
project_idstringNoID or full path of the project. Provide this, or url.
refstringNoBranch 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 it

manage_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.

ParameterTypeRequiredDescription
idstringYesID or full path of the project.
pipeline_idintegerYesID of the pipeline to update.
namestringYesNew name of the pipeline.

Example:

Rename pipeline 12345 to "My deploy pipeline" in project gitlab-org/gitlab