Woodpecker CI Pipeline Analyzer
Enables automated analysis of Woodpecker CI pipeline failures with intelligent error detection and fix suggestions. Supports both direct pipeline analysis and IDE-integrated git-context analysis using repository names, PR numbers, or branch information.
README
MCP Pipeline Server
A Model Context Protocol (MCP) server for automated CI/CD pipeline failure analysis, specifically designed for Woodpecker CI integration with IDE support.
🚀 Overview
The MCP Pipeline Server provides intelligent CI pipeline failure analysis with two flexible approaches:
- Direct Pipeline Analysis: Analyze specific pipelines using repository ID and pipeline number
- Git-Context Analysis: Automatically resolve and analyze pipelines using repository name, PR number, or branch information from your IDE
🛠️ Available Tools
1. WoodpeckerCiPipelineReportGeneratorTool
Purpose: Direct pipeline analysis with specific identifiers Input:
repoId: Woodpecker CI repository ID (e.g., "1")pipelineNumber: Specific pipeline number (e.g., "100577")
Usage:
# Example URLs to extract info from:
# https://woodpecker.orgName.dev/repos/1/pipeline/100577
# repoId = "1", pipelineNumber = "100577"
2. GitBasedPipelineAnalyzerTool
Purpose: Intelligent pipeline analysis using git context from IDE Input:
repoName: Repository name (e.g., "my-project")pullRequestNumber: PR number (e.g., "123")branchName: Git branch name (optional)
Features:
- Auto-resolves repository ID from name
- Finds latest pipeline for the specified PR
- Handles running pipelines gracefully
- Integrates with IDE git context
📋 Available Prompts
1. analyze-pipeline
Purpose: Traditional pipeline analysis with specific repo/pipeline numbers Best for: Direct analysis when you have Woodpecker CI URLs
2. analyze-pr-failures
Purpose: IDE-integrated analysis using git context Best for: Analyzing PR failures directly from your development environment
🔄 Analysis Flow
flowchart TD
A[User Request] --> B{Input Type?}
B -->|RepoID + Pipeline| C[WoodpeckerCiPipelineReportGeneratorTool]
B -->|Repo Name + PR| D[GitBasedPipelineAnalyzerTool]
D --> E[Resolve Repository ID]
E --> F[Find Latest Pipeline]
F --> C
C --> G[Fetch Pipeline Details]
G --> H[Get Failed Step Logs]
H --> I[Analyze Final Attempts Only]
I --> J[Generate Structured Report]
J --> K[Markdown + JSON Output]
K --> L[File-by-File Fix Suggestions]
🏗️ Architecture
Dependency Injection System
The server uses a NestJS-style dependency injection pattern:
// Services are auto-registered with @Injectable()
@Injectable()
class WoodpeckerForgesService {
// Service implementation
}
// Tools inject services via constructor
export class GitBasedPipelineAnalyzerTool extends MCPTool<Input> {
constructor(
private woodpeckerForges: WoodpeckerForgesService = inject('WoodpeckerForgesService')
) {
super();
}
}
Caching Strategy
- Repository Resolution: 24-hour cache for repo name → repo ID mappings
- Pipeline Analysis: 2-hour cache for complete pipeline analysis results
- No Pipeline Resolution Cache: Always fetches latest pipeline to avoid stale data
Service Lifecycle
- Startup: ServiceManager initializes and discovers @Injectable services
- Runtime: Lazy service instantiation on first use
- Shutdown: Proper cache cleanup and resource disposal
🚦 Usage Examples
IDE Integration (Recommended)
# Analyze current PR failures
"Analyze PR failures for #123"
# Analyze by repository name
"Check CI issues for my-project repository"
# Analyze specific branch
"Analyze failures on feature/new-ui branch"
# Context-aware analysis
"Review CI problems" # Uses current git context
Direct Pipeline Analysis
# Using specific Woodpecker CI identifiers
woodpecker-ci-pipeline-report-generator --repoId="1" --pipelineNumber="100577"
📊 Output Format
Human-Readable Report
## CI Failure Analysis – pipeline #100577 | repo: my-project | PR #123
| # | Scenario | Scenario File | Code File | Failure Type | Brief Cause | Proposed Fix |
|---|----------|---------------|-----------|--------------|-------------|--------------|
| 1 | Login Flow | features/login.feature:23 | src/auth.js:45 | assertion | Element not found | Update selector |
### Details
#### Login Flow Test Failure
```log
Key failure indicators...
Scenario file: features/login.feature:23 Root cause: Updated UI element selector not matching Fix suggestions: Update element selector in auth.js
### Machine-Readable JSON
```json
{
"pipeline": "100577",
"repoId": "1",
"context": {
"repoName": "my-project",
"prNumber": "123"
},
"analysedAt": "2024-08-11T10:30:00Z",
"failures": [
{
"scenario": "Login Flow",
"scenarioFile": "features/login.feature:23",
"failureType": "assertion",
"rootIndicators": ["Element not found", "Timeout"],
"proposedFix": "Update element selector",
"relatedFiles": ["src/auth.js:45"]
}
]
}
🔧 Setup & Installation
Prerequisites
- Node.js 18+
- pnpm or npm
- Access to Woodpecker CI instance
Environment Variables
WOODPECKER_SERVER=https://woodpecker.your-domain.com
WOODPECKER_TOKEN=your_woodpecker_token
Installation
Option 1: Install from npm (Recommended)
# Install globally
npm install -g woodpecker-ci-mcp
# Or install locally in your project
npm install woodpecker-ci-mcp
Option 2: Local Development
# Clone and install
git clone <repository-url>
cd mcp-pipeline-server
pnpm install
# Build
pnpm run build
# Start
pnpm start
MCP Client Integration
Using the published package:
{
"mcpServers": {
"woodpecker-ci": {
"command": "npx",
"args": ["woodpecker-ci-mcp"],
"env": {
"WOODPECKER_SERVER": "https://woodpecker.your-domain.com",
"WOODPECKER_TOKEN": "your_token"
}
}
}
}
Using global installation:
{
"mcpServers": {
"woodpecker-ci": {
"command": "woodpecker-ci-mcp",
"env": {
"WOODPECKER_SERVER": "https://woodpecker.your-domain.com",
"WOODPECKER_TOKEN": "your_token"
}
}
}
}
Using local build:
{
"mcpServers": {
"woodpecker-ci": {
"command": "node",
"args": ["path/to/mcp-pipeline-server/dist/index.js"],
"env": {
"WOODPECKER_SERVER": "https://woodpecker.your-domain.com",
"WOODPECKER_TOKEN": "your_token"
}
}
}
}
🎯 Key Features
Intelligent Analysis
- Final Attempt Focus: Only analyzes the last retry of failed steps
- Pattern Recognition: Identifies recurring failure patterns
- Context-Aware: Understands git workflow and PR context
IDE Integration
- Automatic Repository Resolution: No need to lookup repo IDs manually
- Branch-Aware: Finds appropriate pipelines for current branch/PR
- Real-time Status: Handles running pipelines gracefully
Developer Experience
- File-Specific Suggestions: Pinpoints exact files and line numbers
- Interactive Fixes: Prompts before applying any changes
- Structured Output: Both human and machine-readable formats
Performance
- Smart Caching: Optimized cache strategy for different data types
- Lazy Loading: Services instantiated only when needed
- Resource Management: Proper cleanup on shutdown
🔍 Troubleshooting
Common Issues
- Service not found errors: Ensure ServiceManager is initialized before tool usage
- Pipeline not found: Verify repository name spelling and PR number
- Token issues: Check WOODPECKER_TOKEN has sufficient permissions
Debug Logging
The server provides detailed logging for service registration and pipeline resolution:
🔧 Service registered: WoodpeckerForgesService
Auto-registered services: WoodpeckerForgesService
🤝 Contributing
- Follow the NestJS-style dependency injection patterns
- Use
@Injectable()for services that will be injected - Implement proper caching for external API calls
- Add comprehensive error handling
- Update this README for new tools/features
📚 API Reference
See individual tool files for detailed parameter schemas:
src/tools/WoodpeckerCiPipelineReportGeneratorTool.tssrc/tools/GitBasedPipelineAnalyzerTool.tssrc/prompts/CiPipelinePrompt.tssrc/prompts/GitBasedCiAnalysisPrompt.ts
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。