MCP server for GitLab API integration
## GitLab CI/CD MCP Server: Complete DevOps Platform Integration The **GitLab CI/CD MCP Server** integrates GitLab's DevOps platform into Google Antigravity, enabling developers to manage pipelines, jobs, artifacts, and deployments across the complete software development lifecycle. ### Why GitLab CI/CD MCP? - **Pipeline management** - Trigger and monitor CI/CD pipelines - **Job control** - Manage individual jobs and artifacts - **Environment deployments** - Track and manage deployment environments - **Merge requests** - Automate MR workflows and approvals - **Registry integration** - Manage container and package registries ### Key Features #### 1. Pipeline Management ```python # Trigger pipeline pipeline = await mcp.call("gitlab-ci", "create_pipeline", { "project_id": 123, "ref": "main", "variables": [ {"key": "DEPLOY_ENV", "value": "staging"} ] }) print(f"Pipeline #{pipeline[\"id\"]} created") # Get pipeline status status = await mcp.call("gitlab-ci", "get_pipeline", { "project_id": 123, "pipeline_id": pipeline["id"] }) print(f"Status: {status[\"status\"]}") ``` #### 2. Job Operations ```python # List pipeline jobs jobs = await mcp.call("gitlab-ci", "list_jobs", { "project_id": 123, "pipeline_id": pipeline["id"] }) for job in jobs: print(f"{job[\"name\"]}: {job[\"status\"]}") # Retry failed job await mcp.call("gitlab-ci", "retry_job", { "project_id": 123, "job_id": jobs[0]["id"] }) # Get job logs logs = await mcp.call("gitlab-ci", "get_job_log", { "project_id": 123, "job_id": jobs[0]["id"] }) ``` #### 3. Environment Deployments ```python # List environments environments = await mcp.call("gitlab-ci", "list_environments", { "project_id": 123, "states": "available" }) for env in environments: print(f"{env[\"name\"]}: {env[\"last_deployment\"][\"status\"]}") # Stop environment await mcp.call("gitlab-ci", "stop_environment", { "project_id": 123, "environment_id": environments[0]["id"] }) ``` #### 4. Merge Request Pipelines ```python # Get MR pipelines mr_pipelines = await mcp.call("gitlab-ci", "list_mr_pipelines", { "project_id": 123, "merge_request_iid": 45 }) # Approve MR await mcp.call("gitlab-ci", "approve_mr", { "project_id": 123, "merge_request_iid": 45 }) # Merge when pipeline succeeds await mcp.call("gitlab-ci", "merge_mr", { "project_id": 123, "merge_request_iid": 45, "merge_when_pipeline_succeeds": True }) ``` ### Configuration ```json { "mcpServers": { "gitlab-ci": { "command": "npx", "args": ["-y", "@anthropic/mcp-gitlab-ci"], "env": { "GITLAB_URL": "https://gitlab.com", "GITLAB_TOKEN": "glpat-xxx" } } } } ``` ### Use Cases **Pipeline Automation**: Trigger and monitor pipelines programmatically. **Deployment Management**: Track and control environment deployments. **MR Workflows**: Automate merge request approvals and merges. **Job Debugging**: Access job logs and retry failed jobs. The GitLab CI/CD MCP Server enables complete DevOps automation.
{
"mcpServers": {
"gitlab-ci": {
"mcpServers": {
"gitlab-ci": {
"env": {
"GITLAB_URL": "https://gitlab.com",
"GITLAB_TOKEN": "YOUR_PRIVATE_TOKEN"
},
"args": [
"-y",
"gitlab-mcp-server"
],
"command": "npx"
}
}
}
}
}