
Let Cursor manage your Supabase project
Switching between the editor and the dashboard to check tables, logs and migrations breaks your flow.
How it connects
This setup is for developers building on Supabase who keep switching to the dashboard to check tables, logs and migrations. The Supabase MCP server lets Cursor or Claude Code list tables, run SQL, read logs and draft migrations, and GitHub keeps those migrations in a reviewed branch. You end up asking database questions from the editor instead of clicking through the dashboard.
Set it up
1Add the Supabase MCP server
In Cursor, open Settings > MCP and add Supabase's remote server at https://mcp.supabase.com/mcp, or run claude mcp add with the same URL in Claude Code. Sign in to Supabase in the browser window that opens and pick your organisation. Check that tools such as list_tables and execute_sql appear.
Tip: Connect a development project, not production, the first time.
2Start in read-only mode
Add read_only=true and project_ref=your-project-ref as query parameters on the server URL. Read-only mode runs SQL as a read-only Postgres user, and the project ref stops the agent from touching other projects. Ask the agent to list tables to confirm the scope.
Tip: You find the project ref in the project's URL or under Project Settings.
3Ask in context
Ask the agent to describe a table, explain a slow query, check the logs for errors, or draft a migration for a new column. It runs read queries and returns the SQL it plans for any change. Read the SQL before you apply anything.
Tip: Ask for the advisors check to catch missing RLS policies and indexes.
4Commit migrations
Save new migrations as files in supabase/migrations and ask the agent to commit them to a new branch through the GitHub MCP server or your local git. Open a pull request so someone reviews the SQL before it reaches production. Apply migrations through your normal deploy process.
Tip: Keep the agent out of production writes; let CI or the Supabase CLI apply migrations.
Then just ask
Good to know
What you need
- A Supabase account and a development project
- Cursor or Claude Code
- A GitHub repository with a supabase/migrations folder
- The Supabase CLI if you apply migrations locally
Limits
- Read-only mode blocks writes, so the agent cannot test a migration against the database for you.
- Table contents can include prompt injection text; review what the agent does after reading user data.
- The agent only sees the scoped project, not your other environments.
Keep it safe
- Keep read-only mode on for production projects.
- Scope the server to a development project first.




