mcp-jenkins
The mcp-jenkins server enables AI language models to securely interact with Jenkins CI/CD systems through the Model Context Protocol (MCP), providing comprehensive automation and monitoring capabilities.
Core Capabilities:
Job Management: Get all jobs, search by patterns (class, name, fullname, URL, color), retrieve job info/config, trigger builds with parameters, and manage multibranch pipeline jobs including branch listing and scan triggering
Build Operations: Monitor running builds, retrieve build details/logs/source code, get test results with status filtering (PASSED, SKIPPED, FAILED, FIXED, REGRESSION), and stop running builds
Queue Management: View all queue items, get specific queue item details, and cancel queued jobs
Node/Agent Management: Get all Jenkins nodes and retrieve node configurations
Security & Configuration:
Optional read-only mode to prevent write operations
Flexible authentication via username/password or API token (command line or HTTP headers)
Configurable SSL certificate verification
Regex-based tool filtering to restrict available operations
Deployment & Integration:
Multiple transport methods: stdio, SSE, and streamable-http
Pre-configured for JetBrains GitHub Copilot and VSCode Copilot Chat
Docker support for easy deployment
Provides tools for interacting with Jenkins CI/CD systems, including retrieving job information, searching jobs, accessing build data, viewing job configurations, and triggering builds with parameters.
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., "@mcp-jenkins show me the status of the production deployment pipeline"
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.
MCP Jenkins
The Model Context Protocol (MCP) is an open-source implementation that bridges Jenkins with AI language models following Anthropic's MCP specification. This project enables secure, contextual AI interactions with Jenkins tools while maintaining data privacy and security.
Installation
Choose one of these installation methods:
# Using uv (recommended)
pip install uv
uvx mcp-jenkins
# Using pip
pip install mcp-jenkins
mcp-jenkins
# Docker
docker pull ghcr.io/lanbaoshen/mcp-jenkins:latest
docker run -p 9887:9887 --rm ghcr.io/lanbaoshen/mcp-jenkins:latest --transport streamable-httpRelated MCP server: MCP Jenkins
Line Arguments
When using command line arguments, you can specify the Jenkins server details as follows:
# Simple streamable-http example
uvx mcp-jenkins --transport streamable-httpArgument | Description | Required |
| Path to a | No |
| The URL of the Jenkins server. (Http app can set it via headers | No |
| The username for Jenkins authentication. (Http app can set it via headers | No |
| The password or API token for Jenkins authentication. (Http app can set it via headers | No |
| Timeout for Jenkins API requests in seconds. Default is | No |
| Whether to verify SSL certificates when connecting to Jenkins. Default is to verify. | No |
| Whether to use a singleton Jenkins client for all requests in the same session. Default is True. | No |
| Whether to enable read-only mode. Default is False | No |
| Transport method to use for communication. Options are | No |
| Host address for | No |
| Port number for | No |
Environment Variables / .env file
Instead of passing credentials on the command line, you can set them as environment variables, or put them in a .env file:
JENKINS_URL=https://jenkins.example.com
JENKINS_USERNAME=alice
JENKINS_PASSWORD=xxxx
JENKINS_TIMEOUT=5
JENKINS_VERIFY_SSL=trueIf a .env file is present in the current directory (or a parent directory), it is loaded automatically — no flag needed:
uvx mcp-jenkins --transport streamable-httpTo load a .env file from a specific location, use --env-file:
uvx mcp-jenkins --env-file /path/to/.env --transport streamable-httpValues already set in the real environment take precedence over the .env file, and any --jenkins-* CLI flag takes precedence over both.
Configuration and Usage
Jetbrains Github Copilot
Open Jetbrains Settings
Navigate to Github Copilot > MCP > Configure
Add the following configuration:
{
"servers": {
"my-mcp-server": {
"type": "stdio",
"command": "uvx",
"args": [
"mcp-jenkins",
"--jenkins-url=xxx",
"--jenkins-username=xxx",
"--jenkins-password=xxx"
]
}
}
}VSCode Copilot Chat
Create
.vscodefolder withmcp.jsonfile in you workspace for local setup or editsettings.jsontrough settings menu.Insert the following configuration:
SSE mode
{
"servers": {
"jenkins": {
"url": "http://localhost:9887/sse",
"type": "sse"
}
}
}Streamable-Http mode
{
"servers": {
"mcp-jenkins-mcp": {
"autoApprove": [],
"disabled": false,
"timeout": 60,
"type": "streamableHttp",
"url": "http://localhost:9887/mcp"
}
}
}Run the Jenkins MCP server with the following command:
uvx mcp-jenkins \
--jenkins-url xxx \
--jenkins-username xxx \
--jenkins-password xxx \
--transport sseHealth Check Endpoint
When running with --transport streamable-http or --transport sse, the server exposes a plain HTTP liveness endpoint:
GET /healthz -> 200 OKIt always returns 200 and bypasses the x-jenkins-* auth headers, so it is safe to use directly as a Kubernetes liveness/readiness probe without any Jenkins credentials. Example probe:
livenessProbe:
httpGet:
path: /healthz
port: 9887
initialDelaySeconds: 5
periodSeconds: 10Note: this is a liveness check only — it does not verify connectivity to the upstream Jenkins server.
Available Tools
Tool | Description |
| Get a specific item by name. |
| Get the configuration of a specific item. |
| Get the parameters of a specific item. |
| Get all items in Jenkins. |
| Query items based on pattern. |
| Build a item. |
| Get all nodes in Jenkins. |
| Get a specific node by name. |
| Get the configuration of a specific node. |
| Get all queue items in Jenkins. |
| Get a specific queue item by ID. |
| Cancel a specific queue item by ID. |
| Get a specific build by job name and build number. |
| Get scripts associated with a specific build. |
| Get the console output of a specific build. |
| Get the parameters of a specific build. |
| Get the test report of a specific build. |
| Get the failing tests of a specific build. |
| Get all currently running builds in Jenkins. |
| Stop a specific build by job name and build number. |
| Get the pending input steps of a build paused for input. |
| Proceed with or abort a pipeline input step of a build. |
| List the artifacts of a specific build. |
| Download an artifact from a specific build. |
| Get the direct URL of an artifact from a specific build. |
| Get a specific view by name. |
| Get the configuration of a specific view. |
| Get all installed plugins. |
| Get a specific plugin by short name. |
| Get plugins with problems (missing dependencies, version mismatch, etc.). |
| Get plugins that can be downgraded. |
| Get plugins that have available updates. |
| Get dependency graph for a plugin in Graphviz format. |
| Execute an arbitrary Groovy script on Jenkins. |
Note: get_pending_inputs reads the wfapi endpoint served by the pipeline-rest-api plugin (bundled with
pipeline-stage-view). submit_input only needs that plugin when input_id is omitted — pass input_id
explicitly and it works on any Jenkins with the pipeline-input-step plugin.
Contributing
License
Licensed under MIT - see LICENSE file. This is not an official Jenkins product.
Star History
Available Tools
36 toolsbuild_itemA
Build an item in Jenkins
Args: fullname: The fullname of the item data: The parameters to trigger the build with. Required if build_type is 'buildWithParameters'. build_type: If your item is configured with parameters, you must use 'buildWithParameters' as build_type.
Returns: The queue item number of the item.
Inputs: fullname (required), build_type (required), data. Returns: result
cancel_queue_itemC
Cancel a specific item in Jenkins queue by id
Args: id: The id of the queue item
Inputs: id (required).
get_all_build_artifactsA
List the artifacts of a specific build in Jenkins
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build
Returns: A list of artifact metadata dicts with fileName, relativePath, and displayPath
Inputs: fullname (required), number. Returns: result
get_all_itemsB
Get all items from Jenkins
Returns: A list of items
Inputs: no named parameters. Returns: result
get_all_nodesA
Get all nodes from Jenkins
Returns: A list of all nodes
Inputs: no named parameters. Returns: result
get_all_pluginsA
Get all installed plugins from Jenkins
Args: depth: The depth of the information to retrieve. Default is 2 (includes dependencies).
Returns: A list of all installed plugins
Inputs: depth. Returns: result
get_all_queue_itemsB
Get all items in Jenkins queue
Returns: A list of all items in the Jenkins queue
Inputs: no named parameters. Returns: result
get_all_viewsA
Get all top-level views from Jenkins.
Returns: A list of views with their name and URL.
Inputs: no named parameters. Returns: result
get_buildA
Get specific build info from Jenkins
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build
Returns: The build info
Inputs: fullname (required), number. Returns: object
get_build_artifactA
Download an artifact from a specific build in Jenkins
Binary files are returned as base64-encoded content; text files are returned as plain text.
Args: fullname: The fullname of the job relative_path: The relative path of the artifact (e.g. playwright-report/index.html) number: The number of the build, if None, get the last build
Returns: A dict with 'content' (str) and 'encoding' ('utf-8' or 'base64')
Inputs: fullname (required), relative_path (required), number. Returns: object
get_build_artifact_urlB
Get the direct URL of an artifact from a specific build in Jenkins
Args: fullname: The fullname of the job relative_path: The relative path of the artifact (e.g. playwright-report/index.html) number: The number of the build, if None, get the last build
Returns: The direct Jenkins URL of the artifact
Inputs: fullname (required), relative_path (required), number. Returns: result
get_build_console_outputA
Get the console output of a specific build in Jenkins
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build pattern: Optional regex pattern to filter lines (only matching lines are returned) offset: Number of lines to skip from the beginning after filtering, default 0 limit: Maximum number of lines to return after filtering and offset
Returns: The console output of the build
Inputs: fullname (required), limit, number, offset, +1 more. Returns: result
get_build_parametersA
Get the parameters of a specific build in Jenkins
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build
Returns: A dictionary of build parameter names and their values
Inputs: fullname (required), number. Returns: object
get_build_scriptsA
Get the scripts used in a specific build in Jenkins
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build
Returns: A list of scripts used in the build
Inputs: fullname (required), number. Returns: result
get_build_test_failuresB
Get the failing tests of a specific build in Jenkins, with their error details
For a matrix build, the failures of all configurations are returned, each with the URL of its configuration build.
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build limit: Maximum number of failures to return, None for all of them max_stack_trace_length: Stack traces longer than this are cut to this many characters
Returns: The test counts of the build, its failures and whether the failures were truncated to the limit
Inputs: fullname (required), limit, number, max_stack_trace_length. Returns: object
get_build_test_reportA
Get the test report of a specific build in Jenkins
The report lists every test case, passing ones included, so it can be very large; use get_build_test_failures to see what failed.
Args: fullname: The fullname of the job number: The number of the build, if None, get the last build
Returns: The test report of the build
Inputs: fullname (required), number. Returns: object
get_itemC
Get specific item from Jenkins
Args: fullname: The fullname of the item
Returns: The item
Inputs: fullname (required). Returns: object
get_item_configA
Get specific item config from Jenkins
Args: fullname: The fullname of the item
Returns: The config of the item
Inputs: fullname (required). Returns: result
get_item_parametersA
Get the parameter definitions of a Jenkins job
Args: fullname: The fullname of the item
Returns: A list of parameter definitions, each containing name, type, defaultValue, and description
Inputs: fullname (required). Returns: result
get_nodeB
Get a specific node from Jenkins
Contains executor about the node.
Args: name: The name of the node
Returns: The node
Inputs: name (required). Returns: object
get_node_configB
Get node config from Jenkins
Args: name: The name of the node
Returns: The config of the node
Inputs: name (required). Returns: result
get_pending_inputsA
Get the pending input steps of a specific build in Jenkins
A pipeline showing "Paused for Input" is waiting on an input step. Call this before submit_input to discover the input id and the parameter definitions the pipeline is waiting for.
Only the given build is inspected. With number=None that is the job's last build, so a paused build that is no longer the most recent one is not found that way — locate it with get_running_builds and pass its number explicitly.
Args: fullname: The fullname of the job number: The number of the build, if None, check the last build
Returns: A list of pending inputs with id, message, proceedText and inputs (parameter definitions)
Inputs: fullname (required), number. Returns: result
get_pluginA
Get a specific plugin from Jenkins
Contains detailed information about the plugin, including dependencies when depth >= 2.
Args: short_name: The short name of the plugin depth: The depth of the information to retrieve. Default is 2 (includes dependencies).
Returns: The plugin details, or None if not found
Inputs: short_name (required), depth. Returns: result
get_plugin_dependency_graphA
Get dependency graph for a specific plugin in Graphviz format
Recursively analyzes dependencies down to leaf nodes. Returns nodes and edges that can be used to generate a dependency graph.
Args: short_name: The short name of the plugin to analyze
Returns: A dictionary with 'nodes' and 'edges' for Graphviz rendering
Inputs: short_name (required). Returns: object
get_plugins_with_backupA
Get plugins that can be downgraded
Returns plugins that have a backupVersion and can be rolled back.
Args: depth: The depth of the information to retrieve. Default is 0.
Returns: A list of plugins that can be downgraded
Inputs: depth. Returns: result
get_plugins_with_problemsA
Get all plugins with problems from Jenkins
These are plugins that have issues such as missing dependencies, incompatible versions, core version mismatch, or other configuration problems.
Returns: A list of plugins with problems
Inputs: no named parameters. Returns: result
get_plugins_with_updatesB
Get plugins that have available updates
Args: depth: The depth of the information to retrieve. Default is 0.
Returns: A list of plugins with available updates
Inputs: depth. Returns: result
get_queue_itemA
Get a specific item in Jenkins queue by id
Args: id: The id of the queue item
Returns: The queue item
Inputs: id (required). Returns: object
get_running_buildsA
Get all running builds from Jenkins
Returns: A list of all running builds
Inputs: no named parameters. Returns: result
get_viewA
Get a Jenkins view by path, returning its jobs and/or nested sub-views.
Views can be nested up to multiple levels deep. Use "/" to separate levels in the path. If the view contains sub-views instead of jobs, the response will include their names so you can drill down further.
Args: view_path: View path using "/" to separate levels. Examples: "All", "frontend", "frontend/nightly". Spaces and special characters in view names are handled automatically. depth: Depth of detail to retrieve for each job. Default is 0.
Returns: A dict with the view's name, jobs list, and/or nested views.
Inputs: view_path (required), depth. Returns: object
query_itemsC
Query items from Jenkins
Args: class_pattern: The pattern of the _class fullname_pattern: The pattern of the fullname color_pattern: The pattern of the color folder_depth: The maximum depth of folders to traverse. If None, traverses all levels.
Returns: A list of items
Inputs: folder_depth, class_pattern, color_pattern, fullname_pattern. Returns: result
run_groovy_scriptA
Execute an arbitrary Groovy script on Jenkins.
This tool provides access to Jenkins internal features that are not available via REST API.
Args: script: The Groovy script code to execute.
Returns: The result of the script execution.
Examples: # Basic usage: run_groovy_script(script='println Jenkins.instance.version')
# Access Jenkins information:
run_groovy_script(
script='''
def version = Jenkins.instance.version
def mode = Jenkins.instance.mode
return "Version: ${version}, Mode: ${mode}"
'''
)Inputs: script (required). Returns: result
set_item_configC
Set specific item config in Jenkins
Args: fullname: The fullname of the item config_xml: The config XML of the item
Inputs: fullname (required), config_xml (required).
set_node_configC
Set specific node config in Jenkins
Args: name: The name of the node config_xml: The config XML of the node
Inputs: name (required), config_xml (required).
stop_buildC
Stop a specific build in Jenkins
Args: fullname: The fullname of the job number: The number of the build to stop
Inputs: number (required), fullname (required).
submit_inputA
Respond to a pipeline input step of a build that is paused for input in Jenkins
Warnings: Omitting a declared parameter settles it with null — Jenkins does not fall back to the declared defaults, so every declared parameter must be submitted. That is enforced whenever the pending input can be discovered; when the pending inputs cannot be fetched (wfapi endpoint missing or erroring) an explicit input_id is submitted as-is, so check the declared parameters yourself in that case. If this call times out the input may or may not have been settled: re-check with get_pending_inputs rather than retrying, because a settled input rejects a second submission.
Args: fullname: The fullname of the job number: The number of the paused build, use get_pending_inputs to confirm its pending input (and get_running_builds to locate a paused build that is not the job's last one) input_id: The id of the pending input, if None, resolved automatically when exactly one is pending parameters: A mapping of parameter name to value, e.g. {'APPROVE': True, 'TARGET': 'prod'} action: 'proceed' to continue the pipeline, 'abort' to reject the input and abort the build
Returns: A dict with the fullname, number, inputId and the Jenkins action that was submitted: 'proceed' with values, 'proceedEmpty' with none, or 'abort'
Inputs: number (required), fullname (required), action, input_id, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 36 tools
Most tools target distinct resources and actions, and descriptions actively disambiguate near-neighbors (e.g. get_build_test_report warns to use get_build_test_failures instead, get_pending_inputs/submit_input explain their relationship). Minor overlap remains between get_all_items/query_items and among the many get_build_* variants, but the naming and args keep them separable.
Strong dominant verb_noun pattern (get_build, set_item_config, build_item, stop_build, cancel_queue_item, run_groovy_script). Slight inconsistencies appear in the get_all_X vs query_items vs get_item phrasing and get_build_artifact vs get_all_build_artifacts, but overall the convention is predictable.
36 tools is on the heavy side and exceeds the typical comfortable range. Jenkins genuinely spans many sub-domains (builds, items, nodes, plugins, queue, views, groovy), so most tools earn their place, but the surface is large enough to feel bloated and harder to navigate.
Coverage is broad: build lifecycle (get/stop/console/tests/params/artifacts), item config and triggering, node config, plugin inspection with dependency graphs, queue management, views, and an escape-hatch groovy script. Missing item/node create-delete operations are minor gaps an agent can work around via groovy or config setters.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
The Mercado Pago MCP Server implements the Model Context Protocol to provide AI agents and LLMs with access to Mercado Pago's APIs and tools within compatible development environments. It acts as an intermediary that translates Mercado Pago resources into executable functions (tools) that AI applications can invoke to perform actions and automate flows. The server simplifies integration, enables using documentation to implement or improve code, and optimizes operations through natural language interactions without manual implementations.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
Related MCP Servers
- FlicenseNot gradedqualityAmaintenanceEnables AI language models to securely interact with Jenkins through the Model Context Protocol, exposing tools to query and manage items, nodes, queues, builds, artifacts, views, plugins, and execute Groovy scripts while maintaining data privacy and security.-
- FlicenseNot gradedqualityAmaintenanceEnables AI language models to securely interact with Jenkins through the Model Context Protocol, exposing tools for querying and managing jobs, builds, nodes, queues, views, plugins, artifacts, and Groovy scripts.-
- FlicenseNot gradedqualityAmaintenanceEnables AI language models to interact securely with Jenkins through the Model Context Protocol, supporting job, build, queue, node, view, plugin, artifact, and Groovy script operations while maintaining data privacy and security.-
- FlicenseNot gradedqualityAmaintenanceEnables AI language models to securely interact with Jenkins through the Model Context Protocol, exposing tools for jobs, builds, nodes, queues, views, plugins, artifacts, and Groovy scripts.-