jenkins-readonly-mcp
Provides read-only access to Jenkins, allowing inspection of jobs, folders, and multibranch branches; retrieval of latest and failed builds; viewing pipeline stages and failures; reading JUnit test reports; searching console logs for test failures; checking console tails; and discovering latest deploys per environment. All operations use HTTP GET and cannot trigger, abort, or modify Jenkins jobs.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jenkins-readonly-mcpWhat's broken in Jenkins under MyFolder/MyApp right now?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
jenkins-readonly-mcp
A small, read-only Model Context Protocol server for Jenkins.
It lets an MCP client (Claude Code, Claude Desktop, ...) inspect failed builds, failing tests,
latest builds and deployments. It only ever issues HTTP GET requests, so it cannot trigger,
abort, or change anything in Jenkins.
Tools
Tool | Purpose |
| Scan a folder tree for jobs whose last build is red/unstable ("what is broken right now?") |
| Browse folders, jobs and multibranch branches with last build result |
| Latest N builds of a job (result, duration, cause, commits) |
| Recent failed/unstable (optionally aborted) builds of a job |
| Details of one build (default: last build) |
| Pipeline stages with status, shows which stage failed |
| Failed tests from the JUnit report, if the job publishes one |
| Grep the console log for PHPUnit/Pest/Jest/etc. failures, for pipelines without a JUnit report |
| Last N lines of the console log (credential-like values are masked) |
| Latest deploy builds per environment folder ( |
Jobs are addressed by slash-separated path, e.g. MyFolder/MyApp/Build/main.
Branch names returned by list_jobs (e.g. feature%2Ffoo) can be passed back as-is.
get_deploysassumes deploy jobs live in sibling folders named after the environment. Passenvironmentsto use other folder names.
Related MCP server: jenkins-http-mcp-server
Requirements
Node.js 18 or newer
A Jenkins user with read permission and an API token
Installation
git clone <this-repo-url> jenkins-readonly-mcp
cd jenkins-readonly-mcp
npm installCreate a Jenkins API token
Log in to Jenkins.
Click your name (top right) -> Security (
<jenkins-url>/me/security).Under API Token click Add new Token, name it, and Generate.
Copy the token right away; Jenkins shows it only once.
Use a dedicated token for this server so you can revoke it independently. Ideally use a user that only has read permissions.
Configuration
The server reads three environment variables (all required):
Variable | Example |
|
|
|
|
| the API token from above |
Never commit the token. This repository's .gitignore excludes .env files.
Register with Claude Code
claude mcp add jenkins -s user \
-e JENKINS_URL=https://jenkins.example.com \
-e JENKINS_USER=your-username \
-e JENKINS_TOKEN=your-token \
-- node /absolute/path/to/jenkins-readonly-mcp/server.mjsRestart Claude Code and run /mcp to verify that jenkins is connected.
claude mcp addstores the token in~/.claude.json. Keep that file private.
Register with Claude Desktop (or any other MCP client)
Add to the client's MCP config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"jenkins": {
"command": "node",
"args": ["/absolute/path/to/jenkins-readonly-mcp/server.mjs"],
"env": {
"JENKINS_URL": "https://jenkins.example.com",
"JENKINS_USER": "your-username",
"JENKINS_TOKEN": "your-token"
}
}
}
}Example prompts
"What is failing in Jenkins right now under
MyFolder?""Why did the last build of
MyFolder/MyApp/Build/mainfail? Which stage and which tests?""Show the latest deploys for
MyFolder/MyApp."
Quick smoke test
JENKINS_URL=https://jenkins.example.com JENKINS_USER=you JENKINS_TOKEN=... \
npx @modelcontextprotocol/inspector node server.mjsSecurity notes
Read-only by design: there is no code path that sends anything other than
GET.Console output is returned with
password/secret/token/api key = valuepatterns masked, but console logs can still contain sensitive data. Treat tool output as sensitive.Build parameters whose name contains
pass,token,secretorkeyare omitted.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only MCP access to a documented IT fleet: state, changes, posture. 15 tools.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
- SpecitaOAuthcom.specita
Read-only release evidence for coding agents: findings, deliveries, source and runtime data.
Read-only Dant3 MCP for public rooms, agents, jobs and provisional machine onboarding.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables managing Jenkins operations like listing jobs, triggering builds, and checking build statuses through a configurable MCP server.310Apache 2.0
- AlicenseBqualityAmaintenanceEnables interaction with Jenkins servers through HTTP APIs, allowing users to list jobs, trigger builds, view logs, and manage configurations without requiring plugins or admin access.40MIT
- FlicenseAqualityDmaintenanceExposes a Jenkins controller's REST API to MCP-compatible clients, enabling job management, build triggering, and log retrieval through natural language.114-
- AlicenseNot gradedqualityDmaintenanceEnables Jenkins CI/CD integration with job management, pipeline monitoring, artifact handling, and batch operations via MCP.21 npm4Apache 2.0