What this thread does
The problem in plain words
Seed data hides what real rows do to a migration (nulls, duplicates, size). You want the agent to try the change on a disposable copy, look at the result, and only then apply it for real.
What Neon's official skill says
The neon-postgres-branches skill (neondatabase/agent-skills, Apache-2.0, commit 51c7d594c0, read October 2026; Neon is a vendor):
- Pick the branch type first. A normal branch for realistic migration and query testing with real data; a schema-only branch (marked Beta) when you need structure without copying sensitive rows. If unclear, the agent should ask: realistic data or only structure?
- Tool order. Default to the Neon CLI (
neon --version,neon projects list,neon auth). Use the MCP server only if the CLI is unavailable, cannot authenticate, or you ask for it; if neither works, the REST API. - MCP flow. Create the branch with branch tools (
create_branch), validate with read tools (describe_branch), and for migrations prefer branch-based flows before applying to main. The skill also covers resetting a branch from its parent and branch expiry for CI.
Neon's MCP docs describe applying schema changes on a temporary branch, schema comparison, and read-only diagnostics, and say: use MCP for development and testing, not production; review actions before they run; avoid production or PII data; allowlist two IP addresses if IP Allow is on. Checked 2026-11-17: the old HTTP+SSE endpoints have been retired and respond with 410 Gone, so use the hosted https://mcp.neon.tech/mcp; the local stdio package @neondatabase/mcp-server-neon is deprecated. Setup command named there: npx neon@latest mcp.
The workflow
1. Branch from main (normal branch if the data is safe to copy). 2. Point the agent at the branch's connection string only. 3. Apply the migration there; run the app's tests and a few checks on row counts and constraints. 4. Review the generated SQL (look for DROP, TRUNCATE, table rewrites). 5. Apply to main through your normal deploy path; delete the branch.
Wording to give your agent
"Create a Neon branch from main named after this change. Use only that branch's connection string. Apply the migration there, run the tests, and report row counts and any errors. Do not touch the main branch or run anything against it; I will apply the reviewed SQL myself."
Other platforms
Supabase and others have similar branching; I only read Neon's material. For read-only database inspection by an agent see the existing Postgres access comparison thread.
Caveats
Vendor documentation; I did not run the CLI or MCP flow. A copy of production data is still production data: use schema-only for sensitive data. This thread has no community report beyond the vendor's own skill; r/PostgreSQL posts about staging-versus-production migration surprises are the demand signal.
Primary source
Primary sources: the neon-postgres-branches SKILL.md (Neon, neondatabase/agent-skills, Apache-2.0 licence) and the Neon MCP server docs (Neon). Checked: normal versus schema-only (Beta) branch and the clarifying question, CLI first then MCP then API order, create_branch and describe_branch flow, expiry and reset coverage; MCP guidance for development and testing only, no production or PII data, IP allowlist, SSE endpoint ending on or after 1 October 2026 with 410 Gone, deprecated stdio package, and the npx neon@latest init, plugins and mcp options. Star count not verified.
Started from a post by @neondatabase, packaged by the editor. Original post