dryrun — Claude Code MCP server: PostgreSQL schema without a live DB
Hands your AI assistant the shape of a PostgreSQL database from a committed snapshot. No connection string, no credentials.
claude mcp add dryrun -- npx -y @boringsql/dryrunWhat dryrun does
dryrun ships as a CLI plus an MCP server. The CLI connects to PostgreSQL once, walks the catalog — tables, indexes, constraints, partitions, functions, enums, RLS policies, triggers, extensions — and writes a snapshot to .dryrun/history.db. Everything after that runs offline: linting against naming and type conventions, duplicate index and circular FK detection, and migration analysis that reports which locks a DDL statement will take.
The MCP server reads the same snapshot and exposes 9 tools over stdio or SSE: schema search, query validation, plan analysis, migration checks, linting, vacuum health, and top queries captured from pg_stat_statements. Connect a live database and three more appear — explain_query, check_drift, columnar_report. Commit the snapshot to the repo and one person with database access can hand the whole team full schema context.
PostgreSQL 14 or newer is required. Older servers aren't rejected outright, but dryrun warns and skips what it can't read — planner stats in particular. Install via Homebrew, npm, or build from source with Go 1.26+; prebuilt binaries cover macOS, Linux and Windows x64.
What it helps with
- check whether a migration will lock your busiest table
- spot foreign keys missing an index
- verify column references in SQL against the real schema
- give an AI agent schema context without production credentials
- diff schema and planner stats between two snapshots
Example prompts for the agent
- Check the snapshot and tell me if this migration is safe on PostgreSQL 16
- Lint the schema and list tables without a primary key
- Find duplicate indexes in the schema
How to install dryrun
Platform CLI
claude mcp add dryrun -- npx -y @boringsql/dryrunPlatform CLI
codex mcp add dryrun -- npx -y @boringsql/dryrunConfig file
{
"mcpServers": {
"dryrun": {
"command": "npx",
"args": [
"-y",
"@boringsql/dryrun"
]
}
}
}Config file
{
"servers": {
"dryrun": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@boringsql/dryrun"
]
}
}
}Platform CLI
gemini mcp add dryrun npx -y @boringsql/dryrunStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about dryrun
How do I install dryrun in Claude Code?
Run claude mcp add dryrun -- npx -y @boringsql/dryrun. Node has to be present so npx can fetch the binary.
What does dryrun do?
It captures a PostgreSQL schema into a file and serves that file to an AI assistant as tools: schema search, query validation, plan and migration analysis, linting.
Does the MCP server need database access?
No. It works off the snapshot. A live connection is only needed for explain_query, check_drift and columnar_report.