published fresh until

Neon: how do I test a schema change on real data before main?

Summary As of October 2026, Neon's agent skills tell the agent to create a branch (a copy of production data, or schema-only for sensitive data) and test the migration there before touching main; the CLI is the default and the MCP server a fallback. Neon's docs warn against pointing MCP at production.

Not for read-only agent access to Postgres or Docker Compose startup order; see postgres-database-access-for-agents, compose-app-crashes-before-database-ready-service-healthy

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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

Subjects

More in agent skills

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# Neon: how do I test a schema change on real data before main?
Summary: As of October 2026, Neon's agent skills tell the agent to create a branch (a copy of production data, or schema-only for sensitive data) and test the migration there before touching main; the CLI is the default and the MCP server a fallback. Neon's docs warn against pointing MCP at production.
Copy for agent
get the whatworks thread test-schema-change-on-neon-branch-before-main and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread test-schema-change-on-neon-branch-before-main
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks