BD

boringsql/dryrun

Developer tools公式

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

36 stars 4 forks 品質 83 トレンド 32BSD-2-Clause

PostgreSQL schema intelligence MCP server with offline linting, migration safety, query validation for AI coding assistants.

概要

The PostgreSQL MCP server that doesn't need connection to the production. dryrun gives AI agents, IDEs, and CI full schema awareness. From offline snapshot, not live database connection. Lint your schema, validate queries, check migration safety, and explore foreign key graphs. All without credentials leaving the DBA's machine. dryrun is part of the boringSQL suite alongside RegreSQL and Fixturize. LLM/AI coding assistants are very good in writing code/SQL queries. But they are blind. They don't know your schema, your indexes or your constraints. They might generate a migration that takes an ACCESS EXCLUSIVE lock on your busiest table and send your app down. Some PostgreSQL MCP server ask you for the database connection. And to perform the administrative tasks you might need SUPERUSER permission. But that's like asking for problem. We've already seen where this leads: production databases wiped by AI agents, and SQL injection in MCP servers that were supposed to be read-only.

README

以下は原文 README の抜粋です。原文を見る。

DryRun PostgreSQL MCP

The PostgreSQL MCP server that doesn’t need connection to the production.

dryrun gives AI agents, IDEs, and CI full schema awareness. From offline snapshot, not live database connection. Lint your schema, validate queries, check migration safety, and explore foreign key graphs. All without credentials leaving the DBA’s machine.

dryrun is part of the boringSQL suite alongside RegreSQL and Fixturize.

The problem

LLM/AI coding assistants are very good in writing code/SQL queries. But they are blind. They don’t know your schema, your indexes or your constraints. They might generate a migration that takes an ACCESS EXCLUSIVE lock on your busiest table and send your app down.

Some PostgreSQL MCP server ask you for the database connection. And to perform the administrative tasks you might need SUPERUSER permission. But that’s like asking for problem.

We’ve already seen where this leads: production databases wiped by AI agents, and SQL injection in MCP servers that were supposed to be read-only.

The model doesn’t need to query your database. It needs to understand your schema: the structure, constraints, statistics, and version-specific behavior. That knowledge is structural. It changes when you deploy a migration, not between queries.

DryRun features

dryrun is two things: a CLI tool and an MCP server. The CLI extracts and analyzes your schema. The MCP server exposes that analysis to AI assistants. They’re separate on purpose.

CLI - extract and analyze

The CLI connects to your PostgreSQL database, introspects the full catalog (tables, views, indexes, constraints, partitions, functions, enums, RLS policies, triggers, extensions, GUCs), and writes a snapshot into .dryrun/history.db. That snapshot is the source of truth for everything else.

Once you have the snapshot, the CLI works offline:

  • Lint - 20+ convention rules (naming, types, primary keys, timestamps, partitioning) and 13 structural audit rules (duplicate indexes, FK coverage, circular FKs, vacuum tuning)
  • Migration safety - lock type analysis, duration estimates, table rewrite detection, safe alternatives for each DDL statement
  • Query validation - SQL parsing via libpg_query, column reference checks against the actual schema, anti-pattern detection
  • Snapshot diff - compare schema, planner stats, or activity between snapshots; detect drift against the live database
  • Query stats - captures pg_stat_statements per node, collapses ORM query variants into shapes, diffs two captures to surface new or slowed queries
GitHub で README 全文を見る

インストール

npx -y @boringsql/dryrun mcp-serve
MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

{ "mcpServers": { "dryrun": { "command": "npx", "args": ["-y", "@boringsql/dryrun", "mcp-serve"] } } }