MCP Jenkins Intelligence

AI-powered Jenkins pipeline intelligence platform with natural language interface. Provides comprehensive pipeline analysis, failure prediction, optimization suggestions, and automated Jenkinsfile reconstruction using Model Context Protocol (MCP) integration.

MCP Jenkins Intelligence

License Python FastMCP Jenkins MCP Stars Issues

PRs Welcome

The Jenkins Intelligence Platform
Transform your Jenkins operations with AI-powered natural language interfaces and comprehensive pipeline analysis.

πŸš€ Quick Start (Binary Distribution)

Prefer a ready-to-use binary? Download the latest release and start using MCP Jenkins Intelligence in seconds!

πŸ“¦ Download & Install

# Option 1: Use the installer script (recommended)
curl -fsSL https://raw.githubusercontent.com/heniv96/mcp-jenkins-intelligence/main/install.sh | bash

# Option 2: Manual download
# Download from: https://github.com/heniv96/mcp-jenkins-intelligence/releases/latest
# Choose the appropriate binary for your platform:
# - mcp-jenkins-server-macos-arm64 (macOS Apple Silicon)
# - mcp-jenkins-server-linux-amd64 (Linux AMD64)
# Make executable: chmod +x mcp-jenkins-server-<platform>

⚑ MCP Configuration

Add to your MCP client configuration (Cursor/VSCode):

{
  "mcpServers": {
    "mcp-jenkins-intelligence": {
      "command": "/path/to/mcp-jenkins-server",
      "args": [],
      "env": {
        "JENKINS_URL": "https://your-jenkins-url",
        "JENKINS_USERNAME": "your-username", 
        "JENKINS_TOKEN": "your-token"
      }
    }
  }
}

That's it! No Python installation, no dependencies - just download and run! πŸŽ‰


Overview

MCP Jenkins Intelligence is a comprehensive Model Context Protocol (MCP) solution designed for professional DevOps teams. It provides natural language interfaces for complex Jenkins pipeline operations, enabling teams to monitor, analyze, and optimize their CI/CD workflows through AI-powered conversations in VSCode and Cursor.

✨ Key Features

Intelligent Pipeline Analysis

  • Real-time Monitoring: Live pipeline status, health metrics, and performance analytics
  • AI-Powered Insights: Natural language queries for complex pipeline analysis
  • Failure Analysis: Deep dive into pipeline failures with intelligent root cause analysis
  • Performance Optimization: Automated suggestions for improving build times and success rates
  • Advanced Analytics: Comprehensive reporting and performance comparisons
  • Anomaly Detection: AI-powered detection of unusual pipeline behavior patterns

Advanced AI Capabilities

  • Natural Language Processing: Conversational interface for complex DevOps operations
  • Smart Diagnostics: AI-driven pipeline health analysis and troubleshooting guidance
  • Context-Aware Prompts: Intelligent prompt suggestions for different analysis scenarios
  • Automated Reporting: Proactive identification of issues and optimization opportunities

Enterprise Security & Compliance

  • Multi-Authentication Support: Standard Jenkins and Azure AD integration
  • Secure Communication: TLS encryption for all Jenkins API communications
  • Audit Logging: Comprehensive audit trails for all pipeline operations
  • Minimal Privilege: Secure by design with least privilege access patterns
  • Enterprise-Grade Data Protection: 19+ protection patterns for complete data anonymization
  • Complete Anonymization: Pipeline names, cluster names, folder names, app names, branch names, organization names, repository names, and code file names are all protected
  • Hash-based Security: Sensitive data is replaced with secure hashes before AI communication
  • Local Execution: All data processing happens locally - no data leaves your environment
  • Recursive Protection: Works on nested data structures and complex objects
  • Access Control Auditing: Comprehensive permission and access control analysis

Advanced Analytics & Reporting

  • Comprehensive Reports: Generate detailed reports with metrics and insights
  • Performance Comparisons: Compare pipeline performance across teams and environments
  • Trend Analysis: Long-term performance and reliability trend analysis

