jenkins-mcp
Provides tools for managing Jenkins jobs, builds, nodes, and queues through the Jenkins API, enabling querying, triggering, and controlling Jenkins CI/CD pipelines.
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., "@jenkins-mcp list all Jenkins jobs"
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.
jenkins-mcp
A Model Context Protocol (MCP) server that provides AI assistants with full access to Jenkins CI/CD systems. Built with TypeScript and Node.js, it enables Claude, Cursor, and other MCP-compatible clients to query, manage, and control Jenkins jobs, builds, nodes, and queues through natural language.
Table of Contents
Related MCP server: Jenkins MCP Server
Features
23 MCP Tools — Full Jenkins automation: jobs, builds, nodes, and queues
3 Transport Modes —
stdio,sse, andstreamable-httpfor different deployment scenariosRead-Only Mode — Restrict to safe, read-only operations for controlled environments
Per-Request Auth — HTTP header-based Jenkins auth for multi-user/multi-tenant setups
SSL Configuration — Toggle SSL certificate verification for self-signed certs
Session Singleton — Reuse Jenkins client connections within a session for efficiency
CSRF Protection — Automatic crumb/token handling for Jenkins security
Folder Support — Full support for nested Jenkins folders and multi-branch pipelines
TypeScript Strict Mode — Fully typed codebase with strict compiler checks
Usage
MCP Client
Add the following to your MCP client configuration file:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"jenkins-mcp",
"--jenkins-url",
"https://jenkins.example.com",
"--jenkins-username",
"your-username",
"--jenkins-password",
"your-api-token"
]
}
}
}Claude Code
claude mcp add jenkins -- npx jenkins-mcp \
--jenkins-url https://jenkins.example.com \
--jenkins-username your-username \
--jenkins-password your-api-tokenCursor
Add to your Cursor MCP settings (.cursor/mcp.json):
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"jenkins-mcp",
"--jenkins-url",
"https://jenkins.example.com",
"--jenkins-username",
"your-username",
"--jenkins-password",
"your-api-token"
]
}
}
}Read-Only Mode
For safety in production environments, use --read-only to disable all write operations:
{
"mcpServers": {
"jenkins": {
"command": "npx",
"args": [
"jenkins-mcp",
"--read-only",
"--jenkins-url",
"https://jenkins.example.com",
"--jenkins-username",
"your-username",
"--jenkins-password",
"your-api-token"
]
}
}
}Configuration
Jenkins-MCP can be configured through CLI arguments, environment variables, or HTTP headers (for HTTP transports).
CLI Options
jenkins-mcp [options]Option | Description | Default |
| Jenkins server URL | — |
| Jenkins username | — |
| Jenkins password or API token | — |
| API request timeout in seconds |
|
| Verify SSL certificates |
|
| Reuse Jenkins client within session |
|
| Only register read-only tools |
|
| Register the unsafe raw full-console-output tool |
|
| Transport mode: |
|
| Host for HTTP transports |
|
| Port for HTTP transports |
|
Environment Variables
Jenkins-MCP reads configuration from process environment variables. It does not auto-load .env files by itself.
If you use a local .env file, load it before starting the server (for example: set -a; source .env; set +a), then run jenkins-mcp.
Example .env values:
# Jenkins server URL
jenkins_url=https://jenkins.example.com/
# Jenkins basic auth
jenkins_username=your-username
jenkins_password=your-api-token
# Optional runtime settings
jenkins_timeout=5
jenkins_verify_ssl=true
jenkins_session_singleton=trueHTTP Headers (HTTP Transports Only)
When using sse or streamable-http transport, Jenkins credentials can be provided per-request via HTTP headers. This enables multi-user scenarios where different requests authenticate against different Jenkins instances.
Header | Description |
| Jenkins server URL |
| Jenkins username |
| Jenkins password or API token |
Each provided header overrides the corresponding environment variable for that request. Missing header values fall back to environment configuration.
Available Tools
Job / Item Tools
Tool | Description | Parameters | Read-Only |
| Get all jobs and folders from Jenkins | — | Yes |
| Get a specific job or folder by full name |
| Yes |
| Get job configuration XML |
| Yes |
| Update job configuration XML |
| No |
| Search items with regex filters |
| Yes |
| Trigger a job build |
| No |
Build Tools
Tool | Description | Parameters | Read-Only |
| Get build details |
| Yes |
| Get the recent tail of build console output |
| Yes |
| Read incremental console output by offset |
| Yes |
| Search console output incrementally with excerpts |
| Yes |
| Get focused failure excerpts and test hints via incremental scan |
| Yes |
| Get raw full console log output |
| Yes |
| Get test results report |
| Yes |
| Extract build scripts (for replay) |
| Yes |
| Get all currently running builds | — | Yes |
| Stop a running build |
| No |
For large logs, prefer get_build_console_tail -> search_build_console -> get_build_console_chunk.
get_build_console_output is disabled by default and only registered when --allow-full-console-output is set.
Large-log helper tools enforce server-side byte ceilings even if the caller asks for more, and search-style tools scan logs incrementally instead of fetching consoleText.
Recommended Troubleshooting Flow
For a failed build, prefer this sequence:
get_buildto confirmresult,building, and the target build number.get_build_failure_excerptto get focused failure snippets plus failing test hints.search_build_consolewith anchors such asCaused by:,ERROR,FAILED, or a failing test name.get_build_console_chunkto continue reading from a returnednextStartoffset when the first excerpt is not enough.get_build_console_outputonly when raw full log export is explicitly needed.
For a running build, prefer this sequence:
get_buildto confirm the build is still running.get_build_console_tailto inspect the latest output window.search_build_consolefor known error anchors in the recent window.get_build_console_chunkwith the lastnextStartvalue to keep polling without rereading old output.
Node Tools
Tool | Description | Parameters | Read-Only |
| Get all compute nodes | — | Yes |
| Get a specific node with executor info |
| Yes |
| Get node configuration XML |
| Yes |
| Update node configuration XML |
| No |
Queue Tools
Tool | Description | Parameters | Read-Only |
| Get all items waiting in the queue | — | Yes |
| Get a specific queue item by ID |
| Yes |
| Cancel a queued item |
| No |
Tools marked Read-Only: No are only available when
--read-onlyis not set.
Transport Modes
stdio (Default)
Standard input/output transport for direct MCP client integration. This is the recommended mode for Claude Desktop, Cursor, and other desktop MCP clients.
jenkins-mcp --transport stdio \
--jenkins-url https://jenkins.example.com \
--jenkins-username user --jenkins-password tokenSSE (Server-Sent Events)
HTTP-based transport using Server-Sent Events. Suitable for web-based clients or remote access scenarios.
jenkins-mcp --transport sse \
--host 127.0.0.1 --port 9887 \
--jenkins-url https://jenkins.example.com \
--jenkins-username user --jenkins-password tokenSSE endpoint:
GET /sse— establishes an SSE connection and returns a sessionMessage endpoint:
POST /message?sessionId=<id>— sends messages to the session
Streamable HTTP
Session-based HTTP MCP transport over /mcp. Sessions are initialized via MCP initialize, then correlated with mcp-session-id in follow-up requests.
jenkins-mcp --transport streamable-http \
--host 127.0.0.1 --port 9887 \
--jenkins-url https://jenkins.example.com \
--jenkins-username user --jenkins-password tokenMCP endpoint:
POST /mcp— handles all MCP protocol messages
Architecture
┌─────────────────────────────────────────────────┐
│ MCP Client │
│ (Claude, Cursor, etc.) │
└──────────────────┬──────────────────────────────┘
│ MCP Protocol
┌──────────────────▼──────────────────────────────┐
│ Transport Layer │
│ stdio │ SSE │ Streamable HTTP │
├──────────────────┬──────────────────────────────┤
│ MCP Server (mcp.ts) │
│ Tool registration & error handling │
├──────────────────┬──────────────────────────────┤
│ Tool Handlers │
│ item.ts │ build.ts │ node.ts │ queue.ts │
├──────────────────┬──────────────────────────────┤
│ Jenkins REST Client │
│ HTTP requests, auth, CSRF, timeout │
├──────────────────┬──────────────────────────────┤
│ Jenkins Server │
│ (REST API endpoint) │
└─────────────────────────────────────────────────┘Key design patterns:
Dependency Injection —
ToolRuntimeinterface enables testable tool handlersSession Management — HTTP transports map sessions to isolated runtime contexts
Per-Request Auth — HTTP headers override environment config for multi-tenant use
Automatic CSRF — Crumb tokens are fetched and cached transparently
Development
Scripts
Command | Description |
| Start in watch mode (auto-reload on changes) |
| Build production bundle with tsup |
| Run tests with Vitest |
| Run tests in watch mode |
| Run tests with coverage report |
| Run all checks: format, lint, typecheck, test, build |
| Run ESLint |
| Format code with Prettier |
| Interactive conventional commit with Commitizen |
| Create a changeset for release |
License
Available Tools
22 toolsbuild_itemC
Build an item in Jenkins.
Inputs: fullname (required), build_type (required), params.
cancel_queue_itemA
Cancel a specific item in Jenkins queue by id.
Inputs: id (required).
get_all_itemsBRead-only
Get all items from Jenkins.
Inputs: no named parameters.
get_all_nodesBRead-only
Get all nodes from Jenkins.
Inputs: no named parameters.
get_all_queue_itemsARead-only
Get all items in Jenkins queue.
Inputs: no named parameters.
get_buildCRead-only
Get specific build info from Jenkins.
Inputs: fullname (required), number.
get_build_console_chunkBRead-only
Read incremental console output from a specific byte offset.
Inputs: fullname (required), start (required), number, max_bytes.
get_build_console_tailCRead-only
Get the tail of a specific build console output.
Inputs: fullname (required), number, max_bytes.
get_build_failure_excerptBRead-only
Get focused failure excerpts and failing tests via incremental log scanning.
Inputs: fullname (required), number, max_bytes, max_excerpts.
get_build_scriptsCRead-only
Get scripts used in a specific build.
Inputs: fullname (required), number.
get_build_test_reportCRead-only
Get test report of a specific build.
Inputs: fullname (required), number.
get_itemBRead-only
Get specific item from Jenkins.
Inputs: fullname (required).
get_item_configCRead-only
Get specific item config from Jenkins.
Inputs: fullname (required).
get_nodeBRead-only
Get a specific node from Jenkins.
Inputs: name (required).
get_node_configCRead-only
Get node config from Jenkins.
Inputs: name (required).
get_queue_itemARead-only
Get a specific item in Jenkins queue by id.
Inputs: id (required).
get_running_buildsARead-only
Get all running builds from Jenkins.
Inputs: no named parameters.
query_itemsDRead-only
Query items from Jenkins.
Inputs: class_pattern, fullname_pattern, color_pattern.
search_build_consoleCRead-only
Search build console output incrementally and return matching excerpts.
Inputs: fullname (required), query (required), number, max_bytes, +3 more.
set_item_configC
Set specific item config in Jenkins.
Inputs: fullname (required), config_xml (required).
set_node_configC
Set specific node config in Jenkins.
Inputs: name (required), config_xml (required).
stop_buildC
Stop a specific build.
Inputs: fullname (required), number (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool targets a distinct aspect of Jenkins (builds, queue, nodes, items, configs, console output). There is no overlap; even similar operations like get_build_console_chunk and get_build_console_tail are well-differentiated.
All tools use consistent snake_case verb_noun naming (e.g., get_build, cancel_queue_item, set_item_config). No mixing of styles or abbreviations.
22 tools is slightly high for a single server, but Jenkins is a complex system with many operations. The count is justified and not excessive, though it could be trimmed by combining some getters.
The tool set covers many operations (build, queue, nodes, configs, console, test reports) but lacks item creation/deletion and node creation/deletion. There are notable gaps in managing the lifecycle of items and nodes.
Maintenance
Related MCP Connectors
Plan Salesforce deploys, open pull requests and trigger pipelines from your AI client.
Connect AI agents to CloudBees Unify: feature flags, CI/CD, release orchestration, and security
Inspect and control your Northflank projects, services, jobs, and builds from your AI assistant.
Direct access to Cypress tests results and accessibility reports in your AI workflow.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Jenkins CI/CD systems through natural language, providing build management, job monitoring, log analysis, and debugging capabilities.MIT
- 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
- FlicenseNot gradedqualityAmaintenanceEnables AI assistants to securely inspect and manage Jenkins servers, providing tools for jobs, builds, nodes, queues, views, plugins, artifacts, and Groovy scripts through natural-language workflows.-