Supabase
Your Postgres, within reach of the agent
Let your AI read and write your database
Supabase-managed Postgres — with read-only mode for critical production.
Supabase is the most popular open-source alternative to Firebase: managed Postgres, auth, storage, realtime, edge functions — all under one dashboard. The official connector exposes tools across 8 categories (Account, Database, Knowledge Base, Development, Edge Functions, Debugging, Branching, Storage), letting the agent read schemas, execute SQL, apply migrations, generate TypeScript types and deploy edge functions.
Ask "how many users signed up last week?" and it writes the SQL, runs it, returns the number. Ask "create a new table for invitation tracking" and it drafts the migration SQL — "SQL passed to this tool will be tracked within the database, so LLMs should use this for DDL operations", per the official README.
What you can ask
- "List the tables in the
publicschema with their columns and types — I need to understand the structure before doing an analysis." - "How many active users did we have in the last 30 days, grouped by country."
- "Generate the migration to add a
subscription_tiercolumn to theuserstable with default 'free'."
Read-only mode (recommended for production)
The server supports an officially documented read-only mode: "all queries execute as a read-only Postgres user, disabling mutating tools entirely." It's the safe way to let the agent analyze production without risk of accidental UPDATEs/DROPs.
To enable it, pass --read-only to the server or use a read-only Postgres role in your project. Ideal for dashboards, analysis and debugging; only enable write mode in development projects.
What token you need
You need a Supabase Personal Access Token (PAT) — the server operates "under the context of your developer permissions" via this PAT. Different from the service_role or anon key of your project.
- Go to supabase.com/dashboard/account/tokens.
- Click "Generate new token". Name it something like "Terminal Sync — Claude".
- Copy it (you only see it once) and paste it when the Lab asks for
SUPABASE_ACCESS_TOKEN. Encrypted in your Keychain.
The PAT's scope is your Supabase account: the agent can see every project where you're owner/member. For critical production, we recommend a separate Supabase project as an "agent sandbox", or a dedicated account.
We open the app and set it up in Claude Code (and your other Macs).
How it works with Terminal Sync
Set up the connector once on one machine. Terminal Sync keeps your claude_desktop_config.json encrypted in your Drive, so on any other machine where you open Claude Code, the connector is already there.