Advanced AI Features

  • Anomaly Detection: AI-powered detection of unusual pipeline behavior patterns
  • Comprehensive Insights: AI-generated insights and recommendations

Performance Optimization

  • Build Time Analysis: Detailed analysis and optimization suggestions for build times

Deployment & Distribution

  • Multiple Deployment Options: Development setup or production deployment
  • Cross-Platform Support: Works on macOS, Linux, and Windows
  • Easy Configuration: Simple setup with environment variables or MCP config

πŸ—οΈ Architecture

MCP Protocol Integration

The following diagram shows how MCP Jenkins Intelligence integrates with VSCode and Cursor AI through the Model Context Protocol:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ VSCode/     │───▢│ MCP Protocol │───▢│ Jenkins         β”‚
β”‚ Cursor AI   β”‚    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β”‚ Intelligence    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                        β”‚    Server       β”‚
                                       β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                                                 β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                            β”‚                            β”‚
            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
            β”‚ Jenkins       β”‚            β”‚ AI Analysis   β”‚            β”‚ Pipeline      β”‚
            β”‚ API           β”‚            β”‚ Engine        β”‚            β”‚ Resources     β”‚
            β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”˜
                    β”‚                            β”‚                            β”‚  
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β”‚                            β”‚                            β”‚
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”            β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ Core Tools    β”‚            β”‚ Analysis      β”‚            β”‚ MCP Resources β”‚
                 β”‚ (30 tools)    β”‚            β”‚ Tools         β”‚            β”‚ & Prompts     β”‚
                 β”‚               β”‚            β”‚               β”‚            β”‚               β”‚
                 β”‚ β€’ List        β”‚            β”‚ β€’ Health      β”‚            β”‚ β€’ Status      β”‚
                 β”‚ β€’ Details     β”‚            β”‚   Analysis    β”‚            β”‚   Resource    β”‚
                 β”‚ β€’ Builds      β”‚            β”‚ β€’ Failure     β”‚            β”‚ β€’ Summary     β”‚
                 β”‚ β€’ Configure   β”‚            β”‚   Analysis    β”‚            β”‚   Resource    β”‚
                 β”‚ β€’ Test        β”‚            β”‚ β€’ AI Queries  β”‚            β”‚ β€’ Dashboard   β”‚
                 β”‚ β€’ Questions   β”‚            β”‚ β€’ Metrics     β”‚            β”‚   Resource    β”‚
                 β”‚ β€’ Trigger     β”‚            β”‚ β€’ Dependenciesβ”‚            β”‚ β€’ Logs        β”‚
                 β”‚ β€’ Stop        β”‚            β”‚ β€’ Trends      β”‚            β”‚   Resource    β”‚
                 β”‚ β€’ Enable/Dis  β”‚            β”‚ β€’ Security    β”‚            β”‚ β€’ Health      β”‚
                 β”‚ β€’ Config      β”‚            β”‚ β€’ Export      β”‚            β”‚   Resource    β”‚
                 β”‚ β€’ Predict     β”‚            β”‚ β€’ Optimize    β”‚            β”‚ β€’ Analysis    β”‚
                 β”‚ β€’ Suggest     β”‚            β”‚               β”‚            β”‚   Prompts     β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜            β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Modular Architecture

