- Mcp Jenkins Intelligence
Mcp Jenkins Intelligence
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