mcp-jenkins-client
v0.1.2MCP server for Jenkins CI/CD integration via python-jenkins
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_server_info
Get Jenkins server information including mode, description, and job counts.
get_whoami
Get information about the currently authenticated Jenkins user.
get_version
Get the Jenkins server version string.
quiet_down
Put Jenkins into quiet mode, preventing new builds from starting. Used to prepare for shutdown.
run_groovy_script
Execute a Groovy script on the Jenkins server or a specific node. Returns the script output.
| Parameter | Type | Description |
|---|---|---|
script * | string | |
node |
check_jenkinsfile_syntax
Validate a Jenkinsfile pipeline script for syntax errors.
| Parameter | Type | Description |
|---|---|---|
jenkinsfile * | string |
list_jobs
List Jenkins jobs with server-side pagination. Note: recursive=True fetches all jobs across all folders before paginating, which can be slow on large instances. Prefer using folder_path to browse specific folders, or the default non-recursive mode which is paginated server-side. Args: offset: Starting index for pagination (default 0) limit: Maximum number of jobs to return (default 50) folder_path: Optional folder path to list jobs from a specific folder recursive: Fetches all jobs across all folders. Can be slow on large instances — prefer folder_pa…
| Parameter | Type | Description |
|---|---|---|
folder_path | ||
limit | integer | |
offset | integer | |
recursive | boolean |
get_job_info
Get full details for a Jenkins job including status, health, and build history.
| Parameter | Type | Description |
|---|---|---|
job_name * | string |
get_job_config
Get the XML configuration of a Jenkins job.
| Parameter | Type | Description |
|---|---|---|
job_name * | string |
create_job
Create a new Jenkins job from an XML configuration string.
| Parameter | Type | Description |
|---|---|---|
config_xml * | string | |
job_name * | string |
reconfig_job
Update the XML configuration of an existing Jenkins job.
| Parameter | Type | Description |
|---|---|---|
config_xml * | string | |
job_name * | string |
copy_job
Copy a Jenkins job to a new name.
| Parameter | Type | Description |
|---|---|---|
from_name * | string | |
to_name * | string |
rename_job
Rename an existing Jenkins job.
| Parameter | Type | Description |
|---|---|---|
from_name * | string | |
to_name * | string |
delete_job
Permanently delete a Jenkins job.
| Parameter | Type | Description |
|---|---|---|
job_name * | string |
enable_job
Enable a disabled Jenkins job.
| Parameter | Type | Description |
|---|---|---|
job_name * | string |
disable_job
Disable a Jenkins job, preventing builds from running.
| Parameter | Type | Description |
|---|---|---|
job_name * | string |
job_exists
Check whether a Jenkins job exists.
| Parameter | Type | Description |
|---|---|---|
job_name * | string |
create_folder
Create a new folder in Jenkins for organizing jobs.
| Parameter | Type | Description |
|---|---|---|
folder_name * | string |
set_next_build_number
Set the next build number for a Jenkins job.
| Parameter | Type | Description |
|---|---|---|
job_name * | string | |
number * | integer |
search_jobs
Search for Jenkins jobs by regex pattern on job name. Searches all folders at all depths. Returns matching jobs with pagination. The pattern is matched against job names using Python regex (re.search). Examples: 'deploy' matches any job containing 'deploy', '^build-' matches jobs starting with 'build-', 'release.*prod' matches 'release-to-prod' etc.
| Parameter | Type | Description |
|---|---|---|
pattern * | string | |
limit | integer | |
offset | integer |
list_builds
List builds for a Jenkins job with pagination. Start with a small limit (10-20) and paginate as needed — long-lived jobs may have thousands of builds. include_parameters=True also returns each build's result and its build parameters as {name: value} — use it to find a known-good build's settings.
| Parameter | Type | Description |
|---|---|---|
job_name * | string | |
include_parameters | boolean | |
limit | integer | |
offset | integer |
build_job
Trigger a build for a Jenkins job. Returns the queue item ID for tracking. Pass the queue_id to wait_for_queue_item to get the resulting build number. Parameterized jobs are routed to buildWithParameters automatically, including when no parameters are supplied (Jenkins rejects /build with 400 for those). On a multibranch project (or organization folder) this starts a branch scan instead and returns scan_triggered=true with no queue_id: branch jobs whose head changed are then built. To build one branch, pass the branch job, e.g. "<project>/<branch>".
| Parameter | Type | Description |
|---|---|---|
job_name * | string | |
parameters |
get_build_status
Get just the status of a build — result, building, duration, timestamp. Cheap alternative to get_build_info when all you need is whether the build finished and how it ended. Use this for polling.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string |
wait_for_build
Block until a build finishes, then return its final status. Waits at most timeout_seconds (default 300, max 3600). If the build is still running when the timeout expires, returns the current status with timed_out=true — call again to keep waiting. build_number also accepts lastBuild, lastSuccessfulBuild, lastFailedBuild and lastCompletedBuild. Right after build_job, lastBuild is still the *previous* build — wait on the build_number returned by wait_for_queue_item instead.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string | |
poll_interval_seconds | integer | |
timeout_seconds | integer |
get_build_info
Get full details for a specific build including result, duration, and parameters. For just the status, prefer get_build_status.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string |
get_build_console_output
Read a byte range of a build's console log. Build logs reach hundreds of megabytes. To find something specific, use search_build_console instead of scanning with offsets — and when a pipeline stage failed, get_failed_stage_log is narrower still. offset and next_offset are byte positions in the returned text: a search match's byte_offset reads back exactly at its line. limit is capped at 100000 bytes; paginate with next_offset. A page never splits a character. total_size is the text length known so far; has_more stays true while the build runs. Reading at off…
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string | |
limit | integer | |
offset | integer |
search_build_console
Search a build's console log with a regex and return matching lines with context. Works on multi-hundred-MB logs that are impractical to page through with get_build_console_output. Each match reports its line number and byte_offset; get_build_console_output(offset=byte_offset) reads back exactly at that line. The log is downloaded once and kept locally, so repeated searches are fast. Stops after max_matches matches (and their context) unless count_all=true, so total_matches is a lower bound unless scanned_all is true. For the next batch, pass next_offset as from_o…
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string | |
pattern * | string | |
context_lines | integer | |
count_all | boolean | |
from_offset | integer | |
ignore_case | boolean | |
max_matches | integer |
get_build_env_vars
Get environment variables used in a specific build.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string |
get_build_test_report
Get test results for a specific build including pass/fail/skip counts.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string |
get_build_stages
Get pipeline stage information for a build (requires Pipeline job). Returns each stage's id, name, status and duration. Pass a stage id to get_stage_log to read only that stage's output. The wfapi _links blob is stripped by default because the stage id is all the log tools need.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string | |
include_links | boolean |
get_stage_log
Read the log of a single pipeline stage, identified by its wfapi stage id. Get stage ids from get_build_stages. This is far narrower than the whole build log — prefer it when you already know which stage failed. limit is capped at 100000 characters.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string | |
stage_id * | string | |
limit | integer | |
offset | integer |
get_failed_stage_log
Find the first failed pipeline stage of a build and return the tail of its log. One call replaces the usual get_build_stages → hunt-through-console-output loop. Returns the *end* of the stage log, where the failure almost always is. limit is capped at 100000 characters.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string | |
limit | integer |
stop_build
Stop a running build, escalating through /stop, /term and /kill. Reports which endpoint succeeded. If all fail with 401/403 the cause is usually server-side (missing Job/Cancel permission, or a Jenkins instance that requires a session-bound CSRF crumb for POST) rather than a bad token.
| Parameter | Type | Description |
|---|---|---|
build_number * | ||
job_name * | string |
delete_build
Permanently delete a build from the build history.
| Parameter | Type | Description |
|---|---|---|
build_number * | integer | |
job_name * | string |
get_build_artifact
Download a build artifact by its relative path. Returns text content directly, or base64-encoded content for binary files.
| Parameter | Type | Description |
|---|---|---|
artifact_path * | string | |
build_number * | ||
job_name * | string |
get_running_builds
List currently running builds across all nodes. Note: fetches all running builds first, then paginates client-side. On large instances with many executors this may be slow. Use offset/limit to paginate through results.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
list_nodes
List Jenkins agent nodes with server-side pagination. Start with a small limit (10-20) and paginate — large instances may have hundreds of nodes.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
get_node_info
Get full details for a Jenkins agent node.
| Parameter | Type | Description |
|---|---|---|
node_name * | string |
get_node_config
Get the XML configuration of a Jenkins agent node.
| Parameter | Type | Description |
|---|---|---|
node_name * | string |
delete_node
Permanently delete a Jenkins agent node.
| Parameter | Type | Description |
|---|---|---|
node_name * | string |
enable_node
Enable a disabled Jenkins agent node.
| Parameter | Type | Description |
|---|---|---|
node_name * | string |
disable_node
Disable a Jenkins agent node with an optional reason message.
| Parameter | Type | Description |
|---|---|---|
node_name * | string | |
message | string |
list_views
List Jenkins views with server-side pagination. Start with a small limit and paginate as needed.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
get_view_config
Get the XML configuration of a Jenkins view.
| Parameter | Type | Description |
|---|---|---|
view_name * | string |
create_view
Create a new Jenkins view from an XML configuration string.
| Parameter | Type | Description |
|---|---|---|
config_xml * | string | |
view_name * | string |
reconfig_view
Update the XML configuration of an existing Jenkins view.
| Parameter | Type | Description |
|---|---|---|
config_xml * | string | |
view_name * | string |
delete_view
Permanently delete a Jenkins view.
| Parameter | Type | Description |
|---|---|---|
view_name * | string |
view_exists
Check whether a Jenkins view exists.
| Parameter | Type | Description |
|---|---|---|
view_name * | string |
get_queue_info
List queued items waiting to be built, with server-side pagination. Start with a small limit and paginate — busy instances may have many queued items.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
get_queue_item
Get full details for a specific queued item by its queue ID.
| Parameter | Type | Description |
|---|---|---|
queue_id * | integer |
wait_for_queue_item
Wait for a queued item to start building and return its build number. build_job returns a queue_id, but every other build tool needs a build number — this bridges the two. Blocks until Jenkins assigns an executor (at most timeout_seconds, default 300, max 3600). Returns started=true with build_number/build_url once running, cancelled=true if the item was cancelled, or timed_out=true with the current "why" reason.
| Parameter | Type | Description |
|---|---|---|
queue_id * | integer | |
poll_interval_seconds | integer | |
timeout_seconds | integer |
cancel_queue_item
Cancel a queued build by its queue ID.
| Parameter | Type | Description |
|---|---|---|
queue_id * | integer |
list_plugins
List installed Jenkins plugins with server-side pagination. Start with a small limit and paginate — Jenkins instances often have 100+ plugins installed.
| Parameter | Type | Description |
|---|---|---|
limit | integer | |
offset | integer |
get_plugin_info
Get full details for a specific installed Jenkins plugin.
| Parameter | Type | Description |
|---|---|---|
plugin_name * | string |