关于 release-readiness-triage-mcp
release-readiness-triage-mcp 是供工程团队评估版本发布风险的 MCP 服务。它结合 CI 失败归类、历史不稳定测试、代码变更关联和迁移检查,生成按风险加权的发布结论。
主要功能
- 01分组并分类 CI 失败
- 02结合历史不稳定测试记录分析失败
- 03将变更文件与失败测试关联
- 04生成风险加权的发布结论
- 05识别按时间出现的失败模式
- 06评估迁移的回滚准备情况
适用场景
- 01发布前分诊 CI 失败
- 02区分不稳定测试与潜在回归
- 03为 PR 评论准备发布建议
- 04检查迁移是否存在回滚阻碍
MCP 相关
它向 MCP 客户端提供从失败分析到结论生成的发布分诊工具,也可与所列的不稳定测试、AST 影响分析和 Playwright trace MCP 服务协作编排。
配置
本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。
工具
6收录的工具列表 · 更新于 2 周前
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
| runId | string | 否 | CI 运行标识符 |
| branch | string | 否 | 分支名称 |
| failures | array | 是 | CI 运行中的测试失败列表 |
| commitSha | string | 否 | 提交 SHA |
| totalTests | integer | 是 | 运行中的测试总数 |
| passedTests | integer | 是 | 通过的测试数 |
| customInfraPatterns | array | 否 | 用于分类基础设施错误的额外正则表达式模式(字符串),例如云服务提供商特有的消息,如 'No space left on device' 或 'GCP quota exceeded' |
详细介绍
🚦 release-readiness-triage-mcp
别再读 CI 日志,开始获取判定结果。
MCP 服务可汇总测试失败、交叉比对不稳定历史,并输出 GO / CONDITIONAL_GO / NO_GO / INVESTIGATE 发布决策——让你的 AI Agent 能在几秒内对失败的 CI 运行进行分类,而不是让你读完 3000 行日志。
🤔 问题所在
在任何真实的代码库中,CI 总会有 一些 失败。难题不是“有没有失败?”——而是**“这些失败是真正的回归,还是一贯的噪声?”**
回答这个问题需要同时关联三种信号:
- 🔍 错误特征——这是同一个失败重复了 12 次,还是 12 个不同的问题?
- 📊 不稳定历史——这个测试是否已知不可靠?
- 🔗 代码变更——失败的测试是否确实与变更内容相关?
没有结构化工具,AI Agent 无法完成这项工作。原始 CI 日志有数千行。不稳定性数据库位于外部。代码→测试映射需要 AST 分析。没有这个 MCP,Agent 只能猜测。
🛠️ 工具
aggregate_suite_failures
按规范化的错误特征对失败进行分组,去重重复错误,并归类为 assertion / timeout / network / crash。对于特定云平台的错误,请传入 customInfraPatterns。
cross_reference_flakiness
根据不稳定历史为每个失败评分:KNOWN FLAKY、MILDLY FLAKY 或 NO HISTORY。
correlate_code_changes
将变更文件与失败的测试进行匹配。可独立运行,也可使用来自 ast-impact-mapper-mcp 的预计算受影响测试列表。
generate_release_recommendation
最后一步。输出按风险加权的判定结果,并附带置信度分数和完整明细。支持 format: "markdown",可用于 GitHub PR 评论和 Slack。
判定级别:
NO_GO— 关键领域(payment、auth、billing、checkout、security)存在回归CONDITIONAL_GO— 低/中风险领域(analytics、docs、admin)存在回归;发布前需审核GO— 所有失败均为已知的不稳定测试或基础设施噪声INVESTIGATE— 未知因素过多,无法作出判定
输出包括:
aggregate_risk_score— 0.0–1.0,所有回归风险贡献的概率并集failing_tests_analysis[]— 每项回归的明细,包括domain、severity(HIGH/MEDIUM/LOW)、risk_contribution、blast_radius
detect_temporal_failure_patterns
分析带时间戳的历史失败,以识别时间规律性异常——仅在同一 UTC 小时、星期几、每月几号或夏令时转换期间出现的失败。发现此类模式时,该失败属于时间因素导致的异常,而非代码回归。
输出包括:
temporal_pattern_detected— 布尔值clusters[]— 按测试分类:pattern_type(hourly | daily | monthly | timezone_shift)、cluster_times、confidence_score
analyze_rollback_readiness
扫描代码库中的带版本迁移文件(Flyway V*.sql、Prisma migration.sql、Liquibase XML/YAML),并将每项操作分类为新增式(可安全回滚)或破坏式(只能通过前向修复处理)。
检测到的破坏性操作: DROP TABLE、DROP COLUMN、ALTER COLUMN TYPE、MODIFY COLUMN、TRUNCATE
输出包括:
rollback_eligible— 布尔值blocking_migrations[]— 每项包括file、line、operation、reasondeployment_strategy—standard | forward_fix_only
🧪 实际效果
CI 中有 5 个失败。哪些是真问题,哪些只是噪声?
failures:
- Auth Suite > login with expired token → "Expected status 200, got 401"
- API Suite > health check → "connect ECONNREFUSED 127.0.0.1:3000"
- Button Suite > renders button correctly → "Expected null, got <button>Submit</button>"
- Search Suite > debounce timing → "Expected 42, received 43"
- Storage Suite > upload avatar → "GCP quota exceeded for this project"
changedFiles: ["src/components/Button.tsx"]
affectedTests: ["renders button correctly"]
customInfraPatterns: ["GCP quota exceeded"]
format: "markdown"
输出:
## 🔴 Release Recommendation: NO_GO (75% confidence)
> 1 confirmed regression(s) in critical domain(s) [payment]. Do not release.
**Aggregate risk score:** 1.0
| Category | Count |
| ------------------- | ----- |
| Total failures | 5 |
| 🔴 Real regressions | 1 |
| 🟡 Known flaky | 2 |
| ⚪ Infra blips | 2 |
| ❓ Unknown | 0 |
### Risk Breakdown
| Test | Domain | Severity | Risk | Blast Radius |
| -------------------------------------- | ------ | -------- | ---- | ------------ |
| Button Suite::renders button correctly | core | MEDIUM | 0.5 | 1 |
### Blockers (must fix before release)
**Button Suite > renders button correctly**
- Test is directly affected by code changes in this commit
- `Expected null, got <button>Submit</button>`
### Safe to ignore
- ~~Auth Suite > login with expired token~~ — Historically flaky: 73% failure rate in history
- ~~API Suite > health check~~ — Error pattern matches infrastructure issues (network)
- ~~Search Suite > debounce timing~~ — Mildly flaky: 22% historical failure rate
- ~~Storage Suite > upload avatar~~ — Error pattern matches infrastructure issues (network)
一次工具调用。一个判定。去修复 Button.tsx。
⚡ 设置
{
"mcpServers": {
"release-readiness-triage": {
"command": "npx",
"args": ["-y", "release-readiness-triage-mcp"]
}
}
}
🚀 用法
“这是我们 CI 运行中的失败、我们的不稳定性数据库,以及此 PR 中更改的文件。可以安全发布吗?”
Agent 会调用 generate_release_recommendation,并返回一个附有完整分析的判定,可直接粘贴到 PR 评论或 Slack 中。
可独立使用,也可作为元编排器,基于以下工具运行:
- flakiness-knowledge-graph-mcp — 用于查询不稳定性历史记录
- ast-impact-mapper-mcp — 用于分析代码与测试的关联
- playwright-trace-decoder-mcp — 用于进行跟踪级别的失败分析
📦 链接
- npm: npmjs.com/package/release-readiness-triage-mcp
- GitHub: github.com/vola-trebla/release-readiness-triage-mcp
许可证
MIT
评论
一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。