supabase-automation
Original:🇺🇸 English
Translated
Automate Supabase database queries, table management, project administration, storage, edge functions, and SQL execution via Rube MCP (Composio). Always search tools first for current schemas.
4installs
Sourcedavepoon/buildwithclaude
Added on
NPX Install
npx skill4agent add davepoon/buildwithclaude supabase-automationTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Supabase Automation via Rube MCP
Automate Supabase operations including database queries, table schema inspection, SQL execution, project and organization management, storage buckets, edge functions, and service health monitoring through Composio's Supabase toolkit.
Toolkit docs: composio.dev/toolkits/supabase
Prerequisites
- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)
- Active Supabase connection via with toolkit
RUBE_MANAGE_CONNECTIONSsupabase - Always call first to get current tool schemas
RUBE_SEARCH_TOOLS
Setup
Get Rube MCP: Add as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.
https://rube.app/mcp- Verify Rube MCP is available by confirming responds
RUBE_SEARCH_TOOLS - Call with toolkit
RUBE_MANAGE_CONNECTIONSsupabase - If connection is not ACTIVE, follow the returned auth link to complete Supabase authentication
- Confirm connection status shows ACTIVE before running any workflows
Core Workflows
1. Query and Manage Database Tables
When to use: User wants to read data from tables, inspect schemas, or perform CRUD operations
Tool sequence:
- - List projects to find the target project_ref [Prerequisite]
SUPABASE_LIST_ALL_PROJECTS - - List all tables and views in the database [Prerequisite]
SUPABASE_LIST_TABLES - - Get detailed column types, constraints, and relationships [Prerequisite for writes]
SUPABASE_GET_TABLE_SCHEMAS - - Query rows with filtering, sorting, and pagination [Required for reads]
SUPABASE_SELECT_FROM_TABLE - - Execute arbitrary SQL for complex queries, inserts, updates, or deletes [Required for writes]
SUPABASE_BETA_RUN_SQL_QUERY
Key parameters for SELECT_FROM_TABLE:
- : 20-character lowercase project reference
project_ref - : Table or view name to query
table - : Comma-separated column list (supports nested selections and JSON paths like
select)profile->avatar_url - : Array of filter objects with
filters,column,operatorvalue - : Sort expression like
ordercreated_at.desc - : Max rows to return (minimum 1)
limit - : Rows to skip for pagination
offset
PostgREST filter operators:
- ,
eq: Equal / not equalneq - ,
gt,gte,lt: Comparison operatorslte - ,
like: Pattern matching (case-sensitive / insensitive)ilike - : IS check (for null, true, false)
is - : In a list of values
in - ,
cs: Contains / contained by (arrays)cd - ,
fts,plfts,phfts: Full-text search variantswfts
Key parameters for RUN_SQL_QUERY:
- : Project reference (20 lowercase letters, pattern
ref)^[a-z]{20}$ - : Valid PostgreSQL SQL statement
query - : Boolean to force read-only transaction (safer for SELECTs)
read_only
Pitfalls:
- must be exactly 20 lowercase letters (a-z only, no numbers or hyphens)
project_ref - is read-only; use
SELECT_FROM_TABLEfor INSERT, UPDATE, DELETE operationsRUN_SQL_QUERY - For PostgreSQL array columns (text[], integer[]), use or
ARRAY['item1', 'item2']syntax, NOT JSON array syntax'{"item1", "item2"}''["item1", "item2"]' - SQL identifiers that are case-sensitive must be double-quoted in queries
- Complex DDL operations may timeout (~60 second limit); break into smaller queries
- ERROR 42P01 "relation does not exist" usually means unquoted case-sensitive identifiers
- ERROR 42883 "function does not exist" means you are calling non-standard helpers; prefer information_schema queries
2. Manage Projects and Organizations
When to use: User wants to list projects, inspect configurations, or manage organizations
Tool sequence:
- - List all organizations (IDs and names) [Required]
SUPABASE_LIST_ALL_ORGANIZATIONS - - Get detailed org info by slug [Optional]
SUPABASE_GETS_INFORMATION_ABOUT_THE_ORGANIZATION - - List org members with roles and MFA status [Optional]
SUPABASE_LIST_MEMBERS_OF_AN_ORGANIZATION - - List all projects with metadata [Required]
SUPABASE_LIST_ALL_PROJECTS - - Get database configuration [Optional]
SUPABASE_GETS_PROJECT_S_POSTGRES_CONFIG - - Get authentication configuration [Optional]
SUPABASE_GETS_PROJECT_S_AUTH_CONFIG - - Get API keys (sensitive -- handle carefully) [Optional]
SUPABASE_GET_PROJECT_API_KEYS - - Check service health [Optional]
SUPABASE_GETS_PROJECT_S_SERVICE_HEALTH_STATUS
Key parameters:
- : Project reference for project-specific tools
ref - : Organization slug (URL-friendly identifier) for org tools
slug - : Array of services for health check:
services,auth,db,db_postgres_user,pg_bouncer,pooler,realtime,reststorage
Pitfalls:
- returns both
LIST_ALL_ORGANIZATIONSandid;slugexpectsLIST_MEMBERS_OF_AN_ORGANIZATION, notslugid - returns live secrets -- NEVER log, display, or persist full key values
GET_PROJECT_API_KEYS - requires a non-empty
GETS_PROJECT_S_SERVICE_HEALTH_STATUSarray; empty array causes invalid_request errorservices - Config tools may return 401/403 if token lacks required scope; handle gracefully rather than failing the whole workflow
3. Inspect Database Schema
When to use: User wants to understand table structure, columns, constraints, or generate types
Tool sequence:
- - Find the target project [Prerequisite]
SUPABASE_LIST_ALL_PROJECTS - - Enumerate all tables and views with metadata [Required]
SUPABASE_LIST_TABLES - - Get detailed schema for specific tables [Required]
SUPABASE_GET_TABLE_SCHEMAS - - Generate TypeScript types from schema [Optional]
SUPABASE_GENERATE_TYPE_SCRIPT_TYPES
Key parameters for LIST_TABLES:
- : Project reference
project_ref - : Array of schema names to search (e.g.,
schemas); omit for all non-system schemas["public"] - : Include views alongside tables (default true)
include_views - : Include row count estimates and sizes (default true)
include_metadata - : Include pg_catalog, information_schema, etc. (default false)
include_system_schemas
Key parameters for GET_TABLE_SCHEMAS:
- : Project reference
project_ref - : Array of table names (max 20 per request); supports schema prefix like
table_names,public.usersauth.users - : Include foreign key info (default true)
include_relationships - : Include index info (default true)
include_indexes - : Cleaner output by hiding null fields (default true)
exclude_null_values
Key parameters for GENERATE_TYPE_SCRIPT_TYPES:
- : Project reference
ref - : Comma-separated schema names (default
included_schemas)"public"
Pitfalls:
- Table names without schema prefix assume schema
public - and
row_countfrom LIST_TABLES may be null for views or recently created tables; treat as unknown, not zerosize_bytes - GET_TABLE_SCHEMAS has a max of 20 tables per request; batch if needed
- TypeScript types include all tables in specified schemas; cannot filter individual tables
4. Manage Edge Functions
When to use: User wants to list, inspect, or work with Supabase Edge Functions
Tool sequence:
- - Find the project reference [Prerequisite]
SUPABASE_LIST_ALL_PROJECTS - - List all edge functions with metadata [Required]
SUPABASE_LIST_ALL_FUNCTIONS - - Get detailed info for a specific function [Optional]
SUPABASE_RETRIEVE_A_FUNCTION
Key parameters:
- : Project reference
ref - Function slug for RETRIEVE_A_FUNCTION
Pitfalls:
- returns metadata only, not function code or logs
LIST_ALL_FUNCTIONS - and
created_atmay be epoch milliseconds; convert to human-readable timestampsupdated_at - These tools cannot create or deploy edge functions; they are read-only inspection tools
- Permission errors may occur without org/project admin rights
5. Manage Storage Buckets
When to use: User wants to list storage buckets or manage file storage
Tool sequence:
- - Find the project reference [Prerequisite]
SUPABASE_LIST_ALL_PROJECTS - - List all storage buckets [Required]
SUPABASE_LISTS_ALL_BUCKETS
Key parameters:
- : Project reference
ref
Pitfalls:
- returns bucket list only, not bucket contents or access policies
LISTS_ALL_BUCKETS - For file uploads, handles CORS preflight for TUS resumable uploads only
SUPABASE_RESUMABLE_UPLOAD_SIGN_OPTIONS_WITH_ID - Direct file operations may require using with the Supabase storage API
proxy_execute
Common Patterns
ID Resolution
- Project reference: -- extract
SUPABASE_LIST_ALL_PROJECTSfield (20 lowercase letters)ref - Organization slug: -- use
SUPABASE_LIST_ALL_ORGANIZATIONS(notslug) for downstream org toolsid - Table names: -- enumerate available tables before querying
SUPABASE_LIST_TABLES - Schema discovery: -- inspect columns and constraints before writes
SUPABASE_GET_TABLE_SCHEMAS
Pagination
- : Uses
SUPABASE_SELECT_FROM_TABLE+offsetpagination. Increment offset by limit until fewer rows than limit are returned.limit - : May paginate for large accounts; follow cursors/pages until exhausted.
SUPABASE_LIST_ALL_PROJECTS - : May paginate for large databases.
SUPABASE_LIST_TABLES
SQL Best Practices
- Always use or
SUPABASE_GET_TABLE_SCHEMASbefore writing SQLSUPABASE_LIST_TABLES - Use for SELECT queries to prevent accidental mutations
read_only: true - Quote case-sensitive identifiers: not
SELECT * FROM "MyTable"SELECT * FROM MyTable - Use PostgreSQL array syntax for array columns: not
ARRAY['a', 'b']['a', 'b'] - Break complex DDL into smaller statements to avoid timeouts
Known Pitfalls
ID Formats
- Project references are exactly 20 lowercase letters (a-z): pattern
^[a-z]{20}$ - Organization identifiers come as both (UUID) and
id(URL-friendly string); tools vary in which they acceptslug - requires
LIST_MEMBERS_OF_AN_ORGANIZATION, notslugid
SQL Execution
- has ~60 second timeout for complex operations
BETA_RUN_SQL_QUERY - PostgreSQL array syntax required: or
ARRAY['item'], NOT JSON syntax'{"item"}''["item"]' - Case-sensitive identifiers must be double-quoted in SQL
- ERROR 42P01: relation does not exist (check quoting and schema prefix)
- ERROR 42883: function does not exist (use information_schema instead of custom helpers)
Sensitive Data
- returns service-role keys -- NEVER expose full values
GET_PROJECT_API_KEYS - Auth config tools exclude secrets but may still contain sensitive configuration
- Always mask or truncate API keys in output
Schema Metadata
- and
row_countfromsize_bytescan be null; do not treat as zeroLIST_TABLES - System schemas are excluded by default; set to see them
include_system_schemas: true - Views appear alongside tables unless
include_views: false
Rate Limits and Permissions
- Enrichment tools (API keys, configs) may return 401/403 without proper scopes; skip gracefully
- Large table listings may require pagination
- fails with empty
GETS_PROJECT_S_SERVICE_HEALTH_STATUSarray -- always specify at least oneservices
Quick Reference
| Task | Tool Slug | Key Params |
|---|---|---|
| List organizations | | (none) |
| Get org info | | |
| List org members | | |
| List projects | | (none) |
| List tables | | |
| Get table schemas | | |
| Query table | | |
| Run SQL | | |
| Generate TS types | | |
| Postgres config | | |
| Auth config | | |
| Get API keys | | |
| Service health | | |
| List edge functions | | |
| Get edge function | | |
| List storage buckets | | |
| List DB branches | | |
Powered by Composio