supabase-data-fabric
Use when Codex needs to query Supabase Postgres, manage auth, or trigger Edge Functions via the Supabase MCP server.
When & Why to Use This Skill
This Claude skill enables AI agents to seamlessly interact with Supabase infrastructure, providing a robust interface for executing PostgreSQL queries, managing user authentication, and triggering Edge Functions. It streamlines backend management and data operations by offering a structured, repeatable workflow for database administration and automation through the Model Context Protocol (MCP).
Use Cases
- Executing and verifying complex SQL queries within Supabase Postgres databases to perform data analysis or updates.
- Managing user authentication flows and row-level security (RLS) policies to ensure secure application access.
- Triggering and orchestrating Supabase Edge Functions to automate backend logic and server-side processes.
- Automating database schema migrations and documentation updates with built-in safety checks and verification steps.
- Performing dry-run database operations using transactions to prevent accidental data loss during development.
| name | supabase-data-fabric |
|---|---|
| description | Use when Codex needs to query Supabase Postgres, manage auth, or trigger Edge Functions via the Supabase MCP server. |
Supabase Data Fabric
Purpose
Provide a repeatable workflow for reading/writing Supabase data and invoking project automation endpoints through the hosted server configured in servers/supabase.
Setup Checklist
- Export
SUPABASE_PROJECT_REFandSUPABASE_ACCESS_TOKEN(service role or personal access token). - Confirm row-level security policies allow the automation key to perform the planned operations.
- Sync table schemas into
docs/supabase/schema.mdwhenever the database changes (manual step).
Environment Loading
If SUPABASE_PROJECT_REF or SUPABASE_ACCESS_TOKEN are not present, source load_env.sh from the repository root before invoking MCP tools.
Workflow
- Clarify – define the exact SQL or auth change needed and the safety checks (e.g., limit clause, expected row count).
- Prepare – if making schema changes, draft the SQL inside
packages/migrations/and have reviewers sign off before execution. - Execute – call the MCP
query,functionCall, orauthtools. Always pass an explicittimeoutSeconds. - Verify – re-run a read-only query or health check to confirm the change took effect.
Notes
- Avoid destructive statements without a backup; prefer temporary tables or
BEGIN; ...; ROLLBACKdry runs first. - Document every data change in pull requests or
docs/changelog.mdfor auditability. - Rotate service-role or access tokens quarterly and update
SUPABASE_ACCESS_TOKENin the deployment pipeline.