GitLab CI MCP Server
Enables AI agents to monitor and debug GitLab CI/CD pipelines by providing tools to list pipelines, retrieve job logs, and analyze failure root causes. It features automated error pattern extraction and failure analysis to streamline pipeline troubleshooting.
README
GitLab CI MCP Server
Model Context Protocol (MCP) server for GitLab CI/CD pipeline monitoring.
Purpose
Provides AI agents with structured access to GitLab CI/CD pipelines for the egirl-platform project. Enables agents to:
- List recent pipelines
- Get pipeline details and job information
- Retrieve job logs for debugging
- Analyze recent failures
- Extract likely root causes from error logs
Features
Available Tools
| Tool | Description |
|---|---|
gitlab_list_pipelines |
List recent pipelines with status |
gitlab_get_pipeline |
Get detailed info for a specific pipeline |
gitlab_list_jobs |
List all jobs in a pipeline |
gitlab_get_job_logs |
Retrieve logs for a specific job |
gitlab_get_recent_failures |
Get recent failed pipelines with details |
gitlab_find_failure_cause |
Analyze failed pipeline and extract error patterns |
Intelligent Features
- Error Pattern Extraction: Automatically identifies error lines in logs
- Structured Responses: Returns JSON for easy agent parsing
- Failure Analysis: Groups related failures and extracts root causes
- Auto
.envLoading: Automatically loadsGITLAB_PATfrom project.envfile
Installation
# Install dependencies
pnpm install
# Build the server
pnpm run build
Configuration
The server automatically loads .env from the project root, so no manual configuration needed if you have GITLAB_PAT in your .env file.
For Claude Code MCP Configuration
Add to your Claude Code MCP configuration:
{
"mcpServers": {
"gitlab-ci": {
"command": "node",
"args": [
"/absolute/path/to/egirl-platform/packages/mcp-gitlab-ci/dist/index.js"
]
}
}
}
Note: No env section needed - the server loads .env automatically!
Usage
For AI Agents
Agents can invoke MCP tools directly:
// List recent pipelines
gitlab_list_pipelines({ count: 10 })
// Analyze why a pipeline failed
gitlab_find_failure_cause({ pipelineId: "2160207941" })
// Get job logs
gitlab_get_job_logs({
pipelineId: "2160207941",
jobNameOrId: "test"
})
Response Format
All tools return structured JSON:
Pipeline List:
{
"pipelines": [
{
"id": 2160207941,
"status": "failed",
"ref": "main",
"sha": "a1b2c3d4",
"updated_at": "2025-12-09T10:30:00Z",
"web_url": "https://gitlab.com/..."
}
]
}
Failure Analysis:
{
"pipeline_id": "2160207941",
"analysis": [
{
"job": {
"id": 123456,
"name": "test",
"stage": "test",
"failure_reason": "script_failure"
},
"extracted_errors": [
"Error: Cannot find module '@transftw/types'",
"TypeError: undefined is not a function"
]
}
]
}
Environment Variables
| Variable | Description | Required |
|---|---|---|
GITLAB_PAT or GPLAT |
GitLab Personal Access Token | Yes |
The server checks for both GITLAB_PAT (preferred) and GPLAT (legacy).
Token must have read_api scope to access pipeline information.
Architecture
Claude Code Agent
↓ (MCP Protocol)
GitLab CI MCP Server (this package)
↓ (imports)
@transftw/platform-tools/ci (GitLab API wrapper)
↓ (HTTPS)
GitLab API
Troubleshooting
"GPLAT or GITLAB_PAT environment variable not set"
Add GITLAB_PAT=your-token to the project root .env file.
Server not responding
Verify the .env file exists and contains a valid token:
cat .env | grep GITLAB_PAT
Related
- CLI Tool:
packages/platform-tools/src/cli/gitlab-ci.ts- Direct CLI access - API Library:
packages/platform-tools/src/lib/ci/gitlab-api.ts- Underlying API wrapper - Documentation:
.claude/instructions/mcp-tools-usage.md- MCP usage guide
Last Updated: 2025-12-09 Created By: The Collective Purpose: Enable AI agents to monitor GitLab CI/CD pipelines efficiently
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.