- How to connect Claude Code to Supabase to build apps with a database, authentication, and row-level security (RLS) fast. A practical guide with examples.
Supabase exposes an official MCP server, so Claude Code can read your schema, run SQL, and manage your database directly.
Claude Code and Supabase together let you build an application with a database, authentication, and permissions, quickly and without writing all the SQL by hand. Claude connects to Supabase via MCP, reads the schema, and performs database operations in natural language. Here's how.
Why Does This Combination Work So Well?
Claude Code is an agent that executes tasks within a project. Supabase is managed Postgres with authentication, storage, and an automatic API. Connect the two, and Claude can build your entire backend, tables, security policies (RLS), and queries, all through conversation.
How to Connect (via MCP)
Supabase offers an official MCP server. Add it to Claude Code and Claude can:
- Read your database schema
- Create tables and migrations
- Configure Row Level Security
- Run queries and analyze data
claude mcp add --transport http supabase https://mcp.supabase.com/mcp
Example: Building a Leads Table
Ask Claude in natural language: "Create a leads table with name, email, and RLS that allows inserts only." Claude writes the SQL, explains the policy, and runs it through the MCP.
Important Tips
- Security first: Make sure RLS is enabled before exposing a table.
- Documented migrations: Save the SQL in files, not just as one-off runs.
- Secret keys: The service role stays server-side only.
See also Claude Code with GitHub and 10 Recommended MCP Servers.
The Next Step
Want to see how Supabase fits into a complete system alongside GitHub, Vercel, and Resend? The guide to building SaaS and systems with Claude Code walks through the entire process, from spec to paying customer.
New to Supabase? Start with the complete Supabase guide: what it offers, what it costs, and who it's right for.
Looking to build a system or automate an AI-driven process based on Supabase in your organization? We offer end-to-end implementation guidance. Talk to us.

