Labsco
MCP SERVER

Jenkins Build Debugging

by 2001adarsh

Jenkins triage shaped for an agent: what changed since the last green build, which tests are flaky, and where the failing line is.

Build Systems & CI/CD
Summary
Shaped around the questions you actually ask a failing build.

Most Jenkins integrations hand you the REST API and let the agent work it out. Here the hard questions are single calls: what changed between A and B, which tests flip between pass and fail, what commits landed since the last green. The disk cache matters more than it sounds — a multi-gigabyte console log gets fetched once and then grepped locally instead of re-streamed on every follow-up.

What it is

A single Go binary that talks to one Jenkins instance with one API token. The tools answer triage questions rather than mirroring Jenkins endpoints, and large console logs are cached on disk so the agent can grep a finished build instead of streaming it.

What you get
  • last_green_build and changes_since_last_green — the bisect start point and every commit since it, deduped
  • compare_builds — two builds diffed across result, duration, parameters, commits, pipeline stages and JUnit tests
  • get_console_log, search_console_log and get_console_log_path, the last returning the cached file's path so the agent reads it locally
  • tail_running_build for an in-flight build, offset-tracked so you can page through it
  • get_test_report, get_flaky_candidates, get_test_history and find_test_by_name for JUnit results and flake ranking
  • get_ginkgo_failure_summary for Ginkgo's own failure block
  • get_pipeline_stages, get_stage_log and get_pipeline_script — including the Jenkinsfile a specific build actually ran
  • get_scm_context for per-commit authors, messages and touched paths with edit codes
  • health_check and whoami_can to confirm reachability and the token's effective permissions before you need them
  • trigger_build, stop_build and cancel_queue_item — the only mutating tools, and they disappear entirely under JENKINS_MCP_READONLY
Requirements

JENKINS_URL, JENKINS_USER and JENKINS_API_TOKEN — an API token generated at /me/configure, not your password. One static binary, no Python runtime and no Docker required. Set JENKINS_MCP_READONLY and the three mutating tools are never registered, which is the sane default for an agent pointed at production CI.

Setup effort

One command plus a key — go install github.com/2001adarsh/jenkins-mcp-go@latest, then supply credentials