Jenkins MCP server
Description
Read-first Jenkins MCP server in Go for agent-driven build debugging. 20 tools including compare_builds, flaky-test detection, JUnit/Ginkgo failure parsing, and disk-cached console logs with on-disk path handoff. Write tools (trigger/stop/cancel) gated by JENKINS_MCP_READONLY…
About
Read-first Jenkins MCP server in Go for agent-driven build debugging. 20 tools including compare_builds, flaky-test detection, JUnit/Ginkgo failure parsing, and disk-cached console logs with on-disk path handoff. Write tools (trigger/stop/cancel) gated by JENKINS_MCP_READONLY env var.
Details
- Author
- 2001adarsh
- Categories
- Developer Tools, Infrastructure, Automation, Other
Jump to
Setup
Install Jenkins MCP server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/2001adarsh/jenkins-mcp-go
Follow the installation instructions in the repository README, then restart your MCP client.
A focused, fast Model Context Protocol (MCP) server for Jenkins, written in Go.
Connect Jenkins to Claude Desktop, Claude Code, Cursor, or any MCP-compatible AI agent: fetch console logs, inspect pipeline stages, parse JUnit and Ginkgo test reports, diff two builds, rank flaky tests, trigger and abort builds, and manage the build queue — all over a single MCP stdio transport, from one static Go binary.
Most Jenkins integrations expect a human at a keyboard. LLM agents need something different: small, structured responses; a clear path from "build failed" to "here is the failing line"; and the ability to grep a multi-gigabyte console log without re-downloading it on every question.
jenkins-mcp-gois built for that workflow:
- Read-first, opt-out writes.Read tools are always on. Write tools (trigger_build,stop_build,cancel_queue_item) are gated byJENKINS_MCP_READONLY: set the env var and the server registers only the read surface.
- Single-host, single-credential.It talks to one Jenkins URL with one API token, configured by environment variables. No multi-tenant surface, no credential vault to misuse.
- Triage-shaped, not API-shaped.Tools answer the questions agents actually ask —"what changed between build A and B?"(compare_builds),"which tests in this job are flaky?"(get_flaky_candidates),"what commits and files touched this build?"(get_scm_context) — instead of mirroring Jenkins endpoints one-for-one.
- Built for context windows.Every listing tool takes an RE2 filter and a cap.get_console_log_pathreturns the on-disk path of a finished build's log so the agent canRead/Grep/Bashit natively instead of streaming gigabytes through MCP.
- Disk-cached console logs.Finished builds are saved once and reused. The cache is keyed by job path + build number, capped by total size, and evicted by LRU mtime.
- Pipeline- and Ginkgo-aware.Beyond the raw console, dedicated tools parse/wfapi/describe,/testReport/api/json, and Ginkgo'sSummarizing N Failureblock so the agent gets pre-digested failure information.
- One static binary.Pure Go. No Python runtime, no Docker required.
Build-targeted tools take ajob_path(slash-separated, e.g.Builds/team/job-name) and an optionalbuild_number(0or omitted =lastBuild). A URL likehttps://jenkins.example.com/job/Builds/job/team/job/job-name/86/becomesjob_path="Builds/team/job-name",build_number=86.list_jobstakes afolder_pathin the same slash-separated form (empty = root).
Seedocs/TOOLS.mdfor the full parameter reference.
Grab the archive for your OS and architecture from theReleases pageand put thejenkins-mcpbinary on yourPATH.
go install github.com/2001adarsh/jenkins-mcp-go@latest
The binary lands in$(go env GOBIN)(or$(go env GOPATH)/bin).
Pre-built multi-arch images are published to GitHub Container Registry:
docker pull ghcr.io/2001adarsh/jenkins-mcp-go:latest
- :latest— most recent release
- :vX.Y.Z— pinned to a specific release
- :vX.Y.Z-amd64/:vX.Y.Z-arm64— per-arch (the unsuffixed tags above are multi-arch manifests;docker pullresolves the right one automatically)
The image is built ongcr.io/distroless/static:nonroot— runs as a non-root user, ships with CA roots so HTTPS to Jenkins works out of the box, and is under 20 MB compressed. See theDocker MCP client setupsection for adocker run-based Claude Desktop config.
git clone https://github.com/2001adarsh/jenkins-mcp-go.git cd jenkins-mcp-go make build ./bin/jenkins-mcp -h 2>/dev/null || true # the server speaks MCP over stdio; -h prints nothing
Configuration is read from the environment at startup. There is no config file and no command-line flags — keep credentials out of process arguments.
Note—JENKINS_API_TOKENshould be a JenkinsAPI token, not your account password. In Jenkins, navigate to your user menu →Configure→API Token→Add new Token.
The server speaks MCP over stdio. Hook it up by adding an entry to your client's MCP server configuration.
{ "mcpServers": { "jenkins": { "command": "/usr/local/bin/jenkins-mcp", "env": { "JENKINS_URL": "https://jenkins.example.com", "JENKINS_USER": "your-username", "JENKINS_API_TOKEN": "your-api-token" } } } }
{ "mcpServers": { "jenkins": { "command": "docker", "args": [ "run", "--rm", "-i", "-e", "JENKINS_URL", "-e", "JENKINS_USER", "-e", "JENKINS_API_TOKEN", "ghcr.io/2001adarsh/jenkins-mcp-go:latest" ], "env": { "JENKINS_URL": "https://jenkins.example.com", "JENKINS_USER": "your-username", "JENKINS_API_TOKEN": "your-api-token" } } } }
-ikeeps stdin open (MCP speaks stdio);--rmcleans up the container after Claude Desktop disconnects. The console-log cache lives inside the container by default, so it's lost on restart — add-v "$HOME/.cache/jenkins-mcp:/home/nonroot/.cache/jenkins-mcp"and-e XDG_CACHE_HOME=/home/nonroot/.cacheto theargsarray if you want the cache to survive across sessions.
claude mcp add jenkins /usr/local/bin/jenkins-mcp \ --env JENKINS_URL=https://jenkins.example.com \ --env JENKINS_USER=your-username \ --env JENKINS_API_TOKEN=your-api-token
Any client that supports stdio MCP servers will accept a configuration of the form:
{ "command": "jenkins-mcp", "args": [], "env": { "JENKINS_URL": "https://jenkins.example.com", "JENKINS_USER": "your-username", "JENKINS_API_TOKEN": "your-api-token" } }
Once the server is registered, ask your agent things like:
- "What integration-test jobs do we have underBuilds/team?"→ callslist_jobswithfolder_path: "Builds/team",recursive: true,name_filter: "integration".
- "What was the result of build 86 ofBuilds/team/integration-tests?"→ callsget_build_info.
- "Show me the last 200 lines of the most recent run ofnightly."→ callsget_console_logwithtail_lines: 200.
- "Find every line matchingpanic|fatalin build 4521 with five lines of context."→ callssearch_console_logwithpattern: "panic|fatal",context_lines: 5.
- "Build 91 passed but 92 failed — what changed?"→ callscompare_buildswithbuild_a: 91,build_b: 92.
- "Which tests inBuilds/team/integration-testshave been flipping between pass and fail recently?"→ callsget_flaky_candidates.
- "Which commits in build 86 touched anything underinternal/auth/?"→ callsget_scm_contextwithpath_filter: "^internal/auth/".
- "Which Ginkgo specs failed in build 92 and what was the first error each emitted?"→ callsget_ginkgo_failure_summary.
- "Cache the full log for build 4521 so I can grep it locally."→ callsget_console_log_path; the agent then uses its ownRead/Grep/Bashtools on the returned path.
Only finished builds are cached (the writer requires Jenkins'Finished:marker), and the cache is evicted by LRU mtime once it exceedsJENKINS_MCP_CACHE_MAX. Files live inJENKINS_MCP_CACHE_DIR.
- No credential echo.The server never includes credentials in tool output, error messages, or cached files.
- Filesystem boundary.Cache filenames are sanitized; the cache directory is the only path the server writes to.
If you find a security issue, please followSECURITY.mdrather than opening a public issue.
make build / test / lint / fmt. SeeCONTRIBUTING.mdfor the full contributor guide anddocs/DEBUGGING.mdfor how to exercise the server locally with MCP Inspector.
- Go:1.23+
- Jenkins:any version that exposes the standard/api/json,/consoleText,/wfapi/describe,/testReport/api/jsonendpoints. Pipeline-specific tools require the Pipeline plugin.
- MCP:usesgithub.com/modelcontextprotocol/go-sdkv1.6+.
Howjenkins-mcp-gocompares to other ways of exposing Jenkins to an LLM:
If you want a small, predictable surface tailored to "the agent is debugging a Jenkins build", this project is for you. If you need a generic JSON proxy or multi-tenant credential routing, a generic HTTP-MCP gateway is a better fit.
Install thejenkins-mcpbinary, then add it to your Claude Desktop or Claude Code MCP configuration with yourJENKINS_URL,JENKINS_USER, andJENKINS_API_TOKEN. SeeMCP client setupabove for the exact JSON / CLI snippets.
Does this work with Cursor, Continue, or Windsurf?
Yes. Any MCP client that supports stdio servers will accept the samecommand+envconfiguration shown in theMCP client setupsection.
Reads are always on. Write tools (trigger_build,stop_build,cancel_queue_item) are registered by default but can be suppressed entirely by settingJENKINS_MCP_READONLY=1— the server then never registers a mutating tool, so an agent literally cannot call one.
No extra plugin is required for the core read tools — they hit standard Jenkins endpoints. Pipeline-specific tools (get_pipeline_stages,get_stage_log) require the Pipeline plugin, which most Jenkins installations already have.
Can the LLM agent grep through a multi-gigabyte console log?
Yes. Useget_console_log_pathto force-cache the full log for a finished build to disk; the tool returns a local path the agent can thenRead,Grep, orBashnatively. The cache is LRU-evicted and capped byJENKINS_MCP_CACHE_MAX.
Does it handle Ginkgo test failures specifically?
Yes.get_ginkgo_failure_summaryparses Ginkgo'sSummarizing N Failureblock and surfaces the first[ERROR]line tagged with each spec name plus surrounding context — much faster than asking the agent to scan the whole log.
Is it safe to give an LLM API token access to Jenkins?
The server uses a single Jenkins user's API token (not a password), confined to oneJENKINS_URL. Combine withJENKINS_MCP_READONLY=1and a least-privilege Jenkins user for the safest default. SeeSECURITY.mdfor the full threat model.
This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.
An MCP server for Nextflow development and testing, which requires a local clone of the Nextflow Git repository.
Agents make claims. Reelier writes receipts — record an agent's tool-call workflow once, replay it deterministically at 0 tokens, and diff runs to catch drift.
The Shipyard CLI provides an MCP server for agents to manage Shipyard environments directly: by pulling logs, comparing branches, running tests, and stopping/starting environments..
Open-source CLI for testing MCP servers and detecting schema drift
Check if a command is runnable before running it.
Paid remote MCP for CLI tool MCP, structured receipts, usage logs, and audit-ready evidence for agent and CI workflows.
A flexible MCP server that executes arbitrary command-line tools defined in a configuration file.
Clean and audit messy MCP setups: stale servers, unused tools, context-heavy MCPs, outdated packages, and safe repair plans.
fable-discipline is a Claude Code plugin that makes agentic software work follow repeatable working patterns: design before code, verify after edits, separate author from reviewer, preserve verified state between sessions, and report uncertainty honestly.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


