原型 · 预览版:收录官方注册中心里的全部服务器,每 30 分钟同步一次。评价和账户功能将在后续阶段推出。
PopNx MCP为使用 AI 的人准备的 MCP 服务器 · 用大白话讲清楚

pgbrake

作者:lexang版本 0.3.0i★ –i在你的电脑上运行
注册名称io.github.lexang/pgbrake

安装

概览

作者提供的说明(英文原文)

Postgres brake for AI agents: risky SQL waits for approval, UPDATE/DELETE get one-command undo.

PopNx MCP 的三大支柱

这三项永远不会合并成一个分数:意见、测量和人气是不同的东西。

它能帮你做什么

我们还没有为它写通俗的介绍。下面是我们从注册中心读取到的事实。

  • 连接方式: 在你的电脑上运行
  • 传输方式: stdio
  • 分类: 数据库与数据集
  • 你需要填写:PGBRAKE_DSN

安装

选择你使用的 AI 应用,然后复制设置。

安装之前

标为机密的值是你账户的钥匙。千万不要分享给别人,也不要粘贴到聊天里。

你需要

  • PyPI已安装 Python 的 uv(用于 uvx 命令)

你用的是哪个应用?

在上方选择你的应用。我们会记住它,下次按钮会显示“安装到 …”。

打开 Claude Desktop → Settings → Developer → Edit Config,把下面的内容粘贴到 claude_desktop_config.json

{
  "mcpServers": {
    "pgbrake": {
      "command": "uvx",
      "args": [
        "pgbrake",
        "serve"
      ],
      "env": {
        "PGBRAKE_DSN": "your-value"
      }
    }
  }
}

在终端中运行这条命令

claude mcp add pgbrake --env PGBRAKE_DSN=your-value -- uvx pgbrake serve

运行前请先填写空着的值。

在 Cursor 中打开

或者自己复制设置

粘贴到项目中的 .cursor/mcp.json,或 ~/.cursor/mcp.json

