incident-mcp
incident-mcp
协助事件发现(detection) → 分析(analysis)的 Python MCP(Model Context Protocol) 服务器。 从指标时间序列中检测异常征兆,并将相关关系归类,进一步给出根因候选和推荐措施。
两个后端共享一个工具契约(tool contract):
服务器 | 后端 | 用途 |
| 内置合成数据 (确定性) | 无需 VM 进行开发·演示·回归测试 |
| 实际 VictoriaMetrics HTTP API | 运维/实测事件分析 |
由于两个服务器的工具签名 100% 相同,所以用 mock 开发工作流后,可以无中断地切换到实际 VM。
架构
incident_mcp/
├── core/ # 백엔드 무관 공통 로직 (순수 함수 → 테스트 용이)
│ ├── models.py # Pydantic: Anomaly, IncidentAnalysis, Series ...
│ ├── datasource.py # Protocol(인터페이스) — VM/Mock이 구현
│ ├── detection.py # 이상탐지: zscore · spike · trend · threshold
│ └── analysis.py # 상관분석 + 근본원인 휴리스틱
├── datasources/
│ ├── mock_ds.py # 재현 가능한 합성 메트릭 + 주입된 인시던트 시나리오
│ └── vm_ds.py # VictoriaMetrics(Prometheus 호환) HTTP 클라이언트
├── servers/
│ ├── mock_server.py # B: mock 데이터소스 주입
│ └── vm_server.py # A: VictoriaMetrics 데이터소스 주입
└── tools.py # 공통 MCP 도구 4종 (두 서버가 공유)4 种 MCP 工具
工具 | 说明 |
| 可用指标目录 |
| 原始时间序列查询 (确认/调试) |
| 执行异常检测 (zscore/spike/trend) |
| 检测→分析 一步完成 (根因候选 + 推荐措施) |
Related MCP server: MCP Server for vmanomaly
快速开始
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
# 단위 테스트
pytest -q
# mock 서버로 종단(E2E) 데모 — mock 2개 시나리오 + 실제 VM
python examples/e2e_client.py文档 (分步)
异常检测方法 (摘要)
方法 | 捕获的模式 | 示例事件 |
| 大幅偏离平均值的瞬时值 | 瞬时尖峰 |
| 相比前一区间的急剧变化率 | 错误率激增 |
| 平缓的单调递增/递减 | 内存泄漏 (zscore/spike 检测不到) |
| 违反绝对阈值 | 超出 SLA 限制 |
💡 像内存泄漏这样"缓慢泄漏"的模式,基于瞬时值(zscore/spike)的检测无法发现, 因此单独提供了基于回归斜率的
trend检测器。— 参见 step2
许可证
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
AI-powered incident management and server monitoring via MCP.
MCP-native AI SRE: ask what's broken in production, get a reviewed GitHub fix PR.
Read-only MCP server for AIStatusDashboard status, incidents, metrics, and fallback recommendations.
Manage uptime monitors, incidents and status pages from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA comprehensive, AI-powered performance analysis and monitoring platform for OpenShift/Kubernetes clusters. This project provides Model Context Protocol (MCP) servers for analyzing etcd, network, and OVN-Kubernetes components with deep performance insights, automated root cause analysis, and actionable recommendations.1Apache 2.0
- AlicenseNot gradedqualityBmaintenanceMCP server that integrates with VictoriaMetrics vmanomaly API to enable AI-assisted anomaly detection, model management, and configuration generation.11Apache 2.0
- AlicenseAqualityDmaintenanceExposes an observability REST API as MCP tools, enabling incident investigation through automated correlation of deploys with errors, log and metrics queries.6MIT
- FlicenseAqualityDmaintenanceAI-powered incident management MCP server that enables investigation, root cause analysis, and response actions for production incidents using mocked data for demo purposes.8-