db-branch

Instant database branches for MySQL and PostgreSQL with MCP for agents

Visit website →

About

db-branch is an open-source tool that creates copy-on-write branches of MySQL and PostgreSQL databases in seconds, built on ZFS clones. Each branch is an independent copy with zero bytes copied at creation time.

It is designed for AI agent sandboxes and CI workflows. Every agent or pull request gets its own database branch in seconds, can run risky queries or migrations on it, and discard it afterward. A built-in MCP server lets LLM agents create and query branches directly.

The tool supports Raft clustering with ProxySQL routing, per-branch version upgrades with automatic rollback, instant checkpoints, and scheduled base refresh. One interface covers the CLI, REST API, web console, and MCP server.

The core is Apache-2.0 licensed with free and paid extension modules for auth, audit, history, diff, and data masking. There is no hosted or cloud version.

AI-assisted draft, human-reviewed before publishing — see how we choose & review tools.

Why we picked it

The problem of branching large databases for development and AI agents is real: every agent needs an isolated environment, and copying a multi-gigabyte database takes minutes. db-branch solves this in seconds with zero copies, and the built-in MCP server makes AI agent integration native. A rare infrastructure tool designed for agents from day one.