The internal architecture follows a clean, modular design with separation of concerns:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                              MCP Layer                                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  FastMCP Server  ──▢  Tool Registry  ──▢  Request Router                    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                           Modular Services                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”        β”‚
β”‚  β”‚   Models    β”‚  β”‚  Services   β”‚  β”‚  Resources  β”‚  β”‚   Prompts   β”‚        β”‚
β”‚  β”‚             β”‚  β”‚             β”‚  β”‚             β”‚  β”‚             β”‚        β”‚
β”‚  β”‚ β€’ Pipeline  β”‚  β”‚ β€’ Jenkins   β”‚  β”‚ β€’ Status    β”‚  β”‚ β€’ Analysis  β”‚        β”‚
β”‚  β”‚ β€’ Build     β”‚  β”‚ β€’ Core      β”‚  β”‚ β€’ Summary   β”‚  β”‚ β€’ Failure   β”‚        β”‚
β”‚  β”‚ β€’ Health    β”‚  β”‚ β€’ Control   β”‚  β”‚ β€’ Dashboard β”‚  β”‚ β€’ Optimize  β”‚        β”‚
β”‚  β”‚ β€’ Failure   β”‚  β”‚ β€’ Monitor   β”‚  β”‚ β€’ Logs      β”‚  β”‚ β€’ Security  β”‚        β”‚
β”‚  β”‚ β€’ Query     β”‚  β”‚ β€’ AI        β”‚  β”‚ β€’ Health    β”‚  β”‚             β”‚        β”‚
β”‚  β”‚             β”‚  β”‚ β€’ Security  β”‚  β”‚             β”‚  β”‚             β”‚        β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Tool Categories                                     β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Core Tools (9)     β”‚  Control Tools (4)   β”‚  Monitoring (4)  β”‚  AI Tools (5)β”‚
β”‚  ─────────────      β”‚  ─────────────       β”‚  ─────────────   β”‚  ─────────  β”‚
β”‚  β€’ list_pipelines   β”‚  β€’ trigger_build     β”‚  β€’ get_metrics   β”‚ β€’ Predict   β”‚
β”‚  β€’ get_details      β”‚  β€’ stop_build        β”‚  β€’ dependencies  β”‚   Failure   β”‚
β”‚  β€’ get_builds       β”‚  β€’ enable_disable    β”‚  β€’ monitor_queue β”‚ β€’ Suggest   β”‚
β”‚  β€’ ask_questions    β”‚  β€’ get_config        β”‚  β€’ analyze_trendsβ”‚   Optimize  β”‚
β”‚  β€’ configure_jenkinsβ”‚                      β”‚                  β”‚ β€’ Anomaly   β”‚
β”‚  β€’ test_connection  β”‚                      β”‚                  β”‚   Detection β”‚
β”‚  β€’ analyze_health   β”‚                      β”‚                  β”‚ β€’ AI        β”‚
β”‚  β€’ analyze_failure  β”‚                      β”‚                  β”‚   Insights  β”‚
β”‚  β€’ get_server_info  β”‚                      β”‚                  β”‚ β€’ Retry     β”‚
β”‚                     β”‚                      β”‚                  β”‚   Logic     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Additional Tool Categories                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Security (2)    β”‚  Jenkinsfile (3)  β”‚  Analytics (2)  β”‚  Performance (1) β”‚
β”‚  ───────────     β”‚  ─────────────    β”‚  ───────────    β”‚  ─────────────   β”‚
β”‚  β€’ scan_security β”‚  β€’ get_jenkinsfileβ”‚  β€’ generate_    β”‚  β€’ analyze_      β”‚
β”‚                  β”‚  β€’ reconstruct    β”‚    report       β”‚    build_time    β”‚
β”‚                  β”‚  β€’ suggest_       β”‚  β€’ compare_     β”‚                  β”‚
β”‚                  β”‚    improvements   β”‚    performance  β”‚                  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    MCP Resources & Prompts                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Resources (5)        β”‚  Prompts (4)                                        β”‚
β”‚  ─────────────        β”‚  ───────────                                        β”‚
β”‚  β€’ pipeline://status  β”‚  β€’ analyze_pipeline_prompt                          β”‚
β”‚  β€’ pipeline://{name}/ β”‚  β€’ failure_analysis_prompt                          β”‚
β”‚    summary            β”‚  β€’ optimization_prompt                              β”‚
β”‚  β€’ pipeline://dashboardβ”‚  β€’ security_audit_prompt                           β”‚
β”‚  β€’ pipeline://{name}/ β”‚                                                     β”‚
β”‚    logs               β”‚                                                     β”‚
β”‚  β€’ pipeline://health  β”‚                                                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Directory Structure

