mcp-jenkins
Provides tools for interacting with a Jenkins server, enabling AI agents to manage items/jobs, query builds, inspect nodes and queues, list views and plugins, retrieve build artifacts and console output, trigger/stop builds, handle pipeline inputs, and run Groovy scripts.
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-jenkinslist recent builds for the main pipeline job"
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: jenkins-server-mcp
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
This server cannot be deployed
Maintenance
Related MCP Connectors
Connect AI agents to CloudBees Unify: feature flags, CI/CD, release orchestration, and security
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
- mcpOAuthcom.vibgrate
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Read and write KukGit repositories, files, issues and pull requests from an AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD systems for build management, job monitoring, console log analysis, and debugging through natural language commands.2MIT
- AlicenseBqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD servers, including checking build status, triggering builds, and retrieving build logs.8MIT
- AlicenseBqualityCmaintenanceProvides AI assistants with full access to Jenkins CI/CD systems, enabling querying, managing, and controlling Jenkins jobs, builds, nodes, and queues through natural language.22716 npm1MIT
- FlicenseNot gradedqualityAmaintenanceEnables AI language models to securely inspect and control Jenkins through natural language, covering jobs, builds and their console output/artifacts, queue items, nodes, views and plugins, plus triggering or stopping builds, submitting pipeline inputs, and running Groovy scripts. Read-only mode and CLI, environment-variable, or HTTP-header based authentication keep credentials and data under the user's control.-