Skip to main content

mcp-jenkins-client

An open-source MCP server that exposes Jenkins CI/CD operations as tools for AI assistants. Built on python-jenkins and FastMCP.

Installation

Run it from PyPI, install from source with uv, or build a Docker image. The source and Docker routes start from a clone.

From PyPI

Requires uv. uvx downloads the package (and Python 3.10+ if none is installed) and runs it, so there is nothing to install first:

uvx mcp-jenkins-client          # starts the server on stdio (needs the variables below)

uvx reuses its cached copy; uvx mcp-jenkins-client@latest fetches the newest release.

Without uv: pipx install mcp-jenkins-client, or pip install mcp-jenkins-client into a virtualenv. Both put a mcp-jenkins-client command on your PATH.

From source (uv)

Requires Python 3.10+ and uv.

git clone <repo-url> mcp-jenkins-client
cd mcp-jenkins-client
uv sync                       # creates .venv and installs the server
uv run mcp-jenkins-client     # starts the server on stdio (needs the variables below)

To work on it, install the test dependencies and run the suite:

uv sync --extra dev
uv run pytest

Without uv: python -m venv .venv && .venv/bin/pip install -e ".[dev]".

Docker

Requires Docker. Python and uv are not needed.

git clone <repo-url> mcp-jenkins-client
cd mcp-jenkins-client
docker build -t mcp-jenkins-client .

The image is not published anywhere, so build it yourself. After git pull, rebuild it to update.

Configuration

Set the following environment variables:

Variable Required Description
JENKINS_URL Yes Jenkins server URL
JENKINS_USERNAME Yes Jenkins username
JENKINS_API_TOKEN Yes Jenkins API token
JENKINS_TIMEOUT No Per-request HTTP timeout in seconds (default 60)
JENKINS_LOG_CACHE_MB No Disk cap for the log cache in MB (default 1024); 0 turns the cache off
JENKINS_RETRIES No Retries for transient failures — 502/503/504 responses and refused connections (default 3); 0 disables

Claude Desktop / Claude Code

Add to your MCP client configuration. To run it from PyPI:

{
  "mcpServers": {
    "jenkins": {
      "command": "uvx",
      "args": ["mcp-jenkins-client"],
      "env": {
        "JENKINS_URL": "https://jenkins.example.com",
        "JENKINS_USERNAME": "your-username",
        "JENKINS_API_TOKEN": "your-api-token"
      }
    }
  }
}

After pipx install or pip install, use "command": "mcp-jenkins-client" with no args instead.

For a uv install from source, use the path to your checkout:

{
  "mcpServers": {
    "jenkins": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-jenkins-client", "run", "mcp-jenkins-client"],
      "env": {
        "JENKINS_URL": "https://jenkins.example.com",
        "JENKINS_USERNAME": "your-username",
        "JENKINS_API_TOKEN": "your-api-token"
      }
    }
  }
}

For the Docker image, the client starts a container for each session:

{
  "mcpServers": {
    "jenkins": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "JENKINS_URL", "-e", "JENKINS_USERNAME", "-e", "JENKINS_API_TOKEN",
        "mcp-jenkins-client"
      ],
      "env": {
        "JENKINS_URL": "https://jenkins.example.com",
        "JENKINS_USERNAME": "your-username",
        "JENKINS_API_TOKEN": "your-api-token"
      }
    }
  }
}
  • -i is required: the server talks to the client over stdin and stdout.
  • -e NAME without a value passes the variable from env into the container, so the token stays out of the command line. Add "-e", "JENKINS_TIMEOUT" or "-e", "JENKINS_LOG_CACHE_MB" to pass an optional setting.
  • Add "-v", "mcp-jenkins-cache:/root/.cache/mcp-jenkins-client" to args to keep the log cache across sessions; without it each container starts with an empty cache.
  • Inside the container, localhost is the container itself. For a Jenkins on your own machine, use http://host.docker.internal:8080 (on Linux, also add "--add-host=host.docker.internal:host-gateway" to args).

Available Tools (54)

Jobs (14 tools)

  • list_jobs — List jobs with server-side pagination
  • get_job_info — Get full job details
  • get_job_config — Get job XML configuration
  • create_job — Create a job from XML config
  • reconfig_job — Update job configuration
  • copy_job — Copy a job
  • rename_job — Rename a job
  • delete_job — Delete a job
  • enable_job — Enable a disabled job
  • disable_job — Disable a job
  • job_exists — Check if a job exists
  • create_folder — Create a folder
  • set_next_build_number — Set next build number
  • search_jobs — Search jobs by regex across all folder depths

Builds (16 tools)

