mcp-change-risk
Enables change-risk assessment and execution orchestration against MySQL databases, including DDL risk scoring, impact estimation, dry-run with rollback, canary execution, prechecks, apply/rollback workflows, and audit trails. The optional MySQL driver allows the server to connect to MySQL instances for live checks and execution.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-change-riskAssess the risk of adding an index on orders.user_id"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-change-risk
变更风险与执行状态机 · MCP Server
把「这条 DDL 能不能上」变成可解释的分数,把「上了能不能退」变成强制门禁。
安装(按需,不必装其他 MCP)
pip install mcp-change-risk # 从 PyPI
pip install "./mcp-change-risk[mysql]" # 从源码(在工具链根目录执行);要连库就补驱动,或 [postgres]会自动带上它需要的共享库:sqltk-core(连库/只读防护)、sqltk-store(变更事件落库)、sqltk-know(引擎阈值)。不会带其他 MCP。
Related MCP server: safe-runbook-mcp
挂到 MCP 客户端
{
"mcpServers": {
"change-risk": {
"command": "python",
"args": ["-m", "change_risk"],
"env": { "DBT_STORE": "~/.dbtoolchain" }
}
}
}按你的客户端(Claude Desktop / Cursor / Cline 等)说明,把这段合并到对应的 mcpServers 配置里。
命令行调试(不挂客户端也能用):
mcp-change-risk tools
mcp-change-risk call <tool> --args '{"sql": "SELECT 1"}'工具(13)
工具 | 作用 |
| 放弃一个尚未执行的变更,写入审计。不执行、也不回滚任何 SQL。 |
| 按计划执行,全程留痕。没有 approver 一律拒绝 |
| DDL 风险 L0-L3、锁影响、推荐工具、前置条件。不连库也能评估。 |
| 单个变更的完整时间线证据链 —— 事故复盘和责任划分的依据。 |
| 查某个变更当前处在状态机哪一步(含审批人、风险等级与计划详情)。 |
| ★ dry-run:真正执行一遍,看到真实影响行数与耗时,然后强制回滚。 |
| 估算影响面:DML 用执行计划估算行数,查询类直接 COUNT。 |
| 受限灰度执行。必须有审批人,且必须已通过 dry-run。 |
| 生成反向 DDL。不可逆操作会明确说不可逆,而不是编造一条看起来能回滚的语句 |
| 列出实例的变更记录,可按 state 过滤。 |
| 生成可审批的执行计划:步骤 + 检查点 + 回滚点,并持久化到档案。 |
| 变更窗口前置检查:长事务 / 复制延迟 / 关键参数 → go or no-go |
| 按 change_id 回滚到变更前状态。 |
闭环
assess_change 评估 → generate_rollback 回滚方案 → precheck_change_window 窗口预检 → dry_run_change → execute_canary 灰度 → apply_change / rollback_change
Tier(冷启动保证)
评估为 tier0(因子模型 + 引擎知识);precheck / dry_run 需连库(tier1)。每次状态迁移自动写 change_event,供事后与异常做时间关联。
边界:这个仓不做什么
只做变更的评估与执行编排。SQL 写法好坏归 mcp-sql-review,实例当时健不健康归 mcp-dbwatch。
开发
python tests/test_change_risk.py # 不需要 pytest,也不需要数据库许可
MIT © 2026 罗文星 —— 见 LICENSE。
This server cannot be deployed
Maintenance
Related MCP Connectors
Read-only AI coding tools for change verification, release readiness, capacity, and guidance.
Scans schema metadata to classify PHI, score HIPAA readiness, and generate compliant migrations.
Detects database migration table locks, terraform cost leaks, and OWASP API flaws.
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Related MCP Servers
- AlicenseAqualityDmaintenanceAnalyzes database migrations for risks like lock contention and data loss before they run. Supports Flyway and Liquibase formats, providing risk scores and rollback generation.612 npmMIT
- AlicenseAqualityBmaintenanceEnables AI agents to safely inspect and execute version-controlled operational runbooks with policy checks, dry-run planning, and out-of-band approvals.3MIT
- AlicenseNot gradedqualityAmaintenanceEnables checking Postgres migration SQL against a table-size estate snapshot and safety policy before apply, returning approve/block verdicts with lock details and remediation guidance, plus tools to explain locks and list policy rules.1MIT
- AlicenseAqualityAmaintenanceEnables safe database migration workflows by detecting frameworks, reviewing migration risk and drift, generating migration files with explicit approval, and providing rollback guidance—without ever applying migrations or executing rollbacks.75 npm1MIT