Skip to main content

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 casePlatformWhy
Knowledge entries, WOs, messagesCloud UB (D1)Optimized for UB operations, hybrid search
Application data (users, products, orders)Supabase (PostgreSQL)Full relational DB, RLS, real-time
Edge functions (serverless)SupabaseDeno runtime, direct DB access
Simple key-value or configCloudflare KVUltra-fast edge reads

Tools reference

Project management

ToolDescription
list_organizationsList organizations the user belongs to
get_organizationOrganization details including subscription
list_projectsList all Supabase projects
get_projectProject details and status
create_projectCreate a new project (requires cost confirmation)
pause_projectPause a project (saves costs)
restore_projectRestore a paused project

Database operations

ToolDescription
list_tablesList tables in specified schemas
list_extensionsList installed PostgreSQL extensions
execute_sqlExecute raw SQL queries
apply_migrationApply DDL migration (schema changes)
list_migrationsList applied migrations
generate_typescript_typesGenerate TypeScript types from schema

Edge functions

ToolDescription
list_edge_functionsList deployed edge functions
get_edge_functionGet function source code
deploy_edge_functionDeploy new or updated function

Development branches

ToolDescription
create_branchCreate development branch (isolated DB)
list_branchesList all branches
merge_branchMerge branch migrations to production
rebase_branchRebase branch on production
reset_branchReset branch to specific migration
delete_branchDelete a branch

Configuration

ToolDescription
get_project_urlGet the API URL for a project
get_publishable_keysGet API keys (anon + publishable)
get_logsGet service logs (API, postgres, auth, etc.)
get_advisorsSecurity and performance advisory notices
search_docsSearch Supabase documentation (GraphQL)
get_costGet cost of creating project/branch
confirm_costConfirm 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:

OperationWhat happens
create_branchCopies production schema (not data) to a new DB
apply_migration on branchChanges only affect the branch
merge_branchApplies branch migrations to production
rebase_branchPulls new production migrations into branch
reset_branchRolls back to a specific migration

Security

RuleEnforcement
Always enable RLS on new tablesget_advisors(type="security") catches missing RLS
Never expose service_role keyOnly publishable/anon keys in client code
Cost confirmation before creatingget_cost + confirm_cost flow
Check advisors after DDL changesCatches security and performance issues

PageRelationship
MCP Servers OverviewAll servers in the fleet
Cloud UB MCPKnowledge management database (D1)
Cloudflare MCPInfrastructure management
Data ResidencyWhere application data lives