Skip to content

Menu

Jenkins MCP Server logo

Jenkins MCP Server

Published · Updated

At a glance

Watch out for
The agent can do anything its Jenkins user can, including triggering and cancelling builds.

The MCP Server Plugin is an official Jenkins plugin, maintained under the jenkinsci organisation, that turns a Jenkins controller into an MCP server. There is nothing to run on your machine: you install the plugin in Jenkins, and clients connect to the /mcp-server/mcp endpoint on your Jenkins host using a Jenkins API token.

The tools are aimed squarely at the questions people ask about CI. The agent can list and read jobs, trigger builds, including parameterised ones, check the queue, cancel builds, read build logs with pagination or search them by pattern, get test results and flaky test failures, and inspect the SCM configuration and change sets behind a build. For Pipeline jobs it can rebuild with the same parameters, read the scripts of a replayable build and replay it with a modified script, which is a quick way to test a pipeline fix.

Because it runs inside Jenkins, it uses Jenkins' own permission model. Every call runs as the user whose API token is used, so a token for a user with only read access cannot trigger or cancel builds. For a team, a dedicated Jenkins user for the agent with carefully chosen permissions is the cleanest setup. The plugin is also extensible: other plugins can add their own MCP tools.

How it connects

Your AI app

An assistant or agent that supports MCP

Jenkins MCP Server

Runs as

  • Remote (HTTP)

Gives the agent

  • Jobs and builds
  • Logs
  • Tests
  • Pipeline replay
  • SCM and system

Jenkins

Signs in with

  • Token
Your AI app talks to Jenkins MCP Server over the Model Context Protocol, and the server carries out the work. Built from the setup and capability sections on this page.

What it can do

Jobs and builds
getJob, getJobs, triggerBuild (with parameters), getQueueItem, cancelBuild, getBuild, updateBuild and createPipeline for sandboxed pipelines.
Logs
getBuildLog reads logs with pagination and searchBuildLog finds lines by text or regex.
Tests
getTestResults summarises results and getFlakyFailures lists tests that failed then passed.
Pipeline replay
rebuildBuild, getReplayScripts and replayBuild rerun pipelines, optionally with a modified script.
SCM and system
getJobScm, getBuildScm, getBuildChangeSets and findJobsWithScmUrl; plus whoAmI, getStatus, getSystemLog and getLogRecorders.

Setting it up

Install the MCP Server plugin from the Jenkins plugin manager. Generate an API token for the Jenkins user the agent should act as, from that user's account settings. Then connect your client to https://your-jenkins-host/mcp-server/mcp with HTTP Basic authentication using username and token; in Claude Code: claude mcp add jenkins https://your-jenkins-host/mcp-server/mcp --transport http --header "Authorization: Basic <base64 of user:token>". An SSE endpoint at /mcp-server/sse and a stateless endpoint at /mcp-server/stateless are also available. If you run Jenkins behind a proxy, the README covers keep-alive timeouts and Origin checks.

Where each client keeps its MCP config file, and the JSON it expects (cheat sheet)

Where it helps

  • Asking why the latest build of a job failed and getting the relevant log lines
  • Finding flaky tests across recent builds
  • Replaying a pipeline with a small script change to test a fix
  • Finding every job that builds from a particular Git repository

Limitations and things to watch

  • The agent can do anything its Jenkins user can, including triggering and cancelling builds.
  • File parameters are not supported when triggering builds.
  • Logs can contain secrets that Jenkins failed to mask; they reach the model when read.
  • Requires installing a plugin on the controller, which may need admin approval.

Sources

Written from the project's own documentation, checked November 2026.

How we research: where our facts come from, how often we re-check them, and why no one can pay for a review or a verdict.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…