Skip to main content
The Supabase integration enables ZeroTwo to interact with your Supabase projects via Model Context Protocol, providing AI-assisted database management, query building, and backend operations.

What you can do

Database queries

Query and analyze your Supabase database with natural language

Schema management

View and modify database schemas and tables

API operations

Interact with Supabase APIs and functions

Data analysis

Analyze data patterns and generate insights

Connecting Supabase

1

Open integrations

Settings → Integrations → Supabase
2

Configure connection

Enter your Supabase project URL and API keys.Required information:
  • Project URL
  • Service role key (for admin operations)
  • Anon key (for client operations)
3

Test connection

Verify the connection to your Supabase project.
4

Confirm

Supabase integration is active via MCP.
Store your Supabase keys securely. ZeroTwo encrypts credentials, but treat service role keys with care as they have admin-level access.

Using Supabase

Database queries

"Show me all users in the database"
"Find orders from last week"
"List products with price over $100"

Schema operations

"Show me the schema for the 'orders' table"
"List all tables in the database"
"What columns does the 'users' table have?"
"Show relationships between tables"

Data manipulation

"Add a new user: email [email protected], name John Doe"
"Insert a product with name 'Widget' and price $29.99"
"Create an order for user ID 123"

API and functions

"Call the 'calculate_shipping' function with weight 5kg"
"Execute the 'send_welcome_email' function for user ID 123"
"Test the authentication flow"

Advanced features

Data analysis

"Analyze user growth trends over the last 6 months"
"Find patterns in customer purchase behavior"
"Identify products with declining sales"
"Show correlation between user activity and conversions"

Query optimization

"Suggest indexes for the orders table"
"Analyze query performance for the dashboard"
"Identify slow queries in the database"

Real-time subscriptions

"Show active real-time subscriptions"
"Monitor changes to the orders table"
"List connected users in real-time"

Database administration

"Show database size and usage statistics"
"List all active connections"
"Check database health and performance"
"Show recent error logs"

SQL generation

ZeroTwo can generate SQL queries from natural language:
1

Describe what you need

"Generate SQL to find users who registered this month and made a purchase"
2

Review generated SQL

SELECT u.id, u.email, u.created_at, COUNT(o.id) as order_count
FROM users u
LEFT JOIN orders o ON u.id = o.user_id
WHERE u.created_at >= DATE_TRUNC('month', CURRENT_DATE)
GROUP BY u.id, u.email, u.created_at
HAVING COUNT(o.id) > 0;
3

Execute or refine

Execute the query or ask for modifications before running.
Generated SQL includes explanatory comments and follows best practices for security and performance.

Privacy and security

Security measures:
  • API keys encrypted and securely stored
  • Queries executed with appropriate permission levels
  • Row-level security policies respected
  • Audit logging of all database operations
  • No persistent storage of query results
Permission levels:
  • Service role: Full admin access (use carefully)
  • Anon key: Respects RLS policies (recommended for most operations)
ZeroTwo respects your Supabase Row Level Security (RLS) policies. Queries are executed with the permissions you configure.

Troubleshooting

Solutions:
  • Verify project URL is correct
  • Check API keys are valid and not expired
  • Ensure Supabase project is active
  • Confirm network connectivity
  • Check if IP is allowed in Supabase settings
Solutions:
  • Verify RLS policies allow the operation
  • Check service role key for admin operations
  • Ensure user has necessary permissions
  • Review policy conditions and filters
Solutions:
  • Simplify complex queries
  • Add appropriate indexes
  • Reduce result set size with LIMIT
  • Check database performance metrics
  • Consider query optimization
Solutions:
  • Check RLS policies aren’t filtering data
  • Verify you’re querying the correct table
  • Confirm data exists with admin access
  • Check for soft deletes or archive flags

Use cases

Application development

"Show me the database schema and suggest improvements"
"Generate TypeScript types for the 'users' table"
"Create sample seed data for testing"

Data analysis

"Analyze user engagement metrics for the last month"
"Create a report of top-performing products"
"Identify user churn patterns"

Database maintenance

"Find and archive old records"
"Identify unused tables or columns"
"Suggest performance optimizations"

Debugging

"Show me recent failed authentication attempts"
"Find orphaned records in the orders table"
"Check data integrity across related tables"

Next steps