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
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)
Category | Tools | Description |
---|---|---|
Core Pipeline Operations (5) | list_pipelines , get_pipeline_details , get_pipeline_builds , analyze_pipeline_health , analyze_pipeline_failure | Direct Jenkins API operations, monitoring, and analysis |
AI-Powered Analysis (1) | ask_pipeline_question | Natural language queries and intelligent insights |
Configuration Management (3) | configure_jenkins , test_connection , get_server_info | Jenkins 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)
Tool | Description |
---|---|
get_pipeline_metrics | Get detailed metrics (success rate, duration, frequency) |
get_pipeline_dependencies | Get upstream/downstream pipeline dependencies |
monitor_pipeline_queue | Monitor Jenkins build queue and pending builds |
analyze_build_trends | Analyze trends across multiple pipelines |
AI Intelligence Tools (5 Total)
Tool | Description |
---|---|
predict_pipeline_failure | AI prediction of failure risk based on patterns |
suggest_pipeline_optimization | AI suggestions for performance optimization |
detect_pipeline_anomalies | Detect unusual patterns and anomalies in pipeline behavior using ML |
intelligent_retry_logic | Analyze failure patterns and suggest intelligent retry logic using ML |
generate_ai_insights | Generate comprehensive AI-powered insights about the pipeline using real data analysis |
Security Tools (2 Total)
Tool | Description |
---|---|
scan_pipeline_security | Security vulnerability scan and best practices check |
audit_access_controls | Audit pipeline access controls and permissions using Jenkins security API |
Jenkinsfile Tools (3 Total)
Tool | Description |
---|---|
get_jenkinsfile | Get Jenkinsfile (automatically reconstructs if stored in Git) |
reconstruct_jenkinsfile | Reconstruct Jenkinsfile content from pipeline execution data |
suggest_pipeline_improvements | Get improvement suggestions based on reconstructed Jenkinsfile |
Advanced Analytics & Reporting Tools (2 Total)
Tool | Description |
---|---|
generate_pipeline_report | Generate comprehensive pipeline report based on Jenkins build history |
compare_pipeline_performance | Compare performance across multiple pipelines based on Jenkins build history |
Performance Optimization Tools (1 Total)
Tool | Description |
---|---|
analyze_build_time_optimization | Analyze 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)
Resource | Description |
---|---|
pipeline://status | Get overall system status and health summary |
pipeline://{pipeline_name}/summary | Get comprehensive pipeline summary with recent builds |
pipeline://dashboard | Get comprehensive dashboard view of all pipelines |
pipeline://{pipeline_name}/logs/{build_number} | Get build logs for a specific pipeline build |
pipeline://health | Get overall system health and alerts |
MCP Prompts (4 Total)
Prompt | Description |
---|---|
analyze_pipeline_prompt | Generate prompts for comprehensive pipeline analysis |
failure_analysis_prompt | Generate prompts for failure analysis |
optimization_prompt | Generate prompts for pipeline optimization analysis |
security_audit_prompt | Generate 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 executionstop_pipeline_build
: Warns about potential system inconsistenciesenable_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
- Fork the repository
- Create a feature branch
- Make your changes
- 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
- Documentation: Wiki
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Made with β€οΈ for the DevOps community
Related Servers
LAML MCP Server
Loads and validates LAML (YAML-based markup language) documents via the Model Context Protocol.
OPNSense MCP Server
Manage OPNsense firewalls using Infrastructure as Code (IaC) principles.
Reports MCP Server
Manages penetration testing reports and vulnerabilities via a REST API.
Glide API
Interact with the Glide API to build applications from data sources like Google Sheets.
PureScript MCP Server
An MCP server offering PureScript development tools for AI assistants. Requires Node.js and the PureScript compiler for full functionality.
EVE Online ESI
Interact with the EVE Online ESI API to access game data and services.
Supra Code Generator MCP
Generates Supra Move contracts and TypeScript SDK code.
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
MCP Gemini CLI
Integrate with Google Gemini through its command-line interface (CLI).
shadcn-vue
An AI agent that helps developers instantly create high-quality UI components for shadcn-vue.