Back to Blog

How to Connect ChatGPT to PostgreSQL with MCP

Step-by-step: connect ChatGPT to PostgreSQL via MCP. Developer Mode, Synra endpoint, connection strings for Neon, RDS, Railway, Supabase. Read-only by default.

People already ask ChatGPT for numbers. Those numbers usually sit in PostgreSQL — Neon, RDS, Railway, Supabase, or a server you run. Without a live link, someone exports a CSV, pastes it in, and hopes the file matches what's in the DB.

With MCP, ChatGPT can run SELECTs against that Postgres and answer from the result set. This post covers the Postgres path: where to get the URI, SSL, schemas, and ChatGPT's Developer Mode. MySQL or SQL Server? Use the generic ChatGPT database guide. New to MCP? What is an MCP server.

Why bother with Postgres specifically

Ops and product questions — signups, orders, subscriptions, ticket tables — often live in Postgres, and the person asking lives in ChatGPT. Connect them once and "break that down by week" hits the database again instead of another export.

Still use staging or a replica before production. Staging First if you don't have that yet.

What you need

  • Paid ChatGPT with Developer Mode on the web app (Plus / Pro / Business / Enterprise / Education). Availability has moved during the beta; no toggle usually means plan or region.
  • A Postgres connection string (or host / port / db / user / password). Format:
postgresql://username:password@host:port/database

Many hosts append ?sslmode=require — keep that.

  • A Synra account — stores the Postgres credentials and gives ChatGPT one HTTPS MCP URL.

OpenAI renamed "connectors" to "apps" in late 2025. The UI may use either word. Same thing: a custom remote MCP server.

Where to get the Postgres URI

  • Neon — Project → Connect → copy the string for the branch you want (prefer staging / a dedicated AI branch, not production main). Details: Connect Cursor to Neon — same string, different client.
  • Supabase — Project Settings → Database → Connection string → URI. For Synra, prefer the direct connection (port 5432) over the pooler (6543). Or use the Supabase connector in Synra if you have the project URL + key path: Connect Cursor to Supabase.
  • Railway — Postgres service → VariablesDATABASE_URL.
  • AWS RDS — Connectivity endpoint + assemble postgresql://user:pass@endpoint:5432/dbname. Enable SSL if the instance requires it.
  • Render / DigitalOcean — Database → external connection string.
  • Local Docker — fine for a smoke test if Synra can reach the host (usually it can't reach localhost on your laptop — use a cloud staging DB for ChatGPT).

Step 1 — Save Postgres in Synra

  1. Sign in at mcpserver.design (7-day Solo trial is enough to test)
  2. ConnectionsAdd new connection
  3. Choose PostgreSQL (or Neon / Supabase labels — same Postgres backend)
  4. Paste the URI or fill host / port / database / user / password
  5. Test connectionSave

Credentials stay encrypted in Synra. ChatGPT only gets the MCP endpoint URL, not the DB password.

SSL errors on test? Add ?sslmode=require and try again. Neon, Supabase, and most managed hosts need it.

Step 2 — Copy the MCP endpoint

Endpoints tab → URL like:

https://app.mcpserver.design/api/mcp/aB3xY7zQ9mNpLkRv2wTs

Treat the trailing token like a password. Anyone with the URL can read that connection. Rotate from the same screen if it leaks. More on that: Treat your MCP endpoint like a password.

Step 3 — Enable Developer Mode in ChatGPT

  1. ChatGPT web → profile → Settings
  2. Apps & Connectors (older builds: Connectors)
  3. Advanced settings → turn Developer mode on
  4. Accept the third-party warning

No toggle → plan/region limit. Don't chase a missing menu in the mobile app; setup is web-only.

Step 4 — Add Synra as a custom connector

  1. Settings → Apps & ConnectorsCreate / Add custom connector
  2. Fill in:
    • Name — e.g. Synra Postgres or Staging Postgres
    • Description — ChatGPT reads this when picking tools. e.g. Read-only PostgreSQL. Schema, tables, and SELECT on our staging database.
    • MCP Server URL — your Synra endpoint
    • AuthenticationNo authentication (the URL token is the auth)
  3. Confirm trust → Create

If it worked, you'll see tools like list_tables, describe_table, query_table, execute_sql. If not: MCP troubleshooting.

Step 5 — Ask in a chat

  1. New chat → + in the composer
  2. MoreDeveloper mode (or pick the app directly)
  3. Select your Synra Postgres connector

Try:

  • "List schemas and tables in this Postgres database."
  • "Describe the public.users table — columns and types."
  • "How many rows in orders where created_at is in the last 7 days?"
  • "Which tables have a foreign key to users(id)?"

ChatGPT writes the SQL, Synra runs it read-only, and the rows come back into the chat. After you change schema, hit Refresh on the connector in Settings so discovery isn't stale.

Habits that save time on Postgres

Name the connector by environment. Staging Postgres or Prod replica — not a bare Database — especially once you have two.

Say the schema. Tables under analytics or app won't show up if ChatGPT assumes public. Put the schema in the first message or in the connector description.

SELECT-only DB user. Synra blocks writes at the gateway; a least-privilege role is belt-and-suspenders. Why read-only matters.

Staging or replica for ChatGPT. Query results go to OpenAI so the model can answer — same exposure as pasting a result set. When not to connect if you're still deciding.

Security

  • Gateway read-only by default
  • DB password stays in Synra; ChatGPT only sees the endpoint URL
  • Audit log of every statement
  • Rotate the endpoint if the URL lands in Slack or a screenshot

Self-hosting instead? ChatGPT can't hit localhost — you need public HTTPS (tunnel or host). Managed URL is less work for most people: self-hosted vs managed.

Troubleshooting (ChatGPT + Postgres)

No Developer mode. Paid plan + web app. Not a Synra issue.

"Doesn't implement our specification." Developer mode off, or you created the connector on the wrong path. Re-enable the toggle and recreate under Developer mode.

Tools greyed out / none found. Refresh the connector. Test the connection in Synra. Recopy the full endpoint URL (truncation is common).

SSL / "connection requires SSL". Fix the URI in Synra with sslmode=require, re-test, then Refresh in ChatGPT.

Wrong or empty tables. You're on the wrong database/branch, or ChatGPT is looking at public while your tables aren't there — say the schema name explicitly.

Full client checklist: MCP troubleshooting.


URI into Synra, Developer Mode on, paste the endpoint, ask a question against real rows.

7-day trial at mcpserver.design — connect staging Postgres, run the smoke questions above, then decide whether to invite anyone else.

Related reading: