Supabase MCP
Benchmarked against: Anthropic — Claude on 3rd-party platforms Provider: Supabase official MCP server Tools: ~25 (projects, tables, SQL, migrations, edge functions, branches) Authentication: Supabase access token
The Supabase MCP server provides SuperPortia agents with managed PostgreSQL database access, edge function deployment, and database migration management. It's used for application databases that need relational schema, row-level security, and real-time subscriptions — complementing Cloud UB (which handles knowledge management on D1).
When to use Supabase vs Cloud UB
| Use case | Platform | Why |
|---|---|---|
| Knowledge entries, WOs, messages | Cloud UB (D1) | Optimized for UB operations, hybrid search |
| Application data (users, products, orders) | Supabase (PostgreSQL) | Full relational DB, RLS, real-time |
| Edge functions (serverless) | Supabase | Deno runtime, direct DB access |
| Simple key-value or config | Cloudflare KV | Ultra-fast edge reads |
Tools reference
Project management
| Tool | Description |
|---|---|
list_organizations | List organizations the user belongs to |
get_organization | Organization details including subscription |
list_projects | List all Supabase projects |
get_project | Project details and status |
create_project | Create a new project (requires cost confirmation) |
pause_project | Pause a project (saves costs) |
restore_project | Restore a paused project |
Database operations
| Tool | Description |
|---|---|
list_tables | List tables in specified schemas |
list_extensions | List installed PostgreSQL extensions |
execute_sql | Execute raw SQL queries |
apply_migration | Apply DDL migration (schema changes) |
list_migrations | List applied migrations |
generate_typescript_types | Generate TypeScript types from schema |
Edge functions
| Tool | Description |
|---|---|
list_edge_functions | List deployed edge functions |
get_edge_function | Get function source code |
deploy_edge_function | Deploy new or updated function |
Development branches
| Tool | Description |
|---|---|
create_branch | Create development branch (isolated DB) |
list_branches | List all branches |
merge_branch | Merge branch migrations to production |
rebase_branch | Rebase branch on production |
reset_branch | Reset branch to specific migration |
delete_branch | Delete a branch |
Configuration
| Tool | Description |
|---|---|
get_project_url | Get the API URL for a project |
get_publishable_keys | Get API keys (anon + publishable) |
get_logs | Get service logs (API, postgres, auth, etc.) |
get_advisors | Security and performance advisory notices |
search_docs | Search Supabase documentation (GraphQL) |
get_cost | Get cost of creating project/branch |
confirm_cost | Confirm cost understanding before creation |
Database migration workflow
Supabase encourages a migration-based workflow for schema changes:
Example migration:
-- Create a table for CatMints Cafe menu items
CREATE TABLE menu_items (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
name TEXT NOT NULL,
description TEXT,
price DECIMAL(10,2) NOT NULL,
category TEXT NOT NULL,
available BOOLEAN DEFAULT true,
created_at TIMESTAMPTZ DEFAULT now()
);
-- Enable Row Level Security
ALTER TABLE menu_items ENABLE ROW LEVEL SECURITY;
-- Public read policy
CREATE POLICY "Anyone can view menu items"
ON menu_items FOR SELECT
USING (true);
apply_migration(
project_id="your-project-id",
name="create_menu_items",
query="..." # SQL above
)
Edge functions
Supabase edge functions run on Deno and have direct access to the project's database:
import "jsr:@supabase/functions-js/edge-runtime.d.ts";
Deno.serve(async (req: Request) => {
const { name } = await req.json();
const data = {
message: `Hello ${name}!`,
};
return new Response(JSON.stringify(data), {
headers: {
'Content-Type': 'application/json',
'Connection': 'keep-alive'
}
});
});
Deploy with:
deploy_edge_function(
project_id="your-project-id",
name="hello-world",
files=[{
"name": "index.ts",
"content": "..." # Code above
}],
verify_jwt=True
)
Development branches
Branches provide isolated database copies for safe development:
| Operation | What happens |
|---|---|
create_branch | Copies production schema (not data) to a new DB |
apply_migration on branch | Changes only affect the branch |
merge_branch | Applies branch migrations to production |
rebase_branch | Pulls new production migrations into branch |
reset_branch | Rolls back to a specific migration |
Security
| Rule | Enforcement |
|---|---|
| Always enable RLS on new tables | get_advisors(type="security") catches missing RLS |
| Never expose service_role key | Only publishable/anon keys in client code |
| Cost confirmation before creating | get_cost + confirm_cost flow |
| Check advisors after DDL changes | Catches security and performance issues |
Related pages
| Page | Relationship |
|---|---|
| MCP Servers Overview | All servers in the fleet |
| Cloud UB MCP | Knowledge management database (D1) |
| Cloudflare MCP | Infrastructure management |
| Data Residency | Where application data lives |