NeonNeon + CHION

Neon Postgres text-to-SQL
with the executed SELECT beneath the chart

Neon's own MCP server drives your Neon account from an agent session, and Neon documents it executing queries and applying schema changes on a temporary branch too. Chion is Neon Postgres text-to-SQL on the analysis side. Connect it to any branch read-only, ask "weekly active users on main?", and Chion generates a SELECT, runs it through the application validators, caps the result at 1,000 rows, and renders the chart with the executed SELECT beneath it.

  • One read-only connection per Neon branch
  • The executed SELECT beneath the chart, capped at 1,000 rows

Read-only SELECT · 1,000-row cap · AES-256-GCM vault · one connection per branch

Each Neon branch carries its own endpoint, so Chion holds staging and main as separate read-only connections and answers on either as an AI analyst for your Postgres. The branch password is sealed in an AES-256-GCM vault and each answer stops at 1,000 rows. Teams ask branch-shaped questions here: "activation funnel by week on the staging branch", "MRR by plan on main", the kind of follow-up thread analytics in conversation is for. Save one of those queries and Chion compiles it into a reusable SQL skill for Claude Code or Codex, which is how a SQL workforce keeps its work. The same setup runs on any PostgreSQL provider.

Point Chion at one Neon branch at a time

What changes when your PostgreSQL is serverless and branch-based.

Analyze a staging branch without touching production

Each Neon branch has its own host. Create one Chion connection per branch, typically a staging branch off main, so analytics on staging never touch production data.

Read-only by code, not by promise

Every query is a code-validated SELECT capped at 1,000 rows.

Cold starts on scale-to-zero

A Neon compute scales to zero after inactivity, so the first query on an idle branch waits for the compute to start. Turn scale to zero off on that compute when the first query has to start right away. Neon documents the current resume behavior.

Pooled vs direct connections

Toggle connection pooling in the Connect modal. Chion works with either the pooled or the direct endpoint; pick pooling for high-concurrency branches.

Copy-on-write resets and PITR

Branches are copy-on-write. A branch reset reverts to the parent's state at branch-creation time; use point-in-time restore on the parent for a more recent snapshot, then refresh the connection in Chion.

A free Neon project connects the same way

Chion connects to a free Neon project exactly as it connects to a paid one. The compute a question uses counts against Neon's current plan limits. See how Chion compiles a code-validated SQL pipeline and the read-only security model.

A saved query compiles into a portable SQL skill

Save a query a reviewer has checked and Chion compiles it into a skill you run in Claude Code or Codex. The skill travels with the query text and its context. The branch connection stays on your side, so each runtime still needs its own access path.

Example question & SQL

See what Chion generates from a plain-English question.

You ask

"Show me signup trends by week for the last 3 months"

Chion generates

SELECT
  date_trunc('week', created_at) AS week,
  COUNT(*) AS signups
FROM users
WHERE created_at >= now() - interval '3 months'
GROUP BY 1
ORDER BY 1;

Create a read-only Postgres role

Run this once before you connect. Chion enforces read-only at the SQL validator, but a least-privilege role is the canonical pattern.

CREATE ROLE chion_read LOGIN PASSWORD '<strong-password>';
GRANT CONNECT ON DATABASE <dbname> TO chion_read;
GRANT USAGE ON SCHEMA public TO chion_read;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO chion_read;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
  GRANT SELECT ON TABLES TO chion_read;

Replace <dbname> with your database name. The ALTER DEFAULT PRIVILEGES line ensures new tables are auto-readable.

Connection string format

Reference for parsing. Chion accepts the six fields directly, no string concatenation needed.

postgresql://chion_read:<password>@ep-<id>.<region>.aws.neon.tech/neondb?sslmode=require

Finding your Neon credentials

Project Dashboard → Connect button

FieldWhere to FindDefault
Server (Host)Connect modal → displayed in connection stringep-<name>-<id>.us-east-2.aws.neon.tech
PortConnect modal5432
DatabaseConnect modal · selectable dropdownneondb
SchemaNot in UI; default is publicpublic
User (Role)Connect modal · selectable dropdownneondb_owner
PasswordShown in the connection string in the Connect modal(always visible in modal)

Quick steps

  1. 1.Log in at console.neon.tech
  2. 2.Select your project
  3. 3.Click the Connect button on the Project Dashboard
  4. 4.The "Connect to your database" modal opens
  5. 5.Select your Branch, Compute, Database, and Role from dropdowns
  6. 6.All connection parameters including password are displayed in the connection string
  7. 7.Toggle Connection pooling on/off to switch between pooled and direct connections

Password is always visible in the Connect modal; no need to reset.

Open Neon console

Neon troubleshooting

Common issues and how to fix them.

Serverless resume delay

The branch compute has scaled to zero, so your first query is waiting on a restart rather than running slowly. Wait it out, or turn scale to zero off for that compute in the Neon console. Neon's scale-to-zero documentation, linked below, carries the current behavior.

Branch confusion: wrong data

Neon uses branches. Make sure you selected the correct branch in the Connect modal before copying credentials. Each branch has its own endpoint hostname.

Connection pooling toggle

In the Neon Connect modal, toggle "Connection pooling" on for pooled connections or off for direct. Chion works with both modes.

Branch reset lost recent data

Neon branches use copy-on-write. Resetting a branch reverts it to the parent's state at branch-creation time. Use point-in-time restore (PITR) on the parent if you need a more recent state.

Official Neon documentation

Authoritative references from the provider. Opens in a new tab.

Your credentials are encrypted

The password for the Neon branch role is sealed in an AES-256-GCM envelope. Plaintext is decrypted into memory for a single request, held for at most 60 seconds or five reads, then purged. Chion connects read-only, and a generated statement that is not a single read-only SELECT never reaches the branch. The grants and row-level security on that branch role decide which rows an answer can contain.

Read the full security model

Frequently asked questions

Common questions about using Chion with Neon.

Can I connect Chion to a Neon branch?
Yes. Each Neon branch has its own endpoint. Select the branch you want in the Connect modal and copy those credentials into Chion.
Does Chion work with Neon's free tier?
Yes. Chion connects to a free Neon project the same way it connects to a paid one. The compute your questions use still counts against Neon's current plan limits, which Neon publishes.
What is the default database name on Neon?
The default database is "neondb". You can verify this in the Connect modal's database dropdown.
Does Chion support Neon point-in-time restore?
Indirectly. PITR happens on Neon's side; Chion just queries whatever state the branch is in. After a PITR, refresh the connection in Chion if results look stale.
Can I use Neon branches for staging vs production?
Yes, and it is the recommended pattern. Create a "staging" branch off "main", connect Chion to staging for testing, then point at the main branch for production analytics. Each branch has its own credentials.
Do I need the Neon MCP server to query Neon in natural language?
No. Neon's own server executes queries and applies schema changes on a temporary branch as well as managing projects and branches, so it is the right tool when the job is driving Neon itself from an agent session. Chion is the analysis side: it generates a read-only SELECT, validates it in code, caps the result at 1,000 rows, renders the chart, and lets a reviewer save the query. Chion then compiles the saved query into a skill for Claude Code or Codex. Check Neon's MCP documentation for what its server exposes today.

Other PostgreSQL providers

Chion connects to Neon, Supabase, Amazon RDS, Google Cloud SQL, and Azure Database for PostgreSQL.

Ready to connect your Neon database?

Open Chion, enter your credentials, and start asking questions in plain English.

Start your 7-day trial