Supabase

Supabase

Backend database and auth for application development. Query tables, manage auth, and interact with Supabase projects.

MCP Server·3 sections·1 min read
codingdevops
Install Prompt

Paste this into Claude Code to set it up:

I want to add the Supabase MCP Server to my Claude Code setup.

IMPORTANT: Never use Read/Edit tools on ~/.claude.json. Use jq via Bash instead.

Prerequisites: You need a Supabase account and a personal access token. Generate one from your Supabase dashboard under Account Settings > Access Tokens.

Run this command to add the MCP server (replace your-access-token with your actual token):
```bash
jq '.mcpServers["supabase"] = {"type": "stdio", "command": "npx", "args": ["-y", "supabase-mcp-server"], "env": {"SUPABASE_ACCESS_TOKEN": "your-access-token"}}' ~/.claude.json > /tmp/claude-json-tmp && mv /tmp/claude-json-tmp ~/.claude.json
```

After adding, restart Claude Code. The server connects to your Supabase account and gives the agent access to all your projects, databases, and auth systems.

01What It Does

Your backend, accessible from your agent

Supabase provides PostgreSQL databases, authentication, storage, and edge functions as a managed backend. The MCP server gives your AI agent direct access to all of this. The agent can query your database, inspect table schemas, manage auth users, and help you build and debug your backend without leaving the terminal. This is especially powerful when building full stack applications where the agent can write both the frontend code and interact with the backend simultaneously.
🗃️
Database QueriesRun SQL queries, inspect table schemas, create tables, and manage indexes. The agent can explore your data model and help optimize queries.
🔐
Auth ManagementList and manage auth users, inspect authentication configurations, and debug auth related issues directly from the conversation.
📁
Project ManagementList all Supabase projects, inspect their settings, and switch between development and production environments.

02Setup

# Add to ~/.claude.json under mcpServers
"supabase": {
  "type": "stdio",
  "command": "npx",
  "args": ["-y", "supabase-mcp-server"],
  "env": {
    "SUPABASE_ACCESS_TOKEN": "your-access-token"
  }
}
Your Supabase access token grants access to all projects in your account. Supabase recommends extra safeguards before connecting the MCP server to a production project: scope the server to that single project, turn on read only mode, and restrict the feature groups the agent can use. Keep manual approval of tool calls enabled and review each one before it runs, especially destructive queries (DROP, DELETE, TRUNCATE).

03Usage Patterns

🏗️
Schema DesignDescribe what you want to build and the agent creates tables, relationships, indexes, and Row Level Security policies in your Supabase project.
🐛
Data DebuggingWhen something looks wrong in your app, the agent can query the actual database to inspect the data, find inconsistencies, and trace issues to their source.
Supabase MCP Server | NativeAI Hub Ecosystem