jenkins-mcp
Provides read-only access to Jenkins, allowing users to monitor build status across project environments, inspect build history and details, retrieve console logs, diagnose failed builds, view test reports, list branch and pull-request environments, search jobs, and verify the connection.
Click on "Install 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-mcpwhy did PR-2829 fail?"
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-mcp
Read-only MCP server for Jenkins. It reports build status across the environments of your projects and pulls the logs when something breaks.
The server cannot write: its HTTP client only ever issues GET, so no builds
are triggered, stopped or reconfigured through it.
Install
Runs straight from the repository with npx, no local clone needed:
# public repository
npx -y github:ruslan-casafari/jenkins-mcp --help
# private repository (over your ssh key)
npx -y git+ssh://git@github.com/ruslan-casafari/jenkins-mcp.git --help
# pin a tag or commit
npx -y github:ruslan-casafari/jenkins-mcp#v0.1.0Installing from git makes npm fetch the devDependencies and compile TypeScript
(prepare → tsc), so the first run takes a few seconds; later runs come from
the npx cache.
The compiled dist/ is committed as well, so the package also works when it is
installed with scripts disabled — which is what most MCP clients do, and then
prepare never runs.
After pushing new commits npx may still serve a cached version. Refresh with
npx --ignore-existing github:ruslan-casafari/jenkins-mcp.
From a local clone:
git clone git@github.com:ruslan-casafari/jenkins-mcp.git
cd jenkins-mcp && npm install # npm install already builds dist/
node dist/index.js --helpRelated MCP server: Jenkins MCP Server
Configuring projects
The point of the config is that you describe your projects and their
environments once, then work with short names — web / prod instead of
platform/web/deploy-prod.
Create a config file (jenkins-mcp.example.json is a starting point):
{
"url": "https://jenkins.example.com",
"user": "your-login",
"projects": {
"web": {
"description": "Main website",
"environments": {
"dev": "platform/web/deploy-dev",
"staging": "platform/web/deploy-staging",
"prod": "platform/web/deploy-prod"
}
},
"api": { "dev": "platform/api/dev", "prod": "platform/api/prod" },
"mobile": "platform/mobile/build"
}
}A project can be written in three shapes, whichever is shortest for the case:
Shape | Use it when |
| one job; the environment is named |
| several environments, no description |
| full form |
A job path is the job's full path in Jenkins (folder/subfolder/job). A URL
copied from the browser works too and is parsed — including /view/some-view/
tab segments, a context path and a trailing build number. If you do not know
the exact path, ask the assistant: it will find it with jenkins_search_jobs.
Pull request environments
Per-PR environments come and go on their own, so they cannot be listed in the config. Point the project at its multibranch folder instead, and name the pull request per request:
{
"pycore": {
"description": "Backend core",
"multibranch": "pycore",
"environments": { "main": "pycore/main" }
}
}Given job/pycore/view/change-requests/job/PR-2829/ in the browser, the project
is pycore with multibranch: "pycore"; view/change-requests is a UI tab and
does not belong in the config.
The pull request itself goes into the branch argument of any build tool, in
any of these forms: 2829, #2829, pr-2829, PR-2829. A branch name such as
feature/login works as well. Static environments (main above) keep working
as before.
"which PR environments are alive" →
jenkins_list_branches"why did PR-2829 fail" →
jenkins_diagnose_buildwithbranch: "2829"
If PR jobs are not named PR-* (for example MR-* on GitLab), add
"prPrefix": "MR-" to the project, and 2829 will expand to MR-2829.
The other common layout is a single shared deploy job where the PR number
arrives as a build parameter. No multibranch folder is needed then; find the
build with a filter instead: jenkins_list_builds with
parameters: { "PR": "2829" }.
Where the server looks for a config when --config is not given (first hit wins):
./jenkins-mcp.json./.jenkins-mcp.json~/.config/jenkins-mcp/config.json~/.jenkins-mcp.json
The MCP client decides the server's working directory, so an absolute
--config path is the reliable choice.
Token
The token is a Jenkins API token: profile → Security → Add new token
(https://jenkins.example.com/me/security). A UI password will not work when
SSO is in place.
Keep the token in the JENKINS_TOKEN environment variable rather than in the
config file.
Connecting Claude Code
claude mcp add jenkins \
--env JENKINS_TOKEN=xxxxxxxxxxxx \
-- npx -y github:ruslan-casafari/jenkins-mcp --config ~/.jenkins-mcp.jsonOr in the project's .mcp.json / in ~/.claude.json:
{
"mcpServers": {
"jenkins": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"github:ruslan-casafari/jenkins-mcp",
"--config",
"/Users/me/.jenkins-mcp.json"
],
"env": { "JENKINS_TOKEN": "${JENKINS_TOKEN}" }
}
}
}To keep everything in that one file instead, drop the config file and pass the
projects as JSON in JENKINS_PROJECTS:
{
"mcpServers": {
"jenkins": {
"type": "stdio",
"command": "npx",
"args": ["-y", "github:ruslan-casafari/jenkins-mcp"],
"env": {
"JENKINS_URL": "https://jenkins.example.com",
"JENKINS_USER": "your-login",
"JENKINS_TOKEN": "${JENKINS_TOKEN}",
"JENKINS_PROJECTS": "{\"pycore\":{\"multibranch\":\"pycore\",\"environments\":{\"main\":\"pycore/main\"}},\"web\":{\"dev\":\"platform/web/deploy-dev\",\"prod\":\"platform/web/deploy-prod\"}}"
}
}
}
}Either block suits any MCP client with a stdio transport.
To check the connection, ask the assistant to call jenkins_whoami: it returns
the authenticated user, the Jenkins version and how many projects are configured.
Tools
Tool | What it does |
| Configured projects, their environments and the jobs behind them. No Jenkins request. |
| State of a project's environments: last build, who triggered it, parameters, commits, last successful and last failed build. No arguments — every project. |
| Build history of an environment, with an |
| Details of one build: result, parameters, changes. |
| Console log: tail, |
| Triage of a failed build in one call: the failed pipeline stage with its error and log, failed tests, console tail. |
| Test summary and failing cases with their messages. |
| Live branch and PR environments of a project from its multibranch folder, with the last build of each. |
| Find jobs on the controller — to get a path and add the project to the config. |
| Check the URL, the credentials and the permissions. |
Every build tool takes its target the same way: project + environment (or
project: "web/prod"), project + branch for pull requests and branches, or
job with a raw path for jobs that are not in the config. The build argument
is a build number or a Jenkins alias (lastBuild, lastFailedBuild,
lastSuccessfulBuild, …), defaulting to lastBuild.
Questions this covers:
"what is on prod for web" →
jenkins_project_status"why did the last api build on staging fail" →
jenkins_diagnose_build"show everything about timeout in the log" →
jenkins_get_build_logwithsearch: "timeout""when did prod last deploy successfully" →
jenkins_list_builds"what happened to the PR-2829 build" →
jenkins_diagnose_buildwithbranch: "2829"
Runtime options
Flag | Environment variable | Default |
|
| — (required) |
|
| — |
|
| — |
|
| auto-discovery (see above) |
|
| off |
|
|
|
|
|
|
Flags take precedence over environment variables, which take precedence over the config file.
JENKINS_PROJECTS holds the same structure as projects in the config file,
as a JSON string.
--insecure disables TLS certificate verification for the whole process — turn
it on only for an internal controller with a self-signed certificate.
Development
npm install # installs dependencies and builds dist/
npm run typecheck
npm run buildNode.js 20+.
dist/ is checked in, because MCP clients install this package with scripts
disabled and would otherwise get no compiled output. Run npm run build and
commit the result together with any change under src/.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI assistants to interact with Jenkins CI/CD systems for build management, job monitoring, console log analysis, and debugging through natural language commands.2MIT
- AlicenseNot gradedqualityDmaintenanceEnables interaction with Jenkins to manage jobs, trigger builds with parameters, and monitor build queues. It provides comprehensive access to build histories, console logs, and organizational folder structures via the Jenkins REST API.1911MIT
- FlicenseNot gradedqualityDmaintenanceEnables interaction with Jenkins CI jobs, including triggering and stopping builds, retrieving job details, and fetching build logs.
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD servers, including checking build status, triggering builds, and retrieving build logs.8MIT
Related MCP Connectors
Read-only access to Auralogs production logs: search logs, inspect errors, review AI analyses.
Read-only CVE intelligence, remediation playbooks, and agent setup guides. Not a scanner.
Read-only AI project discovery, verification, comparison, shortlisting, and stack planning.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/ruslan-casafari/jenkins-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server