Jenkins MCP Server
Provides tools for interacting with Jenkins CI/CD server, enabling management of jobs, builds, pipelines, nodes, credentials, views, and system information. Supports read-only, standard, and admin access modes, and job creation from templates.
Click on "Install 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 Servertrigger a build for job 'deploy-app'"
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 Server
A Model Context Protocol (MCP) server that provides Jenkins CI/CD integration for Cursor IDE and other MCP-compatible AI assistants.
Features
27 MCP tools covering jobs, builds, pipelines, nodes, credentials, views, system info, and more
3 access modes --
read-only,standard,admin-- so you can share safely with any audienceJob creation from templates -- create Freestyle, Pipeline, Pipeline-SCM, and Multibranch jobs without writing XML
CLI tool for quick Jenkins queries from the terminal
Python 3.7+ compatible
Quick Start
# 1. Install (from PyPI)
pip install jenkins-mcp-tools
# Or install from GitHub
# pip install git+https://github.com/saurprince/jenkins-mcp-server.git
# 2. Test connection
jenkins-mcp-server --test \
--url https://your-jenkins.example.com:8443 \
--username your-username \
--token your-api-token \
--no-verify-ssl
# 3. Add to Cursor (see "Cursor IDE Integration" below)Installation
From GitHub (Recommended)
pip install git+https://github.com/saurprince/jenkins-mcp-server.git
# Or via SSH
pip install git+ssh://git@github.com/saurprince/jenkins-mcp-server.gitFrom Source
git clone https://github.com/saurprince/jenkins-mcp-server.git
cd jenkins-mcp-server
pip install .Sharing with Your Team
There are several ways to distribute the server to others:
Option A: Install from Git
Anyone with access to the GitHub repo can install directly:
pip install git+https://github.com/saurprince/jenkins-mcp-server.gitOption B: Share a wheel file
Build a wheel and send the .whl file to teammates:
pip install build
python -m build --wheel
# Share dist/jenkins_mcp_server-2.0.0-py3-none-any.whlRecipients install with:
pip install jenkins_mcp_server-2.0.0-py3-none-any.whlOption C: Private PyPI / Artifactory
Upload the wheel to a private package index:
pip install twine
twine upload --repository internal dist/*.whlThen anyone can pip install jenkins-mcp-server from the internal index.
Option D: Public PyPI
pip install twine
twine upload dist/*.whlThen anyone in the world can pip install jenkins-mcp-tools.
Access Modes
The server supports three access modes, controlled via --mode flag or JENKINS_MODE environment variable:
Mode | Tools Available | Use Case |
| 20 read-only tools | Safe for analysts, viewers, dashboards |
| 22 tools (read + trigger/stop builds) | Day-to-day developer use |
| All 27+ tools (read + write + create/delete) | Jenkins administrators |
Read-only mode (safe sharing)
jenkins-mcp-server --mode read-only --url URL --username USER --token TOKENIn read-only mode, any attempt to call trigger_build, stop_build, create_job, etc. returns a clear error message explaining which mode is required.
Standard mode (default)
jenkins-mcp-server --url URL --username USER --token TOKENAllows triggering and stopping builds, but not creating, deleting, or configuring jobs.
Admin mode
jenkins-mcp-server --mode admin --url URL --username USER --token TOKENFull access including job creation, deletion, configuration changes, folder management, and build replay.
Configuration
Environment Variables
Variable | Description | Default |
| Jenkins server URL | (required) |
| Jenkins username | (required) |
| Jenkins API token | (required) |
|
|
|
| Access mode: |
|
Getting a Jenkins API Token
Log in to Jenkins in your browser
Click your username (top-right) → Configure
Scroll to API Token → Add new Token
Name it (e.g.,
cursor-mcp-server) → GenerateCopy immediately -- it's shown only once
Cursor IDE Integration
Global Configuration
Add to ~/.cursor/mcp.json (Linux/Mac) or %USERPROFILE%\.cursor\mcp.json (Windows):
Standard mode (default for developers)
{
"mcpServers": {
"jenkins": {
"command": "jenkins-mcp-server",
"args": [
"--url", "https://your-jenkins.example.com:8443",
"--username", "your-username",
"--token", "your-api-token",
"--no-verify-ssl"
],
"disabled": false,
"timeout": 60
}
}
}Read-only mode (safe for sharing with analysts)
{
"mcpServers": {
"jenkins": {
"command": "jenkins-mcp-server",
"args": [
"--url", "https://your-jenkins.example.com:8443",
"--username", "viewer-username",
"--token", "viewer-api-token",
"--no-verify-ssl",
"--mode", "read-only"
]
}
}
}Admin mode (Jenkins administrators)
{
"mcpServers": {
"jenkins": {
"command": "jenkins-mcp-server",
"args": [
"--url", "https://your-jenkins.example.com:8443",
"--username", "admin-username",
"--token", "admin-api-token",
"--no-verify-ssl",
"--mode", "admin"
]
}
}
}Using Environment Variables
{
"mcpServers": {
"jenkins": {
"command": "jenkins-mcp-server",
"args": ["--no-verify-ssl"],
"env": {
"JENKINS_URL": "https://your-jenkins.example.com:8443",
"JENKINS_USERNAME": "your-username",
"JENKINS_TOKEN": "your-api-token",
"JENKINS_MODE": "standard"
}
}
}
}Workspace-specific Configuration
Create .cursor/mcp.json in your project root with the same format above.
After configuration, restart Cursor or reload MCP servers (Cmd/Ctrl+Shift+P → "MCP: Reload Servers").
MCP Tools Reference
Jobs & Builds (read-only)
Tool | Description | Mode |
| List all jobs with status, URLs, and last build info | read-only |
| Get detailed job information including builds, health reports | read-only |
| Get build status, duration, result, and actions | read-only |
| Get console output with line pagination | read-only |
| Stream console output for live builds (byte offset) | read-only |
| Get test pass/fail counts, suites, and cases | read-only |
| Get code coverage report (requires coverage plugin) | read-only |
| Get parameters used for a build | read-only |
| List build artifacts | read-only |
| Get Pipeline stage breakdown with status and duration | read-only |
| Get raw XML configuration of a job | read-only |
Infrastructure (read-only)
Tool | Description | Mode |
| Get build queue information | read-only |
| Get details about a specific queue item | read-only |
| List all Jenkins nodes/agents with status | read-only |
| Get specific node details | read-only |
| List all configured views | read-only |
| Get view details including contained jobs | read-only |
| List credential IDs (values never exposed) | read-only |
| Get Jenkins version, executor count, mode | read-only |
| List installed plugins with versions | read-only |
Build Control (standard)
Tool | Description | Mode |
| Trigger a new build with optional parameters | standard |
| Stop a running build | standard |
Administration (admin)
Tool | Description | Mode |
| Create a job from XML config or built-in template | admin |
| Delete a job permanently | admin |
| Enable a disabled job | admin |
| Disable a job (prevents new builds) | admin |
| Copy an existing job to create a new one | admin |
| Update a job's XML configuration | admin |
| Create a folder for organizing jobs | admin |
| Replay a Pipeline build with optional modified script | admin |
Job Templates (used with create_job)
When using create_job without providing raw XML, you can use a built-in template:
Template | Description |
| Basic freestyle project with shell build step |
| Pipeline job with inline Groovy script |
| Pipeline job loading Jenkinsfile from Git SCM |
| Multibranch Pipeline scanning branches for Jenkinsfile |
CLI Reference
# --- Read commands ---
jenkins-mcp list-jobs # List all jobs
jenkins-mcp list-jobs -f simple # Simple format
jenkins-mcp list-jobs --folder MyFolder # Jobs in a folder
jenkins-mcp get-job MyJob # Job details
jenkins-mcp get-build --job MyJob --build 64 # Build info
jenkins-mcp get-console --job MyJob --build 64 --tail 50 # Console output
jenkins-mcp get-test-report --job MyJob --build 64 -s # Test summary
jenkins-mcp get-coverage --job MyJob --build 64 # Coverage report
jenkins-mcp get-stages --job MyJob --build 64 # Pipeline stages
jenkins-mcp get-config MyJob # Job XML config
jenkins-mcp system-info # Jenkins system info
jenkins-mcp list-plugins # Installed plugins
jenkins-mcp list-views # All views
jenkins-mcp list-credentials # Credential IDs
jenkins-mcp list-nodes # Nodes/agents
jenkins-mcp get-queue # Build queue
# --- Build control ---
jenkins-mcp trigger-build MyJob # Trigger build
jenkins-mcp trigger-build MyJob -p '{"BRANCH":"main"}' # With parameters
jenkins-mcp stop-build --job MyJob --build 123 # Stop build
# --- Admin commands ---
jenkins-mcp create-job NewJob --template pipeline --script 'pipeline { agent any { stages { stage("Build") { steps { echo "hi" } } } } }'
jenkins-mcp create-job NewJob --config-file config.xml # From XML file
jenkins-mcp create-job NewJob --template pipeline-scm --repo-url https://github.com/user/repo.git
jenkins-mcp delete-job OldJob -y # Delete (skip confirm)
jenkins-mcp enable-job MyJob # Enable
jenkins-mcp disable-job MyJob # Disable
jenkins-mcp copy-job SourceJob NewCopy # Copy job
jenkins-mcp update-config MyJob new-config.xml # Update config
jenkins-mcp create-folder MyFolder # Create folder
jenkins-mcp replay-build --job MyJob --build 64 # Replay pipelineExample Prompts for Cursor
Once configured, you can ask Cursor things like:
Monitoring:
"List all Jenkins jobs and their status"
"Show me the pipeline stages for MyJob build 64"
"What plugins are installed on Jenkins?"
"Get the system info for our Jenkins instance"
Debugging:
"Get the test report for MyJob build 64 -- what failed?"
"Show me the last 100 lines of console output for MyJob build 64"
"What parameters were used for build 64?"
"Get the coverage report for the latest build"
Build control:
"Trigger a new build for MyJob with BRANCH=feature-x"
"Stop build 123 of MyJob"
Administration (admin mode):
"Create a new pipeline job called 'deploy-staging' with this Groovy script: ..."
"Copy the 'nightly-tests' job to 'nightly-tests-v2'"
"Disable the 'old-job' job"
"Create a folder called 'team-alpha' for organizing jobs"
Python API
from jenkins_mcp_server import JenkinsClient
client = JenkinsClient(
url="https://your-jenkins.example.com:8443",
username="your-username",
token="your-api-token",
verify_ssl=False,
)
# List jobs
jobs = client.list_jobs()
for job in jobs:
print(f"{job['name']}: {job.get('color', 'unknown')}")
# Build info
build = client.get_build_info("MyJob", 64)
print(f"Result: {build.get('result')}, Duration: {build.get('duration')}ms")
# Pipeline stages
stages = client.get_pipeline_stages("MyPipeline", 10)
for stage in stages.get('stages', []):
print(f" {stage['name']}: {stage['status']}")
# System info
info = client.get_system_info()
print(f"Jenkins {info['version']}, {info['numExecutors']} executors")
# Trigger a build
result = client.trigger_build("MyJob", {"BRANCH": "main"})
print(f"Queued: {result['queue_url']}")
# Create a job from template
from jenkins_mcp_server.client import render_job_template
config = render_job_template("pipeline", script="pipeline { agent any { stages { stage('Build') { steps { echo 'hello' } } } } }")
client.create_job("my-new-pipeline", config)Troubleshooting
MCP Server Not Loading in Cursor
Verify installation:
pip show jenkins-mcp-toolsTest connection:
jenkins-mcp-server --test --url URL --username USER --token TOKEN --no-verify-sslCheck Cursor's Output panel for MCP errors
Restart Cursor after changing
mcp.json
SSL Certificate Errors
Use --no-verify-ssl flag or set JENKINS_VERIFY_SSL=false.
Authentication Errors (401)
Verify username and token are correct
Ensure the API token hasn't been revoked
Check if your account has API access permissions
Regenerate the token from Jenkins (User → Configure → API Token)
Mode-related Errors
If you see "Tool 'X' requires 'admin' mode but server is running in 'standard' mode":
Restart the server with
--mode adminto enable admin toolsOr set
JENKINS_MODE=adminin your environment / Cursor config
Connection Timeouts
Ensure VPN is connected (if required)
Test:
curl -I https://your-jenkins.example.com:8443
Changelog
v2.0.0
Access modes:
read-only,standard,adminwith--modeflag andJENKINS_MODEenv var15 new MCP tools: pipeline stages, job config, credentials, views, system info, plugins, job CRUD, folder management, build replay
Job templates: Create freestyle, pipeline, pipeline-scm, and multibranch jobs from built-in templates
CLI expansion: New commands for all new tools
Sharing guide: Documentation for distributing to teammates
v1.0.0
Initial release with 12 MCP tools
CLI tool with subcommands
Cursor IDE integration
Contributing
Clone the repository
Install dev dependencies:
pip install -e ".[dev]"Run tests:
pytest tests/Create a feature branch and merge request
License
MIT License - See LICENSE file for details.
Support
For issues or questions, open an issue on the repository.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/saurprince/jenkins-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server