home / mcp / gitlab mcp server

GitLab MCP Server

Provides access to GitLab CI/CD pipelines, jobs, and logs for analysis and debugging via MCP tools.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "3viky-mcp-gitlab-ci": {
      "command": "node",
      "args": [
        "/absolute/path/to/egirl-platform/packages/mcp-gitlab-ci/dist/index.js"
      ],
      "env": {
        "GPLAT": "<GPLAT>",
        "GITLAB_PAT": "<GITLAB_PAT>"
      }
    }
  }
}

You deploy this MCP server to enable AI agents to monitor and analyze GitLab CI/CD pipelines. It exposes a concise set of capabilities to list pipelines, fetch details and logs, and analyze failures, all in structured JSON for easy consumption by agents and automation.

How to use

You interact with the MCP server through an MCP client. The server is designed to provide structured access to GitLab CI/CD pipelines, including listing recent pipelines, retrieving pipeline details and job information, fetching job logs, and performing failure analysis. Use the available tools to compose practical workflows that fit your debugging, monitoring, and root-cause analysis needs.

How to install

Prerequisites you need before running the server: install Node.js and PNPM.

Clone the project repository that contains the MCP server code if you are setting up locally, then install dependencies and build the server.

pnpm install

# Build the server
pnpm run build

Additional sections

Configuration and runtime notes: the server automatically loads a .env file from the project root. It uses a GitLab Personal Access Token to access pipeline information.

Environment variables to prepare in your project root .env (the server will read these automatically): you should have a token entry for access.

Security considerations: ensure your GITLAB_PAT has the read_api scope and is kept secret. Do not expose tokens in logs or publicly accessible files.

Troubleshooting: if you encounter token-related errors, verify that a valid token is present and has the correct scope. If the server does not respond, confirm that the .env file exists and contains the token entry.

MCP configuration example

Below is a concrete MCP configuration that runs the GitLab CI MCP Server as a local process. It uses Node to execute the built MCP server bundle.

{
  "mcpServers": {
    "gitlab_ci": {
      "type": "stdio",
      "name": "gitlab_ci",
      "command": "node",
      "args": [
        "/absolute/path/to/egirl-platform/packages/mcp-gitlab-ci/dist/index.js"
      ]
    }
  }
}

Notes on environment variables

The server loads GITLAB_PAT from your project’s .env file automatically. This is the preferred variable name. A legacy name GPLAT is also recognized for compatibility.

Examples of usage patterns

List recent pipelines: use the corresponding MCP tool to fetch a list of pipelines and their statuses. Then, for any failed pipeline, retrieve detailed information and related job logs to triage failures.

Analyze a specific failure: invoke the failure analysis tool to examine a given pipeline and extract likely root causes from error logs.

Available tools

gitlab_list_pipelines

List recent pipelines with status for quick overview.

gitlab_get_pipeline

Get detailed information for a specific pipeline.

gitlab_list_jobs

List all jobs within a pipeline.

gitlab_get_job_logs

Retrieve logs for a specific job to aid debugging.

gitlab_get_recent_failures

Fetch recent failed pipelines with details to inspect common issues.

gitlab_find_failure_cause

Analyze a failed pipeline and extract likely root causes from error patterns.

GitLab MCP Server - 3viky/mcp-gitlab-ci