Supabase MCP
MCP server that lets Claude run queries, inspect schema, and manage your Supabase project from chat.
What it does
The Supabase MCP server gives Claude Desktop a typed bridge into your Supabase project. Once installed, Claude can list your tables, inspect schema and RLS policies, run SELECT queries, and help you debug production issues without you ever leaving the chat window. You stop copying rows from the Supabase dashboard into Claude. Claude reads them directly, reasons about them, and proposes the next query or the next migration.
What Claude can do with it installed
Claude can describe your schema on demand ('what columns does the orders table have?'), run arbitrary SELECT queries with live data, step through RLS policies to explain exactly why a row is or is not visible to a given user, generate migrations for schema changes you describe in plain English, and diagnose production errors by correlating application logs you paste in with the actual database state. Pair it with the Supabase + Next.js skill or Cursor rules so generated code matches your project conventions automatically.
Who should use it
Teams running production Supabase projects who are tired of the dashboard → Claude → dashboard loop when debugging. Solo developers who want a live database assistant during feature development. Anyone tired of explaining RLS policies to a model that only has a stale copy of their schema. Works identically on macOS and Windows; Linux is supported via the community build.
Safety
Use a personal access token scoped to the project you want Claude to touch. Never hand over a token with write access to every project in your org. For production, create a read-only token and only upgrade to write permissions when you specifically need them. Treat claude_desktop_config.json like any other file with secrets — never commit it, rotate tokens when a teammate leaves, and exclude it from any dotfiles sync.
How to install
Which tool are you using?
Not sure? Claude.ai is the website. Claude Code is the command-line tool you install separately. Cursor is a code editor that reads .cursorrules.
- 01
Get your Supabase credentials
You need two values. Your project URL: open your Supabase dashboard → your project → Project Settings → Data API → copy the Project URL. Your personal access token: go to https://supabase.com/dashboard/account/tokens → 'Generate new token' → give it a name like 'Claude MCP' → copy the token somewhere safe.
Treat the personal access token like a password. Never commit it. Rotate it if it ever leaks.
- 02
Open the Claude Desktop config file
Claude Desktop reads MCP server config from a specific JSON file. Open it with your text editor:
terminalshell# macOSopen ~/Library/Application\ Support/Claude/claude_desktop_config.json # Windowsnotepad %APPDATA%\Claude\claude_desktop_config.jsonIf the file does not exist yet, create it with { "mcpServers": {} } as the starting content.
- 03
Add the Supabase server block
Copy the JSON from the file section below and merge it into the mcpServers object. If the file is empty, paste the whole block as-is.
Keep the JSON well-formed — a missing comma or bracket will stop Claude Desktop from loading any MCP servers at all.
- 04
Replace the placeholder credentials
Swap 'https://YOUR-PROJECT.supabase.co' for your actual project URL and 'YOUR_PERSONAL_ACCESS_TOKEN' for the token you generated in step 1. Save the file.
Do not check this config file into git. If you use dotfiles sync, exclude claude_desktop_config.json.
- 05
Restart Claude Desktop and test
Fully quit Claude Desktop (not just close the window) and reopen. Start a new chat and ask Claude to 'list tables in my Supabase project'. If the connection works, Claude will use the MCP tool and return your schema.
If nothing happens, check Claude Desktop's developer logs — most issues are malformed JSON or an expired token.
The mcp server file
Copy the full contents below, or download the file directly.
{ "mcpServers": { "supabase": { "command": "npx", "args": ["-y", "@supabase/mcp-server-supabase@latest"], "env": { "SUPABASE_URL": "https://YOUR-PROJECT.supabase.co", "SUPABASE_ACCESS_TOKEN": "YOUR_PERSONAL_ACCESS_TOKEN" } } }}Example output
What Claude does before and after you install this mcp server.
You switch between Claude, the Supabase dashboard, and psql to debug a query. 20 minutes.
Claude queries the table, reads the RLS policy, spots the missing policy clause, and proposes the fix — all in one chat. 2 minutes.
Customization tips
Scope the access token to the minimum permissions needed. For teams, create per-developer tokens so audit logs are meaningful. If you use Supabase branches, pass the branch ref in SUPABASE_URL so Claude never touches prod by accident. To connect multiple projects, add additional server blocks under mcpServers with unique keys like "supabase-prod" and "supabase-staging" — each with its own URL and token.
Related resources
Supabase + Next.js Rules
Cursor rules for Supabase + Next.js App Router. Client separation, RLS, auth middleware, server actions for mutations.
Postgres MCP
MCP server for any Postgres database. Claude can inspect schema, run queries, and explain plans.
GitHub MCP
MCP server that lets Claude read repos, open PRs, manage issues, and review code directly from chat.
Frequently asked questions
Will my data be sent to Anthropic?
Only data that Claude actively queries goes through the MCP bridge and then to the Claude API. Follow your organization data policy. Use a read-only token for production and a separate token per environment.
Can I give Claude write access to my Supabase database?
Yes, if the personal access token has the required permissions. Strongly recommended: use a read-only token during everyday work and only swap to a write-capable token when you specifically need write operations.
Does this work on Linux?
Yes. The Linux config path is typically ~/.config/Claude/claude_desktop_config.json. The JSON format is identical. Double-check the path in the server repo README.
Can I connect multiple Supabase projects?
Yes. Add multiple server blocks inside mcpServers with unique keys like "supabase-prod" and "supabase-staging", each with their own URL and token.
Does it bypass Row Level Security?
Only if you use the service_role key — do not. Use a personal access token; RLS policies apply as for any normal authenticated user.
Want more like this?
Browse the full RohanKit library — free resources for Claude and Cursor.