mcp-jenkins-intelligence/
β”œβ”€β”€ server.py                 # Main MCP server (679 lines)
β”œβ”€β”€ models/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── pipeline.py          # Pydantic models
β”œβ”€β”€ services/
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ jenkins_service.py   # Jenkins API wrapper
β”‚   β”œβ”€β”€ core_tools.py        # Core pipeline tools
β”‚   β”œβ”€β”€ monitoring_tools.py  # Monitoring & analytics
β”‚   β”œβ”€β”€ ai_tools.py          # AI intelligence tools
β”‚   β”œβ”€β”€ security_tools.py    # Security & compliance
β”‚   β”œβ”€β”€ advanced_ai_tools.py # Advanced AI features
β”‚   β”œβ”€β”€ advanced_security_tools.py # Advanced security tools
β”‚   β”œβ”€β”€ analytics_tools.py   # Analytics & reporting
β”‚   β”œβ”€β”€ performance_tools.py # Performance optimization
β”‚   β”œβ”€β”€ execution_analysis_service.py # Execution analysis
β”‚   └── jenkinsfile_retrieval_service.py # Jenkinsfile management
β”œβ”€β”€ resources/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── pipeline_resources.py # MCP resources
β”œβ”€β”€ prompts/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── pipeline_prompts.py  # MCP prompts
β”œβ”€β”€ config/
β”‚   └── settings.py          # Configuration management
β”œβ”€β”€ utils/
β”‚   β”œβ”€β”€ __init__.py
β”‚   └── helpers.py           # Helper functions
β”œβ”€β”€ manuals/
β”‚   β”œβ”€β”€ configuration/
β”‚   β”‚   └── README.md        # Configuration guide
β”‚   β”œβ”€β”€ examples/
β”‚   β”‚   └── mcp-config-standalone.json # Example configuration
β”‚   β”œβ”€β”€ quick-start/
β”‚   β”‚   └── README.md        # Quick start guide
β”‚   └── troubleshooting/
β”‚       └── README.md        # Troubleshooting guide
β”œβ”€β”€ dist/                    # Built binaries (GitHub Releases)
β”‚   β”œβ”€β”€ mcp-jenkins-server-macos-arm64    # macOS Apple Silicon binary
β”‚   └── mcp-jenkins-server-linux-amd64    # Linux AMD64 binary
β”œβ”€β”€ install.sh               # Automated installer script
β”œβ”€β”€ Makefile                 # Build automation
β”œβ”€β”€ build.sh                 # Build test script
β”œβ”€β”€ requirements.txt         # Python dependencies
β”œβ”€β”€ pyproject.toml          # Project configuration
β”œβ”€β”€ LICENSE                 # MIT License
└── README.md              # This file

Architecture Benefits

πŸ—οΈ Modular Design

  • Single Responsibility: Each module has one clear purpose
  • Easy Navigation: Find specific functionality quickly
  • Reduced Complexity: Each file is focused and manageable
  • Team Collaboration: Multiple developers can work on different modules

πŸ“ˆ Scalability

  • Easy Extension: Add new tools by creating new service classes
  • Modular Testing: Test individual components in isolation
  • Performance: Lazy loading and efficient resource management

πŸ”§ Maintainability

  • Clean Code: Well-organized, documented, and type-safe
  • No Linting Errors: Follows Python best practices
  • Version Control: Easier to track changes and manage conflicts
  • Debugging: Easier to isolate and fix issues

πŸ“Š Code Quality Metrics

  • Main Server: 679 lines with clean modular architecture
  • Total Codebase: ~5,000+ lines across all Python files
  • Maintainability Index: Significantly improved with modular design
  • Cyclomatic Complexity: Reduced per module through separation of concerns
  • Binary Distribution: Self-contained executables (~73MB each)
  • Multi-Platform Support: macOS ARM64 and Linux AMD64

πŸ› οΈ Available Tools

Core Pipeline Management Tools (9 Total)

CategoryToolsDescription
Core Pipeline Operations (5)list_pipelines, get_pipeline_details, get_pipeline_builds, analyze_pipeline_health, analyze_pipeline_failureDirect Jenkins API operations, monitoring, and analysis
AI-Powered Analysis (1)ask_pipeline_questionNatural language queries and intelligent insights
Configuration Management (3)configure_jenkins, test_connection, get_server_infoJenkins connection setup, validation, and server information

