MCP server for Jenkins integration with AI assistants, providing build management, log analysis, and failure diagnostics.
Project description
Jenkins MCP Server Enterprise
Jenkins MCP server for multi-instance routing, build diagnostics, and optional vector search.
A Model Context Protocol (MCP) server for Jenkins that provides build management, log inspection, failure diagnostics, and multi-instance configuration. The maintained setup paths in this repository are source install and Docker/Compose.
What It Does
- Trigger builds synchronously or asynchronously
- Find jobs before triggering or inspecting them
- Inspect job definitions and source locations
- Retrieve logs and run targeted log-search tools
- Discover downstream and sub-build hierarchies
- Inspect recent builds or a window around a specific build
- Diagnose build failures with configurable recommendations
- Route each tool call to the correct Jenkins instance based on
jenkins_url - Expose
semantic_searchonly when vector search is enabled - Expose
apply_job_editonly when server-side job editing is enabled
Quick Start
Prerequisites
- Python 3.10+
- Jenkins API access
- Jenkins username and API token
- Docker and Docker Compose if you want container deployment
- Qdrant if you want
semantic_search
Install from Source
git clone https://github.com/Jordan-Jarvis/jenkins-mcp-enterprise
cd jenkins-mcp-enterprise
python3 -m pip install -e .
Understand the Two Config Layers
The server uses two configuration layers:
- Primary server config:
config/mcp-config.yml - Diagnostic config: loaded from one of:
--diagnostic-config /path/to/file.ymlJENKINS_MCP_DIAGNOSTIC_CONFIG=/path/to/file.ymlconfig/diagnostic-parameters.yml- bundled defaults in
jenkins_mcp_enterprise/diagnostic_config/diagnostic-parameters.yml
You always need the primary server config. You only need a project-local diagnostic config file if you want to override the bundled diagnostic defaults.
Create the Primary Server Config
mkdir -p config
cp config/mcp-config.example.yml config/mcp-config.yml
Edit config/mcp-config.yml with your Jenkins URLs and credentials.
If you want the optional Jenkins-managed job edit workflow for non-SCM-backed jobs, also set:
settings:
enable_job_editing: true
job_edit_workspace_dir: "/tmp/mcp-jenkins/job-definitions"
Optional Project-Local Diagnostic Override
Create this only if you want to tune diagnose_build_failure:
cat > config/diagnostic-parameters.yml << 'ENDDIAG'
semantic_search:
min_diagnostic_score: 0.65
max_total_highlights: 4
recommendations:
max_recommendations: 5
ENDDIAG
If you want semantic search, start the local vector stack and set disable_vector_search: false with vector.host: "http://localhost:6333":
./scripts/start_dev_environment.sh
Docker and Compose
cp config/mcp-config.example.yml config/mcp-config.yml
./start-jenkins_mcp_enterprise.sh
See README-Docker.md for the container deployment flow.
Start the Server
jenkins_mcp_enterprise --config config/mcp-config.yml
Connect to Claude Desktop
Add to ~/.claude_desktop_config.json:
{
"mcpServers": {
"jenkins": {
"command": "jenkins_mcp_enterprise",
"args": ["--config", "config/mcp-config.yml"]
}
}
}
Usage Notes
- Pass full Jenkins build URLs when a tool or prompt relies on
jenkins_url. - In multi-Jenkins setups, each tool call resolves exactly one configured instance from
jenkins_url. The server does not fan out across all configured Jenkins instances for a single call. semantic_searchis available only when vector search is enabled.apply_job_editis available only whensettings.enable_job_editing: true.get_job_definitionreturns SCM location details for SCM-backed pipelines. For inline pipelines, it stages a local Groovy file for patch/edit/upload. For other Jenkins-managed jobs, it stagesconfig.xml.diagnose_build_failurealways uses a diagnostic config layer. If you do not provide a project-local override, the bundled defaults are used.- The Docker image includes
ripgrep, soripgrep_searchandnavigate_logwork in container deployments.
Common Usage Patterns
Analyze this failed build: https://jenkins.company.com/job/api-service/456/
Find the root cause in this nested pipeline: https://jenkins.company.com/job/monorepo/job/main/789/
Show me the test failure section from this build: https://jenkins.company.com/job/tests/321/
Find similar authentication failures in recent builds
Available Tools
| Tool | Purpose |
|---|---|
trigger_build |
Start a build and wait for completion |
trigger_build_async |
Queue a build without waiting for completion |
trigger_build_with_subs |
Trigger a build and track downstream/sub-build execution |
get_jenkins_job_parameters |
Inspect job parameters before triggering builds |
find_jobs |
Search jobs by name, path, or URL on one resolved Jenkins instance |
list_job_builds |
List recent builds for a job, or a small window around a target build number |
get_build_info |
Fetch metadata for a specific build or lastBuild |
get_job_definition |
Inspect whether a job is SCM-backed, inline, multibranch, or XML-backed |
ripgrep_search |
Search logs with regex and context windows |
filter_errors_grep |
Filter logs with common error-oriented patterns |
navigate_log |
Jump to sections or occurrences inside a log |
get_log_context |
Fetch targeted log ranges or chunks |
diagnose_build_failure |
AI-assisted failure diagnosis using logs, hierarchy data, and configured recommendations |
semantic_search |
Vector-backed similarity search across log chunks when vector search is enabled |
apply_job_edit |
Upload a locally edited staged job definition back to Jenkins when job editing is enabled |
Configuration Documentation
- Configuration Guide
- Diagnostic Config Overview
- Diagnostic Parameters Guide
- Diagnostic Parameters Quick Reference
Development
# Start local supporting services when vector search is enabled
./scripts/start_dev_environment.sh
# Run tests
python3 -m pytest tests/ -v
# Format code
python3 -m black .
License
GPL v3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jenkins_mcp_enterprise-1.0.3.tar.gz.
File metadata
- Download URL: jenkins_mcp_enterprise-1.0.3.tar.gz
- Upload date:
- Size: 121.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4992d56a19d8425e145bae5b5defb5159cc5a1bacbf9631ccde356362d5b9c0
|
|
| MD5 |
c655b2930d11bb456eb97b57d1cd05f0
|
|
| BLAKE2b-256 |
502367674db15eb81cc02bd45e9f9710ee5026413189696af9f25a685e44419f
|
Provenance
The following attestation bundles were made for jenkins_mcp_enterprise-1.0.3.tar.gz:
Publisher:
publish.yml on Jordan-Jarvis/jenkins-mcp-enterprise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jenkins_mcp_enterprise-1.0.3.tar.gz -
Subject digest:
f4992d56a19d8425e145bae5b5defb5159cc5a1bacbf9631ccde356362d5b9c0 - Sigstore transparency entry: 1429969535
- Sigstore integration time:
-
Permalink:
Jordan-Jarvis/jenkins-mcp-enterprise@f645ea679335508bf146c71bf47313a7032ccd96 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/Jordan-Jarvis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f645ea679335508bf146c71bf47313a7032ccd96 -
Trigger Event:
release
-
Statement type:
File details
Details for the file jenkins_mcp_enterprise-1.0.3-py3-none-any.whl.
File metadata
- Download URL: jenkins_mcp_enterprise-1.0.3-py3-none-any.whl
- Upload date:
- Size: 130.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
492391a8d24d3a35535b82bc487e73d83dab8a3fb16c640740fba0f80061dbfc
|
|
| MD5 |
2322852e8ff5105ac7f207e23e1fc144
|
|
| BLAKE2b-256 |
00a3202c0e3cee719fc7feca0c3f25e93e0137be53ef84c6ba29166954a1843d
|
Provenance
The following attestation bundles were made for jenkins_mcp_enterprise-1.0.3-py3-none-any.whl:
Publisher:
publish.yml on Jordan-Jarvis/jenkins-mcp-enterprise
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
jenkins_mcp_enterprise-1.0.3-py3-none-any.whl -
Subject digest:
492391a8d24d3a35535b82bc487e73d83dab8a3fb16c640740fba0f80061dbfc - Sigstore transparency entry: 1429969540
- Sigstore integration time:
-
Permalink:
Jordan-Jarvis/jenkins-mcp-enterprise@f645ea679335508bf146c71bf47313a7032ccd96 -
Branch / Tag:
refs/tags/v1.0.3 - Owner: https://github.com/Jordan-Jarvis
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f645ea679335508bf146c71bf47313a7032ccd96 -
Trigger Event:
release
-
Statement type: