feat: add artifacts and deployment visibility for pipelines and merge requests#353
Conversation
…acts Adds three new MCP tools for working with GitLab job artifacts: - list_job_artifacts: List files in a job's artifact archive (tree endpoint) - download_job_artifacts: Download entire artifact archive (zip) to local disk - get_job_artifact_file: Retrieve content of a single file from artifacts These tools enable investigating failed pipeline jobs by downloading and inspecting their artifacts locally, which is essential for CI/CD debugging. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ca3622027
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
package.json
Outdated
| "format:check": "prettier --check \"**/*.{js,ts,json,md}\"" | ||
| }, | ||
| "dependencies": { | ||
| "@esbuild/darwin-arm64": "^0.27.3", |
There was a problem hiding this comment.
Remove darwin-only esbuild package from dependencies
Adding @esbuild/darwin-arm64 as a top-level dependency makes installation fail on non-macOS ARM hosts (e.g., Linux/Windows), because this package is platform-specific rather than cross-platform tooling. The repo’s own lockfile already models it as an optional platform package under esbuild; making it direct here can block npm install for many users before the server can run.
Useful? React with 👍 / 👎.
index.ts
Outdated
| const effectiveProjectId = getEffectiveProjectId(projectId); | ||
|
|
||
| const url = new URL( | ||
| `${getEffectiveApiUrl()}/projects/${encodeURIComponent(effectiveProjectId)}/jobs/${jobId}/artifacts/${artifactPath}` |
There was a problem hiding this comment.
Encode artifact path when building artifact file URL
The URL is built with raw artifactPath, so filenames containing reserved URL characters (notably # or ?) are parsed as fragment/query delimiters by new URL(...) and the request path is truncated. In those cases get_job_artifact_file returns 404 even though the artifact exists; the path needs encoding (while preserving / separators) before interpolation.
Useful? React with 👍 / 👎.
| const savePath = localPath ? path.join(localPath, filename) : filename; | ||
|
|
||
| fs.writeFileSync(savePath, Buffer.from(buffer)); |
There was a problem hiding this comment.
Create destination directories before writing artifact zip
download_job_artifacts writes directly to savePath without creating parent directories, so passing a new local_path (e.g., artifacts/run-42) throws ENOENT and the download fails. Since the tool accepts a directory target, it should ensure path.dirname(savePath) exists before writeFileSync.
Useful? React with 👍 / 👎.
|
Implemented follow-up fixes from review and CI:
|
Implements pipeline artifact tools, deployment/environment tools, and compact deployment summary in get_merge_request.