βœ… Safety Note: All tools are read-only or analysis-only operations that cannot modify Jenkins state. This ensures safe operation without risk of accidentally triggering builds or changing pipeline configurations.

Monitoring & Analysis Tools (4 Total)

ToolDescription
get_pipeline_metricsGet detailed metrics (success rate, duration, frequency)
get_pipeline_dependenciesGet upstream/downstream pipeline dependencies
monitor_pipeline_queueMonitor Jenkins build queue and pending builds
analyze_build_trendsAnalyze trends across multiple pipelines

AI Intelligence Tools (5 Total)

ToolDescription
predict_pipeline_failureAI prediction of failure risk based on patterns
suggest_pipeline_optimizationAI suggestions for performance optimization
detect_pipeline_anomaliesDetect unusual patterns and anomalies in pipeline behavior using ML
intelligent_retry_logicAnalyze failure patterns and suggest intelligent retry logic using ML
generate_ai_insightsGenerate comprehensive AI-powered insights about the pipeline using real data analysis

Security Tools (2 Total)

ToolDescription
scan_pipeline_securitySecurity vulnerability scan and best practices check
audit_access_controlsAudit pipeline access controls and permissions using Jenkins security API

Jenkinsfile Tools (3 Total)

ToolDescription
get_jenkinsfileGet Jenkinsfile (automatically reconstructs if stored in Git)
reconstruct_jenkinsfileReconstruct Jenkinsfile content from pipeline execution data
suggest_pipeline_improvementsGet improvement suggestions based on reconstructed Jenkinsfile

Advanced Analytics & Reporting Tools (2 Total)

ToolDescription
generate_pipeline_reportGenerate comprehensive pipeline report based on Jenkins build history
compare_pipeline_performanceCompare performance across multiple pipelines based on Jenkins build history

Performance Optimization Tools (1 Total)

ToolDescription
analyze_build_time_optimizationAnalyze build time optimization opportunities using Jenkins data

πŸ” Automatic Jenkinsfile Reconstruction

The MCP server now automatically detects when a Jenkinsfile is stored in a Git repository (not directly accessible through Jenkins API) and seamlessly reconstructs it:

  • Smart Detection: Automatically identifies Git-based pipelines
  • Seamless Experience: When you ask "Show me the Jenkinsfile", it automatically reconstructs it
  • No Manual Steps: No need to manually call reconstruction tools
  • Rich Metadata: Includes pipeline analysis and reconstruction details

πŸ’‘ Smart Improvement Suggestions

Based on reconstructed Jenkinsfile content, the system provides intelligent suggestions:

  • Performance Optimizations: Parallel execution, timeout controls, retry logic
  • Security Enhancements: Credential handling, access controls
  • Reliability Improvements: Error handling, conditional execution
  • Best Practices: Jenkins pipeline best practices and patterns

MCP Resources (5 Total)

ResourceDescription
pipeline://statusGet overall system status and health summary
pipeline://{pipeline_name}/summaryGet comprehensive pipeline summary with recent builds
pipeline://dashboardGet comprehensive dashboard view of all pipelines
pipeline://{pipeline_name}/logs/{build_number}Get build logs for a specific pipeline build
pipeline://healthGet overall system health and alerts

MCP Prompts (4 Total)

PromptDescription
analyze_pipeline_promptGenerate prompts for comprehensive pipeline analysis
failure_analysis_promptGenerate prompts for failure analysis
optimization_promptGenerate prompts for pipeline optimization analysis
security_audit_promptGenerate prompts for security audit analysis

⚠️ Safety Features

Pipeline Control Safety

All pipeline control operations require explicit confirmation to prevent accidental changes:

  • trigger_pipeline_build: Shows detailed impact explanation before execution
  • stop_pipeline_build: Warns about potential system inconsistencies
  • enable_disable_pipeline: Explains what will be affected by the change

Safety Confirmation Example

# First call - shows safety warning
trigger_pipeline_build(pipeline_name="production-deploy", parameters={"env": "prod"})

