Skip to main content

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
  • Retrieve logs and run targeted log-search tools
  • Discover downstream and sub-build hierarchies
  • Diagnose build failures with configurable recommendations
  • Route each tool call to the correct Jenkins instance based on jenkins_url
  • Expose semantic_search only when vector search 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.yml
    • JENKINS_MCP_DIAGNOSTIC_CONFIG=/path/to/file.yml
    • config/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.

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_search is available only when vector search is enabled.
  • diagnose_build_failure always uses a diagnostic config layer. If you do not provide a project-local override, the bundled defaults are used.
  • The Docker image includes ripgrep, so ripgrep_search and navigate_log work 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
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
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
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

Configuration Documentation

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jenkins_mcp_enterprise-1.0.2.tar.gz (135.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jenkins_mcp_enterprise-1.0.2-py3-none-any.whl (132.1 kB view details)

Uploaded Python 3

File details

Details for the file jenkins_mcp_enterprise-1.0.2.tar.gz.

File metadata

  • Download URL: jenkins_mcp_enterprise-1.0.2.tar.gz
  • Upload date:
  • Size: 135.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for jenkins_mcp_enterprise-1.0.2.tar.gz
Algorithm Hash digest
SHA256 fe99239cbe564a365c11f3a8bc3f468e7cf2ed6fe077a2667c5ebc1b0c6f65fb
MD5 8a6f01da5a65a071c6c3f48de1e0bccc
BLAKE2b-256 b6404cd8f8154b5775f9aaa79ea2adf90ff40c627e061cecf3fae0d3c1044790

See more details on using hashes here.

Provenance

The following attestation bundles were made for jenkins_mcp_enterprise-1.0.2.tar.gz:

Publisher: publish.yml on Jordan-Jarvis/jenkins-mcp-enterprise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jenkins_mcp_enterprise-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jenkins_mcp_enterprise-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8b0f27a457e41fadef13da4a8f162fcdce153c40484d8ca5d40fbe4beb5a0716
MD5 c07d02d3f792b303d4a486aaa90adcde
BLAKE2b-256 2de27ed105be63275a70e5182a4a5cce128594518b40c6c719e3751b8fc8ad41

See more details on using hashes here.

Provenance

The following attestation bundles were made for jenkins_mcp_enterprise-1.0.2-py3-none-any.whl:

Publisher: publish.yml on Jordan-Jarvis/jenkins-mcp-enterprise

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page