Branch-per-PR Databases is a devops workflow that chains Neon + GitHub to automate a common task. Each PR gets its own Neon database branch for isolated testing. Branch is deleted automatically when the PR closes. Once configured, it saves ~6 hours/week per team, plus recovery of ~20% of engineering capacity lost to test data conflicts and runs through Claude Code, Cursor, Windsurf or any MCP-compatible AI agent.
Each PR gets its own Neon database branch for isolated testing. Branch is deleted automatically when the PR closes.
Hosted execution needs every MCP on the whitelist. Use the local CLI for this recipe until the missing MCPs are added.
Not yet hostable:
mcpizy recipe install neon-github-branch-databasesNeon's branching creates isolated database snapshots in seconds, and GitHub events tell you exactly when a PR opens or closes. Together they bring Git-style isolation to your database layer — every PR tests against its own data, completely independent of staging or other PRs.
All PRs test against a shared staging database. Developers step on each other's data, migrations conflict, and test data pollutes staging indefinitely.
Every PR gets its own clean database branch, injected automatically. Deleted when the PR closes. Zero coordination needed.
Concrete ROI — not marketing fluff.
Time saved
~6 hours/week per team, plus recovery of ~20% of engineering capacity lost to test data conflicts
This prompt is the workflow. Paste into Claude Code, Cursor, or Windsurf.
You are a branch-database agent. Runs on GitHub pull_request events.
On pull_request opened:
1. Call neon.create_branch(project_id, parent="main", name="pr-${pr_number}") — capture connection_uri
2. Call neon.run_migrations(branch_id, dir="./supabase/migrations") to seed schema
3. Call github.add_pr_comment with "DB branch ready — DATABASE_URL=<uri>" (mask credentials)
4. Inject DATABASE_URL as repo secret or PR env via github.update_action_secret
On pull_request closed or merged:
5. Call neon.delete_branch(project_id, branch_name) to reclaim storage
Always idempotent: if branch exists, reuse it. Never leave orphaned branches.How this workflow fires and what env vars you need.
POST /webhook/github (events: pull_request opened, closed, synchronize)
Install everything — MCPs, prompt, env template — in a single call.
$ mcpizy recipe install neon-github-branch-databases ✓ Installs all 2 MCP servers ✓ Writes prompt to ~/.mcpizy/prompts/neon-github-branch-databases.md ✓ Generates .env.example in current directory ✓ Ready to paste into Claude Code
Requires mcpizy CLI v1.1+ — install via npm i -g mcpizy.
$ mcpizy install neon && mcpizy install githubEvery push to main triggers a Supabase migration automatically. Schema diffs are committed and applied with zero manual steps.
Open a PR and a Vercel preview URL appears as a comment within minutes. Branches are cleaned up automatically when PRs close.
Build, tag, push to ECR and deploy to ECS in one automated pipeline triggered by a git tag or manual dispatch.
A Linear issue assigned to a developer automatically creates a git branch, syncs status changes, and opens a draft PR.
Branch-per-PR Databases is a devops automation that uses Neon + GitHub together via the Model Context Protocol. Each PR gets its own Neon database branch for isolated testing. Branch is deleted automatically when the PR closes.
Setup takes around 15 min setup, then fully automated. You install the required MCP servers with `mcpizy install neon && mcpizy install github`, connect your accounts, and the workflow is ready to run.
Once running, this workflow saves ~6 hours/week per team, plus recovery of ~20% of engineering capacity lost to test data conflicts. The concrete business value: Eliminates the 'who broke staging?' Slack threads — every PR has its own DB, zero cross-contamination; Enables true parallel development: 10 engineers on 10 branches without stepping on each other.
You need 2 MCP servers: Neon (mcpizy install neon), GitHub (mcpizy install github). All are installable in one command via the MCPizy CLI and configured in your `.claude.json` or `.cursor/mcp.json`.
Yes. The workflow runs with any MCP-compatible AI agent — Claude Code, Claude Desktop, Cursor, Windsurf, VS Code with Copilot, and custom agents built on the MCP SDK. The MCP servers are identical across clients; only the config file path (`.claude.json` vs `.cursor/mcp.json`) changes.
Install the required MCPs from the marketplace and automate this in 15 min setup.
$ mcpizy install neon && mcpizy install github
Free to install. Connect your accounts and this workflow runs itself.