# Response:
# ⚠️  SAFETY CHECK REQUIRED ⚠️
# 
# You are about to trigger a new build for pipeline 'production-deploy' with parameters: {'env': 'prod'}.
# 
# This will:
# - Start a new build immediately
# - Consume Jenkins resources
# - May trigger downstream pipelines
# - Could affect production systems
# 
# To proceed, call this tool again with confirm=True

# Second call - executes the action
trigger_pipeline_build(pipeline_name="production-deploy", parameters={"env": "prod"}, confirm=True)

πŸš€ Quick Start

For detailed installation and setup instructions, see the Quick Start Guide.

TL;DR:

git clone https://github.com/heniv96/mcp-jenkins-intelligence.git
cd mcp-jenkins-intelligence
pip install -r requirements.txt
pip install -e .
# Configure Jenkins credentials and MCP settings
# See manuals/quick-start/README.md for details

πŸ“‹ Natural Language Examples

Pipeline Monitoring

"Show me all my Jenkins pipelines and their current status"
"List all failed pipelines from the last week"
"Get the health status of my production deployment pipeline"
"Show me recent builds for the frontend pipeline"

Performance Analysis

"What's the average build time for the backend pipeline?"
"Which pipelines are taking the longest to complete?"
"Show me the success rate of my CI/CD pipelines"
"Compare the performance of dev vs prod pipelines"

Failure Analysis

"Why did the deployment pipeline fail yesterday?"
"Analyze the failure in the frontend pipeline build #456"
"What are the most common failure patterns in my pipelines?"
"Help me troubleshoot the stuck build in the database pipeline"

AI-Powered Insights

"Suggest improvements for my CI/CD pipeline"
"Generate a performance report for the last month"
"What security issues exist in my pipeline configurations?"
"Which pipelines need immediate attention?"
"Predict which pipelines are likely to fail"
"Optimize my production deployment pipeline"

Pipeline Control & Management

"Trigger a new build for the frontend pipeline"
"Stop the running build #123 for the backend pipeline"
"Disable the test pipeline temporarily"
"Get the configuration for the production pipeline"
"Show me the dependencies for the deployment pipeline"

Advanced Analytics & Monitoring

"Get detailed metrics for my production pipeline"
"Analyze build trends across all my pipelines"
"Monitor the Jenkins build queue"
"Export pipeline data in CSV format"
"Scan the security of my deployment pipeline"

Dashboard & Health Monitoring

"Show me the pipeline dashboard"
"Get the overall system health"
"Check the logs for build #456 of the API pipeline"
"Generate a comprehensive pipeline report"

πŸ”§ Configuration

For detailed configuration options, see the Configuration Guide.

Quick Reference:

  • Authentication: Standard Jenkins or Azure AD
  • Environment Variables: JENKINS_URL, JENKINS_USERNAME, JENKINS_TOKEN
  • Port Configuration: Customizable MCP server port
  • Command Line Options: --transport, --port, --verbose

πŸ”§ Troubleshooting

For detailed troubleshooting steps, see the Troubleshooting Guide.

Common Issues:

  • 401 Unauthorized: Check credentials and Object ID (Azure AD)
  • Connection Issues: Verify network connectivity and SSL settings
  • Tool Not Found: Ensure all dependencies are installed

🀝 Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Development Commands

# Install development dependencies
pip install -e ".[dev]"

# Run tests
python -m pytest

# Format code
black .

# Run linter
flake8 .

# Type checking
mypy .

Code Style

  • Follow PEP 8 Python formatting
  • Use meaningful variable and function names
  • Add type hints for all functions
  • Include docstrings for public functions

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

  • Model Context Protocol for the MCP specification
  • FastMCP for the excellent MCP framework
  • Jenkins for the amazing CI/CD platform
  • Python for the excellent programming language
  • The open-source community for inspiration and support

πŸ“š Documentation

Quick Links

  • Getting Started: See installation section above for detailed setup
  • Configuration: Authentication options and environment variables
  • Troubleshooting: Common issues and solutions
  • API Reference: Complete tool documentation

πŸ“ž Support


Made with ❀️ for the DevOps community

Related Servers