# dryrun

> dryrun is an open-source MCP server for databases. Offline PostgreSQL schema, query-stat and migration-safety server for AI assistants. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI
- **Website:** https://boringsql.com/products/dryrun/
- **Repository:** https://github.com/boringsql/dryrun
- **MCP Registry name:** io.github.boringSQL/dryrun
- **Categories:** databases, developer tools
- **Listing updated:** 2026-11-14

## About

Where many Postgres MCP servers want a live connection, dryrun reads a committed snapshot instead. Someone with database access runs dryrun init once, which captures the catalogue and pg_stat_statements into a local history database. After that, agents, IDEs and CI runners work offline without a connection string or credentials.

The site says it works with RDS, Aurora, Cloud SQL, AlloyDB, Azure Database for PostgreSQL, Neon and Supabase, installs nothing server-side, and needs only a login role with pg_read_all_data and pg_read_all_stats. It refuses to read through a superuser role unless you insist. Parameter values in captured queries are never stored.

Tools return actions rather than commentary: a corrected query, the safe form of a migration as runnable SQL, join paths and delete order, or a table's CREATE TABLE. Migration checks report lock type, duration and rewrite risk. Linting has 20+ convention rules and 13 structural audits. The site counts 14 offline tools, with three more (live EXPLAIN, drift check, columnar report) when a connection is supplied. dryrun setup writes the config for Claude Code, Cursor, Codex and Zed.

## Features

- **Offline schema snapshots:** Captures the catalogue once so agents never need production credentials.
- **Migration guardrail:** Reports lock type, duration and rewrite risk, with a safer SQL form.
- **Query validation:** Parses SQL and checks columns against the real schema.
- **Linting and audits:** 20+ convention rules and 13 structural checks such as duplicate indexes.
- **Query stats diffing:** Collapses ORM variants into shapes and diffs captures to find slowed queries.
- **One-step agent setup:** dryrun setup writes MCP config for Claude Code, Cursor, Codex and Zed.

## Good for

- Catch an ALTER TABLE that rewrites a busy table during review
- Give a coding agent accurate table, index and constraint context
- Spot unused or duplicate indexes from captured counters
- Compare schema and query workload between two snapshots in CI

## Install

### Claude Code (Terminal)

```sh
claude mcp add dryrun -- npx -y @boringsql/dryrun
```

### Claude Desktop (claude_desktop_config.json)

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

### Cursor (~/.cursor/mcp.json)

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

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "dryrun": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@boringsql/dryrun"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

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

### Other clients (your client's MCP settings (most use this shape))

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

## Tools

- `validate_query`: Returns a corrected query after checking it against the schema.
- `check_migration`: Returns the safe form of a migration as runnable SQL.
- `find_related`: Returns the JOIN and the delete order for related tables.
- `describe_table`: Returns a table's CREATE TABLE.
- `explain_query`: Live EXPLAIN, available when a database is connected.
- `check_drift`: Compares the snapshot against the live database.
- `columnar_report`: AlloyDB columnar report, available with a connection.

## FAQ

### Does it need a database connection?

Not for the offline tools. Three extra tools, live EXPLAIN, drift check and columnar report, register when a connection is given.

### What permissions does the capture need?

A login role with pg_read_all_data and pg_read_all_stats; no superuser.

### Which hosts work?

The site lists RDS, Aurora, Cloud SQL, AlloyDB, Azure, Neon and Supabase.

### Is it open source?

The site describes it as open source.

### Is dryrun free?

Yes. dryrun is open source, so you can use and self-host it for free.

### How do I add dryrun to Claude Code?

Run this command in your terminal: claude mcp add dryrun -- npx -y @boringsql/dryrun

### What are the best alternatives to dryrun?

The closest alternatives to dryrun are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/dryrun
