Gitlab Ci MCP logo

Gitlab Ci MCP

by mshegolev

MCP server enabling AI agents to interact with GitLab CI/CD pipelines, jobs, schedules, MRs, branches, tags, and repo files.

Install Gitlab Ci MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mshegolev-gitlab-ci-mcp": {
      "command": "uvx",
      "args": [
        "--from",
        "gitlab-ci-mcp",
        "gitlab-ci-mcp"
      ],
      "env": {
        "GITLAB_URL": "YOUR_VALUE_HERE",
        "GITLAB_TOKEN": "YOUR_VALUE_HERE",
        "GITLAB_PROJECT_PATH": "YOUR_VALUE_HERE",
        "GITLAB_SSL_VERIFY": "YOUR_VALUE_HERE",
        "GITLAB_NO_PROXY_DOMAINS": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 23 tools correctly ().

Overview

This MCP server provides tools for managing GitLab CI/CD resources including pipelines, jobs, schedules, branches, tags, merge requests, and repository files. It supports any GitLab instance, whether SaaS or self-hosted, with features tailored for corporate network environments. The server offers structured outputs, error handling, pagination, and progress reporting, making it suitable for integrating AI agents that need to automate or query GitLab CI/CD workflows.

Use cases

  • Query and manage GitLab pipelines and jobs
  • Create, update, and delete CI/CD schedules
  • List and compare branches and tags
  • Create and merge GitLab merge requests
  • Retrieve repository files and project information

Key features

  • Supports pipelines, jobs, schedules, branches, tags, merge requests, and repo files
  • Works with any GitLab instance (SaaS or self-hosted)
  • Structured output with TypedDict schemas and markdown
  • Handles authentication, rate limits, and errors with actionable messages
  • Supports pagination and progress reporting via MCP Context
  • Configurable SSL verification and proxy settings

Tools23

What Gitlab Ci MCP lets your agent do. Expand a tool for its parameters.

Verified live~6.6k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

13/13 checks healthy over the last 111d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · gitlab-ci-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars2Stargazers on the source repository.
Last commit3d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed23Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

gitlab-ci-mcp

PyPI Python License: MIT Downloads

MCP server for GitLab CI/CD. Lets an LLM agent (Claude Code, Cursor, OpenCode, DevX Agent, etc.) work with pipelines, jobs, schedules, branches, tags, merge requests and repository files.

Python and FastMCP. Local stdio remains the default; opt-in Streamable HTTP supports shared deployments with one GitLab PAT per caller.

Supports GitLab.com and self-managed GitLab; see the compatibility policy below. Designed with corporate networks in mind: configurable NO_PROXY handling, optional SSL-verify toggle, per-project scoping via env vars.

GitLab compatibility

The project supports GitLab.com and self-managed releases that GitLab currently maintains. As of 2026-11-26, GitLab's maintained release lines are 19.4, 19.5, and 19.6 (GitLab maintenance policy). This list changes with GitLab's monthly release cycle; check the linked policy for the current list before planning upgrades.

This is the project's support policy, not a claim that each server version has been tested by this repository. CI currently tests Python 3.10, 3.11, and 3.12; it does not run a GitLab server-version matrix.

For gitlab_list_schedules, GitLab may omit schedule variables and inputs from API responses unless the caller is a Maintainer or Owner, or owns the schedule (Pipeline schedules API).

Design highlights

  • Tool annotations — every tool carries readOnlyHint / destructiveHint / idempotentHint / openWorldHint so MCP clients can classify operations (e.g. ask for confirmation only on destructive ones like gitlab_merge_mr, gitlab_delete_schedule).
  • Structured output on every tool — each tool declares a TypedDict return type, so FastMCP auto-generates an outputSchema and every result carries structuredContent alongside a pre-rendered markdown text block. Clients that can render structured data use it; agents that prefer compact text get the markdown. No response_format parameter needed.
  • Structured errors — authentication, 404, 403, 429 (rate-limit), 5xx, missing-env errors are converted to actionable ToolError messages (e.g. "GitLab authentication failed… verify GITLAB_TOKEN has api scope") and surfaced as isError=True results.
  • Pydantic input validation — every argument has typed constraints (ranges, lengths, literals) auto-exposed as JSON Schema.
  • Explicit project scoping — every GitLab tool requires project_path by default. Set GITLAB_ALLOW_DEFAULT_PROJECT=true to opt into the legacy environment fallback.
  • Pagination — list tools return a pagination block with page, total, has_more, next_page and a next-page hint in the markdown footer.
  • Per-user HTTP credentials — in Streamable HTTP mode every request must carry X-GitLab-Token; GitLab API calls and cached clients are isolated by PAT. Stdio remains single-user with GITLAB_TOKEN.
  • MCP Resources — gitlab://project/info and gitlab://project/ci-config mirror common lookups for clients that prefer the Resource model over tools.
  • Lifespan management — python-gitlab HTTP sessions are closed cleanly on server shutdown via an asynccontextmanager lifespan hook.
  • Log grep — gitlab_get_job_log accepts grep_pattern + grep_context (surrounding lines) for regex-filtering megabyte-scale CI logs without pulling the whole trace into agent context.

Threading model

FastMCP automatically runs synchronous tools in a worker thread (anyio.to_thread.run_sync), so they do not block the asyncio event loop — python-gitlab is a synchronous library and wrapping every call in asyncio.to_thread ourselves would be ceremony. Tools that benefit from the MCP Context (progress, info logs) are written as async def and explicitly wrap python-gitlab calls with asyncio.to_thread.

Features

26 tools covering the everyday CI/CD surface:

Pipelines gitlab_list_pipelines · gitlab_get_pipeline · gitlab_get_pipeline_jobs · gitlab_get_job_log · gitlab_list_job_artifacts · gitlab_get_job_artifact · gitlab_trigger_pipeline · gitlab_retry_pipeline · gitlab_cancel_pipeline · gitlab_pipeline_health

Schedules gitlab_list_schedules · gitlab_create_schedule · gitlab_update_schedule · gitlab_delete_schedule

Branches & tags gitlab_list_branches · gitlab_list_tags · gitlab_compare_branches

Merge requests gitlab_list_merge_requests · gitlab_get_merge_request · gitlab_get_merge_request_changes · gitlab_create_merge_request · gitlab_merge_mr

Repository & project gitlab_get_file · gitlab_list_repository_tree · gitlab_project_info

Package gitlab_ci_mcp_check_updates

Inspecting job artifacts

Use gitlab_list_job_artifacts to discover files for a job, then gitlab_get_job_artifact to read a selected UTF-8 text file. Responses are bounded (1 MB by default, 2 MB maximum); binary and invalid UTF-8 files return metadata without file contents. Older GitLab instances without the artifacts tree endpoint use a ZIP listing fallback capped at 128 MB.

Pipeline health report

gitlab_pipeline_health returns a ready-to-read summary over 7/30 days:

Code
Last 7d:  96.4%  up   | 27/28 success
Last 30d: 92.1%       | 105/114 success
Last 10:  success success success failed success ...

Handy for on-call / triage: покажи health master за последние 7 дней.

Installation

Requires Python 3.10+.

bash
# via uvx (recommended)
uvx --from gitlab-ci-mcp gitlab-ci-mcp

# or via pip/pipx
pipx install gitlab-ci-mcp

Configuration

All config is via environment variables:

VariableRequiredDescription
GITLAB_URLyesBase URL, e.g. https://gitlab.example.com
GITLAB_TOKENstdio onlyPersonal Access Token with api scope. In HTTP mode, each client sends its own X-GitLab-Token header.
MCP_TRANSPORTnostdio (default) or streamable-http
MCP_HTTP_HOSTnoHTTP bind host; defaults to 127.0.0.1
MCP_HTTP_PORTnoHTTP bind port; defaults to 8000
GITLAB_PROJECT_PATHnoLegacy fallback project; used only with GITLAB_ALLOW_DEFAULT_PROJECT=true
GITLAB_ALLOW_DEFAULT_PROJECTnoSet to true to opt into the legacy GITLAB_PROJECT_PATH fallback
MCP_GITLAB_UPDATE_CHECK_ENABLEDnofalse by default; set to true to allow the explicit update-check tool to query PyPI
GITLAB_SSL_VERIFYnotrue (default) / false
GITLAB_NO_PROXY_DOMAINSnoComma-separated domains to add to NO_PROXY (useful in corp networks behind a local HTTP proxy — e.g. .corp.example.com,gitlab.internal)
GITLAB_DISABLED_TOOL_GROUPSnoComma-separated groups to omit from the advertised tool list; unset or blank keeps all groups

GITLAB_DISABLED_TOOL_GROUPS accepts these stable group IDs and tool memberships:

Group IDTools
pipelinesgitlab_list_pipelines, gitlab_get_pipeline, gitlab_get_pipeline_jobs, gitlab_get_job_log, gitlab_list_job_artifacts, gitlab_get_job_artifact, gitlab_trigger_pipeline, gitlab_retry_pipeline, gitlab_cancel_pipeline, gitlab_pipeline_health
schedulesgitlab_list_schedules, gitlab_create_schedule, gitlab_update_schedule, gitlab_delete_schedule
branches_tagsgitlab_list_branches, gitlab_list_tags, gitlab_compare_branches
merge_requestsgitlab_list_merge_requests, gitlab_get_merge_request, gitlab_get_merge_request_changes, gitlab_create_merge_request, gitlab_merge_mr
repositorygitlab_get_file, gitlab_list_repository_tree, gitlab_project_info
packagegitlab_ci_mcp_check_updates

Group names are trimmed around commas; empty elements and duplicates are ignored. Unknown IDs fail startup with a configuration error. All six groups may be disabled, which starts the server with zero advertised tools. For example, to omit pipeline and repository operations:

bash
GITLAB_DISABLED_TOOL_GROUPS="pipelines, repository" gitlab-ci-mcp

Every tool accepts a project_path arg. It is required by default so a call cannot silently target an environment-wide project. For legacy deployments, set GITLAB_ALLOW_DEFAULT_PROJECT=true together with GITLAB_PROJECT_PATH to opt into the old fallback behavior.

Update checking is disabled by default. Set MCP_GITLAB_UPDATE_CHECK_ENABLED=true to enable the explicit gitlab_ci_mcp_check_updates tool. When enabled, it makes one bounded request to fixed PyPI JSON, caches a result for five minutes, reports failures and unsupported versions, and never installs anything. No startup or other tool call performs this request. If called while disabled, the tool reports disabled without making a network request.

Pipeline health success rate uses completed pipelines only: success and failed are in the denominator; running, pending, manual, canceled, skipped, and other non-completed statuses are excluded. A missing comparison period or a sample without completed pipelines is reported as insufficient data, not as a zero rate or a flat trend.

Shared Streamable HTTP deployment

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Gitlab Ci MCP

It works with any GitLab instance, including gitlab.com SaaS and self-hosted or on-prem installations.

Authentication requires a personal access token with 'api' scope provided via the GITLAB_TOKEN environment variable.

Yes, each tool accepts an optional 'project_path' argument to override the default project set by GITLAB_PROJECT_PATH.

The 'gitlab_get_job_log' tool supports regex filtering with grep patterns and context lines to avoid loading entire logs.

Yes, SSL verification can be toggled via the GITLAB_SSL_VERIFY environment variable.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewGitlab Ci MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mshegolev-gitlab-ci-mcp?style=directory)](https://allmcps.com/mcp/mshegolev-gitlab-ci-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/mshegolev-gitlab-ci-mcp"><img src="https://allmcps.com/api/badge/mshegolev-gitlab-ci-mcp?style=directory" alt="Gitlab Ci MCP on AllMCPs" /></a>