Configure and use Supabase MCP from Claude Code to inspect and manage a Supabase project...
(These are recommended mitigations due to LLM prompt-injection risk and data exposure concerns.)
This project is connected to Supabase MCP:
iyyqdoahxhmdumojnqipUse Supabase remote MCP URL with project_ref (project-scoped):
# Add server (project scope) - replace PROJECT_REF:
claude mcp add --scope project --transport http supabase "https://mcp.supabase.com/mcp?project_ref=PROJECT_REF"
Then authenticate:
claude /mcpsupabase → AuthenticateCreate .mcp.json at repo root:
See: templates/mcp.supabase.project.json
If browser OAuth is not possible (CI), configure an access token header:
Authorization: Bearer ${SUPABASE_ACCESS_TOKEN} and project_ref env vars.When operating with Supabase MCP tools:
list_tables - List all tables in the databaseget_table_schema - Get schema for a specific tableexecute_sql - Execute SQL querieslist_storage_buckets - List storage bucketscreate_migration - Create a new migrationCREATE TABLE papers (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
title TEXT NOT NULL,
filename TEXT NOT NULL,
file_path TEXT NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE paper_pages (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
paper_id UUID REFERENCES papers(id) ON DELETE CASCADE,
page_number INTEGER NOT NULL,
text_content TEXT,
text_items JSONB,
width FLOAT,
height FLOAT,
has_text BOOLEAN DEFAULT true
);
CREATE TABLE highlights (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
paper_id UUID REFERENCES papers(id) ON DELETE CASCADE,
page_number INTEGER NOT NULL,
start_offset INTEGER NOT NULL,
end_offset INTEGER NOT NULL,
color TEXT DEFAULT 'yellow',
note TEXT,
created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE TABLE chat_messages (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
paper_id UUID REFERENCES papers(id) ON DELETE CASCADE,
role TEXT NOT NULL CHECK (role IN ('user', 'assistant')),
content TEXT NOT NULL,
citations JSONB,
created_at TIMESTAMPTZ DEFAULT NOW()
);