{
  "mcpServers": {
    "pgbrake": {
      "command": "uvx",
      "args": [
        "pgbrake",
        "serve"
      ],
      "env": {
        "PGBRAKE_DSN": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

在 VS Code 中打开

或者自己复制设置

粘贴到项目中的 .vscode/mcp.json

{
  "servers": {
    "pgbrake": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "pgbrake",
        "serve"
      ],
      "env": {
        "PGBRAKE_DSN": "your-value"
      }
    }
  }
}

浏览器会先询问是否打开应用,然后应用会显示设置并请你确认。密钥的值会留空,由你自己填写。

这个服务器在你的电脑上运行,而 ChatGPT 只能连接互联网上的服务器。请选择其他应用。

你的选择通过 Cookie 保存在这台设备上,无需账户。

需要你填写的值

  • PGBRAKE_DSN 机密 必填 env
    Postgres connection string, e.g. postgresql://me@localhost/app

这些设置是根据作者在注册中心的条目生成的。如果 README 的写法不同,请以 README 为准。

它能做什么

它在你的电脑上运行;安装后,工具列表会显示在你的 AI 应用中。

基础检查i

我们检查的是任何人都能看到的信息;我们没有阅读代码。不适用的检查项不计入总数。 · 检查于 2026年11月7日

  • ✓ 通过

    作者与仓库一致

    注册名称已通过 GitHub 账户 lexang 验证,该账户拥有此仓库

  • … 尚未检查

    仍在维护

    我们还没有从 GitHub 读取这个仓库

  • … 尚未检查

    有许可证

    我们还没有从 GitHub 读取这个仓库

  • – 不适用

    端点有响应

    它在你的电脑上运行,没有互联网端点

  • – 不适用

    使用 OAuth 登录

    在你的电脑上运行,改用本地设置

  • … 尚未检查

    工具描述中没有隐藏指令

    它在你的电脑上运行;我们只能读取互联网端点的工具列表

与“数据库与数据集”中的其他服务器比较i

  • 星标数多于此分类中其他 955 个服务器的 0%
  • 发布到注册中心的时间比此分类中其他 955 个服务器的 98% 更新
  • 基础检查结果等于或优于此分类中其他 955 个服务器的 100%

与注册中心里这个分类中所有活跃的服务器比较。只有当发布者拥有该仓库时,星标数才计入。

常见问题

pgbrake 安全吗?

它在 1 项适用的基础检查中通过了 1 项。我们没有阅读代码。在添加密钥或令牌之前,请先看看这个服务器要求哪些权限,并使用只具备所需权限的密钥。

它需要哪些密钥或代码?

你需要填写:PGBRAKE_DSN

它在我的电脑上运行还是在云端?

它在你的电脑上运行。你的 AI 应用会在需要时启动它,数据不会经过作者的服务器(除非它自己调用在线服务)。

它还在维护吗?

GitHub 仓库最后更新于–,最新版本(0.3.0)于昨天进入注册中心。

哪些应用可以使用它?

支持 MCP 的应用,例如 Claude Desktop、Claude Code、Cursor 和 VS Code。你的电脑上还需要有 Python (uv)。

有什么可以替代它?

同一分类中有:Supabase, MongoDB MCP Server, Elasticsearch MCP Server

替代选择

同一分类中其他作者的服务器,按星标数排序。

如何看卡片:★ GitHub 星标i三大支柱:评价 · 检查 · 使用情况i更新 = 最新版本发布到注册中心的时间i

Supabase

作者:supabase

MCP server for interacting with the Supabase platform

电脑或云端★ 2,993Apache-2.0昨天更新
安装

MongoDB MCP Server

作者:mongodb-js

MongoDB Model Context Protocol Server

在你的电脑上运行★ 1,157Apache-2.03天前更新
安装

MCP server for interacting with Elasticsearch

在你的电脑上运行★ 315Apache-2.014个月前更新
安装

作者的 README

打开 README

按原文从作者的仓库复制。PopNx MCP 没有审查或背书其内容。HTML、图片和脚本已被移除。链接会离开本站。

pgbrake

An undo button for your database when an AI agent is driving.

pgbrake is a local MCP server that sits between Claude Code / Codex / Cursor and your Postgres. Every write the agent makes gets a change id you can reverse with one command. Risky SQL waits for a human. Everything is logged. Nothing leaves your machine.

agent> DELETE FROM users WHERE created_at < '2025-01-01'

pgbrake> held: DELETE would touch 4,812 rows (limit 100) — approval apv_3f9c21aa

agent> DELETE FROM users WHERE id = 42 pgbrake> 1 row affected; undo with change id chg_8e01b7d2

you$ pgbrake undo chg_8e01b7d2 undid delete on "users": 1 row(s) restored

Why

Claude Code checkpoints rewind files, not databases. Client-side permission prompts and hooks can be skipped or misfire for MCP calls, and a tool's own "destructive" label is just a hint. pgbrake enforces its rules inside the server, so they hold no matter which agent or client calls it.

What it does (free, MIT)

  • Real SQL parsing (the Postgres parser via pglast), not regex.
  • Held for approval: DDL (DROP, ALTER, TRUNCATE...), UPDATE/DELETE without WHERE, any write over the row limit (default 100), upserts and MERGE.
  • Never allowed: ALTER SYSTEM, role/database creation and drops, COPY ... PROGRAM, DO blocks.
  • One-command undo: before each UPDATE/DELETE, the affected rows are saved locally; inserts are tracked by primary key. Undo refuses if the rows changed since, unless you --force.
  • Approval only by a human: in the client's own prompt (MCP elicitation) or pgbrake approve in an interactive terminal. Approvals are one-shot, expire in 15 minutes, and are bound to the exact SQL.
  • Audit log of every statement, decision and row count, in ~/.pgbrake/journal.db.
  • Multi-statement calls run in one transaction: all or nothing.

Install

pip install pgbrake      # or: uvx pgbrake serve

Claude Code:

claude mcp add pgbrake --env PGBRAKE_DSN="postgresql://me@localhost/app" -- uvx pgbrake serve

Codex (~/.codex/config.toml):

[mcp_servers.pgbrake]

command = "uvx" args = ["pgbrake", "serve"] env = { PGBRAKE_DSN = "postgresql://me@localhost/app" }

Then remove any other database MCP / psql access from the agent, so pgbrake is the only way in. In Claude Code, add "Bash(psql:*)" and "Bash(pgbrake approve:*)" to permissions.deny.

Commands

pgbrake pending            # SQL waiting for you

pgbrake approve # approve (interactive terminal only) pgbrake deny pgbrake changes # undoable changes pgbrake undo # reverse one pgbrake log # audit log

Settings (env)

VariableDefault
PGBRAKE_DSN—connection string (falls back to DATABASE_URL)
PGBRAKE_MAX_ROWS100writes touching more rows need approval
PGBRAKE_ALLOW_DDL0set 1 to let schema changes through (still logged)
PGBRAKE_READ_ONLY0set 1 to refuse every write
PGBRAKE_STATEMENT_TIMEOUT_MS15000
PGBRAKE_JOURNAL~/.pgbrake/journal.db

Limits

  • Undo covers rows changed through pgbrake. It is not a backup: keep real backups.
  • TRUNCATE, DDL, upserts and MERGE are held for approval but cannot be undone.
  • Updating a table with no primary key needs approval and cannot be undone.
  • The free version keeps the last 20 undoable changes.

Pro

$29 one-time for the first 100 licenses (then $39). No subscription. 14-day refund. [Buy pgbrake Pro](https://lexang.github.io/#pricing)

  • Migration guard for agent terminal commands. A Claude Code PreToolUse hook catches prisma migrate reset --force, drizzle-kit push --force, alembic downgrade base and friends, takes a pg_dump snapshot first (when PGBRAKE_DSN is set), checks pg_restore can read it, then asks you. If the snapshot fails, the command is blocked instead (override with PGBRAKE_ALLOW_NO_SNAPSHOT=1). Set PGBRAKE_VERIFY_RESTORE=1 to also restore the snapshot into a throwaway database and compare table counts before you're asked; if that restore fails, the command is blocked. The drill needs CREATEDB rights (or PGBRAKE_DRILL_DSN pointing at a server where it has them) and takes about as long as a restore. Install with pgbrake install-hook.
  • Unlimited undo history (free keeps the last 20).
  • Audit export: pgbrake log --export csv|json.

After paying you land on a page that shows your key. Activate it once:

pgbrake license <your-key>     # or set PGBRAKE_LICENSE

Keys are verified offline; pgbrake never phones home.

问 PopNx