DeltaScope is an offline-first SQL migration risk checker for MySQL, TiDB, and PostgreSQL. It reviews both DDL and DML statements, returning structured findings with blocker, warning, and notice severities. Use it from the CLI, in CI pipelines, via HTTP service, through the MCP server for AI agents, or embed it via the Go SDK.
$ deltascope audit --sql "ALTER TABLE users DROP COLUMN age;"
Verdict: reject
Statements: 1
Blockers: 1
Statement 1: ALTER TABLE
- [blocker] ddl.alter.drop.column: dropping column "age" is a destructive change
$ deltascope audit --sql "DELETE FROM users;"
Verdict: reject
Statements: 1
Blockers: 1
Statement 1: DELETE
- [blocker] dml.where.require: UPDATE and DELETE statements must include a WHERE clause
deltascope audit --file migrations.sqlPOST /v1/audit on deltascope-serverdeltascope.Audit(ctx, req) from pkg/deltascopedeltascope-mcp for Claude Code, Codex, Cursor, and 40+ AI agentsDeltaScope ships an MCP stdio server that AI coding agents call directly. Install it once and every SQL edit in your AI session gets audited automatically.
claude mcp add --scope user deltascope -- npx -y @fanduzi/deltascope-mcp
# GitHub Actions
- name: Audit SQL migrations
run: |
deltascope audit \
--file ./migrations.sql \
--format github-actions \
--fail-on blocker
# GitLab CI
- name: Audit SQL migrations
run: |
deltascope audit \
--file ./migrations.sql \
--format gitlab-codequality \
--fail-on warning
--dialect mysql|tidb|postgresql.reject if any blocker is present, review if only warnings/notices, and pass if clean.claude mcp add or the npx launcher.--config.