MCP Tool request - CI-CD Artifacts
Note
Before picking up this work: this issue adds an MCP tool. Please follow the Adding a new tool guidance first. That includes creating an MCP Tool Proposal, using verb_object naming (get_ / list_ / save_ / delete_), and the shared resource-identification input base classes.
Summary
Agents need the ability to access CI/CD artifacts (files uploaded by jobs during pipeline execution) to analyze test results, code coverage reports, build outputs, and other job-generated data. This capability is foundational for enabling AI-powered test intelligence and build analysis workflows.
Currently, GitLab Duo agents cannot access CI artifacts, which limits their ability to:
- Analyze test results and identify failure patterns
- Review code coverage reports and suggest improvements
- Debug build failures using detailed logs
- Compare outputs across pipeline runs
- Provide insights on test quality and performance
Proposed Solution
Build MCP tools that enable agents to access CI artifacts.
Backing API per tool
list_ci_artifacts→ GraphQL (Base::GraphqlTool+Base::GraphqlService).CiJob.artifacts(Types::Ci::JobArtifactType) andPipeline.jobArtifactsexposename,size,fileType(JobArtifactFileTypeEnum),downloadPath,expireAt,expired. Reach them viaproject → pipeline/job. Filter byartifact_typeclient-side (the connection has no file-type arg).get_ci_artifact_content→ REST (Base::ApiTool). GraphQL only yields a download URL, not file bytes or path-scoped reads; artifact file content is served by Workhorse (GET /projects/:id/jobs/:job_id/artifacts/*artifact_path). No GraphQL equivalent.search_ci_artifacts→ split out of this issue into #612116 to decide the implementation approach. Not part of this initial build (list_ci_artifacts+get_ci_artifact_content).
1. list_ci_artifacts
Purpose: List all artifacts for a given job or pipeline
Parameters:
project_id(required) - Project identifierpipeline_id(optional) - Pipeline to get artifacts fromjob_id(optional) - Specific job to get artifacts fromartifact_type(optional) - Filter by type (e.g., "archive", "junit", "coverage")
Returns:
- List of artifacts with metadata:
- Artifact name
- File size
- Upload timestamp
- Job that created it
- Download URL/identifier
Example use:
Agent: "List all artifacts from pipeline 12345"
Tool returns: ["test_results.xml", "coverage_report.html", "performance_logs.csv"]2. get_ci_artifact_content
Purpose: Download and read artifact contents
Parameters:
project_id(required) - Project identifierjob_id(required) - Job that created the artifactartifact_path(required) - Path to specific file within artifact archivemax_size(optional) - Maximum bytes to read (default: 1MB, prevent large file issues)
Returns:
- File contents (as text or base64 if binary)
- File metadata (size, mime type)
Example use:
Agent: "Get contents of test_results.xml from job 789"
Tool returns: <XML content of test results>Use Cases
Primary Use Cases
- Test result analysis
- Analyze CSV logs with execution times, function names, line numbers
- Identify performance bottlenecks in embedded systems
- Detect patterns in test failures
- Test intelligence agent
- "Why is this test flaky?" → Analyze test results across multiple runs
- "What's my code coverage?" → Read coverage artifacts and explain gaps
- "What changed between passing and failing runs?" → Compare artifacts
- Build debugging
- Analyze build logs and error outputs
- Compare successful vs failed build artifacts
- Identify dependency or configuration issues
- Performance monitoring
- Track performance metrics over time
- Identify performance regressions
- Benchmark comparisons across commits
Secondary Use Cases
- Security scan analysis
- Review security scan results
- Prioritize vulnerabilities
- Suggest remediation
- Compliance & audit
- Review build provenance
- Analyze compliance reports
- Generate audit summaries
Acceptance Criteria
- Tools work with both MCP Server (external AIs) and DAP (GitLab Duo agents)
- Tools available and documented