Connects to any Postgres instance via connection string. The model can list schemas, inspect tables, run SELECT queries, and (with explicit permission) execute writes. Ships with a read-only mode that prevents accidental UPDATE/DELETE.

Query Postgres databases with SQL the model writes for you.

Use Case

"How many active users signed up last week" — model writes the SQL,Schema migrations review: ask Claude to inspect current shape vs target,Debugging slow queries with EXPLAIN ANALYZE without leaving the chat,Generating sample data for tests based on real distributions

When Not to Use

Production databases without read-only mode + connection allow-listing,Very large result sets — output is token-bounded; aggregate first,Non-Postgres SQL dialects (MSSQL, Oracle) — use a different server

Common Pitfalls

  • Connection string in plain JSON — use a separate read-only role, not your superuser
  • Always start in read-only mode for prod; promote to writes only for dev
  • pg_hba.conf on managed PG (Supabase, RDS) often blocks new IPs — allow-list first