nock-mcp
Provides PostgreSQL migration safety checking by analyzing DDL statements against estate snapshots to assess lock modes, hot-table risk, and policy violations before applying.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Nock
Estate-aware approve/block for Postgres DDL.
Same verdict in CLI, CI, and Cursor MCP. Never applies migrations.
Why Nock
Checks your proposed DDL against an estate — a snapshot of your table sizes plus catalogue facts (columns, constraints, indexes) — so it approves or blocks based on your data, not generic SQL patterns
Check-only: never applies migrations and never writes to your database
Returns the same JSON verdict from the CLI, GitHub Actions, and Cursor MCP
Exit codes:
0pass ·1warnings only ·2fail (blocking)
Related MCP server: MigrationPilot
Quick start (golden path)
An estate is a small JSON snapshot of your Postgres table sizes and catalogue facts (columns, constraints, indexes)—not a dump of row data—that Nock uses to approve or block DDL for your database. Details: Estate schema.
Get an estate (pick one)
Bring your own estate: commit
.nock/estate.jsonSync estate yourself:
npx @nockhq/cli@latest sync-estate --database-url "$DATABASE_URL" --out .nock/estate.jsonLive DATABASE_URL check: omit
--estate, pass--database-url
Check
npx @nockhq/cli@latest check \
--sql migrations/001.sql \
--estate .nock/estate.json \
--format jsonWire the gate — same command in Actions or MCP
check_before_apply. Exit: 0 pass · 1 warn · 2 fail.
Example verdict (truncated)
{ "verdict": "fail", "violations": [ { "rule_id": "R001", "severity": "red" } ] }Add to CI (GitHub Action)
Preferred: use the published GitHub Marketplace Action, pinned to the current version:
name: Nock — Postgres migration safety (Action)
on:
pull_request:
paths: ['migrations/**', '.nock/**']
jobs:
nock:
runs-on: ubuntu-latest
permissions: { contents: read, pull-requests: write }
steps:
- uses: actions/checkout@v4
- name: Run Nock check (Action)
uses: saiyamshah1496/nock-action@v0.1.9
with:
migration-path: migrations/
estate-path: .nock/estate.json
policy-path: policy.default.yml
fail-on: red
github-token: ${{ secrets.GITHUB_TOKEN }}Notes:
GitHub Marketplace listing: Nock — Estate‑aware Postgres DDL
You can also test a PR branch by pinning a commit SHA in
uses: owner/repo@<sha>.
Alternative (CLI):
Copy-paste into .github/workflows/nock.yml:
name: Nock — Postgres migration safety (CLI)
on:
pull_request:
paths: ['migrations/**', '.nock/**']
jobs:
nock:
runs-on: ubuntu-latest
permissions: { contents: read, pull-requests: write }
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: 'npm' }
- name: Run Nock check (CLI)
run: |
npx @nockhq/cli@latest check \
--sql "migrations/001.sql" \
--estate ".nock/estate.json" \
--policy "policy.default.yml" \
--fail-on "red" \
--format "json" | tee nock-verdict.jsonSee more in examples/workflows/nock.yml and examples/workflows/nock-action.yml.
Add to Cursor (MCP)
Install server via npx:
{ "mcpServers": { "nock": { "command": "npx", "args": ["-y", "@nockhq/mcp@latest"] } } }Call
check_before_applywith either:estatePath: ".nock/estate.json"(file)or
databaseUrl: "postgres://..."(live DATABASE_URL check)
Not Squawk, not Atlas
Not Squawk, not Atlas. Squawk lints migration shapes without knowing your table sizes. Atlas plans and applies schema changes. Nock does neither: it takes your DDL plus an estate snapshot (or a live read-only
DATABASE_URL) and returns approve or block for CI and agents—lock risk on your data—without ever applying SQL.
Free vs Team
Free — one estate, DIY
Bring your own estate file, sync estate yourself, or run a live DATABASE_URL check on your runner. Staging + production means two checks or a CI matrix you own. Nock does not host multi-estate packs on Free.
Team — estate packs Hosted staging / production / tenant estates under one org, plus org policy, audit, and export. Same approve/block engine as Free — ops convenience when you outgrow a single estate file in CI.
Docs
Reference: CLI · Rules · Verdict JSON · Estate schema
Security
No row data is read or processed; only catalogue (columns, constraints, indexes) and table sizes
Your database URL never leaves your runner in Free mode
Prefer read‑only roles and replicas for
sync-estateor live checks See docs/SECURITY.md.
Contributing
See docs/DEVELOPMENT.md.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
Detects database migration table locks, terraform cost leaks, and OWASP API flaws.
SQL validation, formatting, parsing, metadata extraction, linting, and security analysis.
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
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.615 npmMIT
- AlicenseAqualityAmaintenanceBlocks unsafe PostgreSQL migrations before an AI agent writes or runs them. check_before_apply returns a pass/fail gate; reads the real Postgres parser, classifies the lock each statement takes, checks 112 safety rules. Runs offline, no database required.7611 npm9MIT
- AlicenseNot gradedqualityAmaintenanceExposes read-only tools that let AI assistants detect schema drift, analyze lock impact, verify data with checksums, and plan safe PostgreSQL migrations that are validated by deterministic checks and shadow runs.31 npmApache 2.0
- AlicenseAqualityAmaintenanceOffline PostgreSQL diagnostics: reviews SQL, risky migrations, candidate indexes and EXPLAIN JSON plans without database credentials or executing statements.589 npmMIT