
The Problem
You’re building with Supabase. Claude generates a database schema. You copy it. You tab over to the Supabase dashboard, open the SQL editor, paste it in, hit run. You tab back to Claude. “Done, what’s next?”
Fifteen times a day.
Or Claude writes a query but you’re not sure if the table name is right. Dashboard tab. Check the schema. Back to Claude. “Actually, it’s users_profile not user_profiles.”
Or you need Edge Function logs while debugging. Another tab. Another context switch.
Context switching between Claude and Supabase dashboard wastes maybe 15-20% of your development time. Doesn’t sound like much until you realize that’s 2-3 hours a week.
The Solution: Supabase MCP
Supabase MCP is an MCP server that connects Claude directly to your Supabase project. Execute SQL. Design schemas. Check Edge Functions. Deploy migrations. All from chat. No tab switching.
What It Actually Does
Execute SQL Queries
You: "Get the last 10 users and their total orders"
Claude: Writes the query, executes it, shows results
Result: SQL + data, ready to use
Generate & Apply Migrations
You: "Create a comments table with users relationship"
Claude: Generates migration, applies it, confirms schema
Result: Table exists, no manual dashboard steps
Check Edge Function Logs
You: "Why is my auth function failing?"
Claude: Fetches logs, finds the error, suggests fixes
Result: Debugging happens in chat
Manage Database Secrets
You: "Set up Stripe API key for webhooks"
Claude: Creates/updates the secret in your environment
Result: Done, no dashboard needed
Deploy Functions
You: "Deploy this function"
Claude: Deploys to Supabase, returns URL
Result: Function is live
The Real Impact
I tested this with a developer building a SaaS product. Normal workflow:
- Ask Claude for a feature
- Claude writes code
- Tab to Supabase dashboard
- Copy-paste schema
- Execute query
- Tab back
- Continue building
With Supabase MCP:
- Ask Claude for a feature
- Claude writes code AND schema AND executes everything
- Continue building
Workflow goes from 5 minutes per feature to 2 minutes. That’s not just faster—it’s a different experience. You’re actually building in Claude now, not using it as a code suggester.
How to Set It Up
Installation (2 minutes)
Claude Desktop:
- Install Supabase MCP:
npm install -g supabase-mcp
- Add to
~/.claude/mcp.json:
{
"mcpServers": {
"supabase": {
"command": "supabase-mcp",
"args": [],
"env": {
"SUPABASE_URL": "https://your-project.supabase.co",
"SUPABASE_API_KEY": "your-service-role-key"
}
}
}
}
- Restart Claude. Done.
Cursor / VS Code:
Same JSON, different file. For Cursor, add to .cursor/mcp.json in your project root.
Configuration
Restrict to Read-Only (Safer):
{
"env": {
"SUPABASE_READONLY": "true"
}
}
Claude can read everything but can’t execute writes. Good for learning.
Scope to One Database:
{
"env": {
"SUPABASE_DATABASE": "public"
}
}
Limits Claude to one database. Good for shared projects.
Real Examples
Example 1: Building a Comments Feature
You: “Add a comments feature. Users can comment on posts. Show me the schema.”
Claude:
- Creates migration for
commentstable - Adds foreign keys to
usersandposts - Creates indexes on
post_idandcreated_at - Executes the migration
- Returns the schema
Result: Schema is live, no manual steps.
Example 2: Debugging a Query
You: “Why are comments not showing? Users have commented.”
Claude:
- Executes
SELECT * FROM comments WHERE post_id = 123 - Executes
SELECT * FROM posts WHERE id = 123 - Checks the relationship
- Spots the issue:
user_idis NULL - Suggests a WHERE clause to filter
Result: Bug identified in seconds, no dashboard needed.
Example 3: Setting Up Webhooks
You: “Create a webhook for Stripe events. I’ll handle the function logic.”
Claude:
- Creates Edge Function stub
- Sets up
STRIPE_SECRET_KEYin environment - Shows you the webhook URL
- Returns code to handle events
Result: Infrastructure is ready, you write business logic.

What You Actually Need
Supabase API Key - Get from Settings → API. Use the service role key (has full permissions).
Project URL - From Settings → API, copy the URL.
Permissions - Your API key needs:
- SQL execution (
querytool) - Schema inspection (
introspecttool) - Edge Function deployment (
deploytool)
Service role key has all of these by default.
Security Note: Don’t commit your API key. Use .env files or environment variables. The MCP server reads from env, not from code.
When This Actually Helps
Building Fast
- Iterating on schema? Don’t context switch. Ask Claude to modify the table and it’s done.
- Testing queries? Try variations in chat instead of dashboard SQL editor.
Learning Supabase
- New to Postgres? Ask Claude for examples, have it execute them, see results immediately.
- Don’t know if a query is correct? Claude writes it, executes it, shows you what worked.
Debugging

- “Show me the last 10 errors from my function”
- “What’s in the audit log for this user?”
- “Are there orphaned records?”
All answerable without leaving chat.
Team Collaboration
- Pair with a teammate in Claude? Share the chat and they see actual results.
- No “wait, what’s the schema?” questions. Claude knows it in real-time.
The Gotchas
It’s SQL, not magic - Claude still writes SQL queries. They can be slow or wrong. Read-only mode is great for learning.
Secrets aren’t visible - Claude can’t read your STRIPE_KEY from the dashboard, but it can set/update them. If you need to retrieve secrets, you’ll still use the dashboard.
Cascading deletes are real - Claude can delete data. Always use read-only until you’re comfortable.
Rate limits apply - Supabase has rate limits. Don’t ask Claude to run 1000 queries in a loop. It’s still Supabase underneath.
It’s not a debugger - For complex issues, you’ll still need the Supabase dashboard. This is for speed, not replacing all tools.
The Bottom Line
Supabase MCP removes friction from database development. You stay in Claude. You write features faster. You context switch less.
Is it essential? No. Do you need it to build with Supabase? No. But if you spend 20% of your time tab-switching, this saves you hours per week.
For builders who live in Claude (which is increasingly everyone), Supabase MCP makes Supabase feel like a native part of your workflow instead of a separate tool you have to manage.
Try it for one feature. If you like staying in chat, keep it. If you prefer the dashboard, you can turn it off.
Get Started:
- GitHub: supabase-community/supabase-mcp
- Join the Agnost AI community:** Agnost AI Discord