pgbrake is a local MCP server that sits between Claude Code, Codex or Cursor and your Postgres database. Risky SQL waits for a human. Every UPDATE and DELETE made through it can be reversed with one command. Everything runs on your machine; nothing is sent to us.

pip install pgbrake claude mcp add pgbrake --env PGBRAKE_DSN="postgresql://me@localhost/app" -- uvx pgbrake serve
pgbrake approve in a terminal. An agent can't approve its own SQL.pgbrake undo <id> puts them back, with a conflict check.ALTER SYSTEM, role/database drops, COPY ... PROGRAM or DO blocks.Open source (MIT), forever
Launch price for the first 100 licenses, then $39. One-time payment, no subscription, no auto-renewal. Includes all 0.x and 1.x updates.
prisma migrate reset, rails db:drop, alembic downgrade and other destructive agent commands, takes a pg_dump snapshot, then asks you14-day refund, no questions asked. See the refund policy.
Undo covers only changes made through pgbrake. TRUNCATE and DDL can be held but not undone. pgbrake does not replace backups. Tested on PostgreSQL 17.