Every build tool except delete_build accepts lastBuild, lastSuccessfulBuild, lastFailedBuild or lastCompletedBuild in place of a build number; responses to an alias include the resolved build_number. Right after build_job, lastBuild is still the previous build — use the build number from wait_for_queue_item.

  • list_builds — List builds for a job with pagination (optionally with each build's result and parameters)
  • build_job — Trigger a build (auto-routes parameterized jobs to buildWithParameters; on a multibranch project, starts a branch scan)
  • get_build_info — Get full build details
  • get_build_status — Get just result/building/duration — cheap, use for polling
  • wait_for_build — Block until a build finishes (bounded, default 300s)
  • get_build_console_output — Read a byte range of the console log
  • search_build_console — Regex-search the console log, with context lines; page with from_offset
  • get_build_stages — Get pipeline stage info
  • get_stage_log — Read one pipeline stage's log
  • get_failed_stage_log — Jump straight to the tail of the first failed stage
  • get_build_env_vars — Get build environment variables
  • get_build_test_report — Get test results
  • stop_build — Stop a running build (escalates /stop → /term → /kill)
  • delete_build — Delete a build
  • get_build_artifact — Download a build artifact
  • get_running_builds — List running builds

Nodes (6 tools)

  • list_nodes — List agent nodes with pagination
  • get_node_info — Get node details
  • get_node_config — Get node XML configuration
  • delete_node — Delete a node
  • enable_node — Enable a node
  • disable_node — Disable a node

Views (6 tools)

  • list_views — List views with pagination
  • get_view_config — Get view XML configuration
  • create_view — Create a view
  • reconfig_view — Update view configuration
  • delete_view — Delete a view
  • view_exists — Check if a view exists

Queue (4 tools)

  • get_queue_info — List queued items with pagination
  • get_queue_item — Get queued item details
  • wait_for_queue_item — Wait for a queued item to start, return its build number
  • cancel_queue_item — Cancel a queued build

Plugins (2 tools)

  • list_plugins — List installed plugins with pagination
  • get_plugin_info — Get plugin details

System (6 tools)

  • get_server_info — Get Jenkins server info
  • get_whoami — Get current user info
  • get_version — Get Jenkins version
  • quiet_down — Prepare Jenkins for shutdown
  • run_groovy_script — Execute Groovy script
  • check_jenkinsfile_syntax — Validate Jenkinsfile syntax

Typical workflow

build_job          → queue_id
wait_for_queue_item → build_number
wait_for_build      → result
get_failed_stage_log   (or search_build_console for a specific pattern)

Pagination

List tools support server-side pagination with offset and limit parameters:

Use list_jobs with offset=0, limit=10 to get the first 10 jobs

Console output supports byte-based pagination, capped at 100 KB per call:

Use get_build_console_output with offset=0, limit=5000 to read the first 5KB

Build logs routinely reach hundreds of megabytes. Don't scan them with offsets — search them:

Use search_build_console with pattern='ERROR|Traceback|FAILED' to find failures

Each match reports a byte_offset; pass it to get_build_console_output as offset and the output starts exactly at the matched line. All offsets (byte_offset, offset, next_offset, from_offset) are byte positions in the text the tools return, not in Jenkins' raw log.

The search stops once it has max_matches matches (default 50) and their context, so total_matches means "at least this many" unless scanned_all is true. Pass count_all=true to read the whole log for an exact count. For the next batch, pass the result's next_offset as from_offset: paging that way returns every match exactly once, with absolute line numbers (a running build's unfinished last line may repeat).

Log cache

The first read of a build's log downloads it from Jenkins and keeps an exact copy on disk, so later searches and reads of that build — also in later sessions — read the local copy instead of downloading it again. A log is downloaded only as far as a call needs (a search stops at its matches); a later call resumes from where the last download stopped. A running build's copy is extended with only what was added. Parallel calls in one session share one download per build. Word searches (error|FAILED|traceback) use a fast substring path. Design: docs/superpowers/specs/2026-11-29-log-reading-design.md.

  • Location: $XDG_CACHE_HOME/mcp-jenkins-client/logs/, default ~/.cache/mcp-jenkins-client/logs/.
  • The cache stores build log text on disk. The directory is made private to your user (mode 0700), and the cache turns itself off if someone else owns it. On Windows there is no such check, so no privacy promise.
  • JENKINS_LOG_CACHE_MB caps its size (default 1024); the least recently read copies go first, and copies unread for 7 days are deleted. 0 turns the cache off: every call then streams the log from Jenkins.
  • A cache error (such as a full disk) turns the cache off for the rest of the session; a call caught by it mid-download fails once, asking for a retry.

License

MIT — see LICENSE.

Metadata

Release files for mcp-jenkins-client 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mcp-jenkins-client 0.1.3
File Size Uploaded Provenance Actions
mcp_jenkins_client-0.1.3.tar.gz 201.0 kB With provenance Details for mcp_jenkins_client-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mcp-jenkins-client 0.1.3
File Interpreter ABI Platform Actions
mcp_jenkins_client-0.1.3-py3-none-any.whl Python 3 none any Details for mcp_jenkins_client-0.1.3-py3-none-any.whl

Total release size: 238.7 kB

Release files / mcp_jenkins_client-0.1.3.tar.gz

Download URL mcp_jenkins_client-0.1.3.tar.gz
Size 201.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0eb98241d853b2dcc17d220a466f850f6f1a1d7d804c59aa7972226c7caa4c43
BLAKE2b-256 checksum
How to use checksums
0c7394fb03da33783f897d6ab8b4a0a809db0df7fa3d7c1e8d96c9e8cfb6889e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / mcp_jenkins_client-0.1.3-py3-none-any.whl

Download URL mcp_jenkins_client-0.1.3-py3-none-any.whl
Size 37.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b54b20ea2eca1ac01b2f3343edcaaee5b0ae8c94cef49913f0b7cb241aa3035
BLAKE2b-256 checksum
How to use checksums
1ccfd6f98adb1c1317c81bc6fd0db34de0e5163ee2c9acd959c37b5dbf03fe28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for mcp-jenkins-client 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mcp_jenkins_client-0.1.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page