NativeAIHub
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. Use caution when running destructive queries (DROP, DELETE, TRUNCATE) on production databases. Consider using a read only token for exploration and a full access token only when modifications are needed.

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.