Supabase Interaction

Query and manage a local Supabase PostgreSQL database via MCP server or REST API.

8|3|Updated Jun 8, 2019
One-click install
npx skills add https://github.com/e-picsa/picsa-apps --skill supabase-interaction-e-picsa
Or copy as Structured Prompt for Agentโ–ผ
Please help me install this Agent Skill.
Skill: Supabase Interaction
Source: https://github.com/e-picsa/picsa-apps/tree/main/.agent/skills/supabase
Command: npx skills add https://github.com/e-picsa/picsa-apps --skill supabase-interaction-e-picsa

SYSTEM DOCUMENTATION & REQUIREMENTS

๐Ÿ’ก This Skill requires @modelcontextprotocol/server-postgres.

What problem does it solve? AI agents need a consistent, reliable way to inspect schemas, query data, and manage a local Supabase backend without manually handling API keys or writing ad-hoc scripts. ## Core Features & Use Cases - MCP Server Integration: Configures and prioritizes the supabase-db MCP server for direct PostgreSQL access to run SQL queries and inspect schemas. - Fallback Methods: Provides REST API querying and status checks via npx nx run picsa-server:supabase -- status when the MCP server is unavailable. - Database Management: Supports database reset with seeding and TypeScript type regeneration after schema migrations. - Use Case: When debugging a data issue locally, ask the agent to list tables and run read-only SQL queries against the local Supabase instance to inspect records directly. ## Quick Start Ask the agent to check the local Supabase status and list the tables in the public schema.

Frequently Asked Questions about Supabase Interaction

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query a local Supabase database from an AI agent?โ–ผ

Configure the supabase-db MCP server in mcp_config.json using the @modelcontextprotocol/server-postgres package with the local connection string postgresql://postgres:postgres@localhost:54322/postgres. Then use the query tool to run read-only SQL against the database.

How to check local Supabase status and connection details?โ–ผ

Run npx nx run picsa-server:supabase -- status to get the API URL, DB URL, and service keys. Adding -o json outputs the details to a file for use in scripts.

What is the default port for local Supabase Postgres?โ–ผ

The default local Supabase Postgres port is 54322, used in the connection string postgresql://postgres:postgres@localhost:54322/postgres. Verify the port with the status command if the connection fails.

How do I reset and seed a local Supabase database?โ–ผ

Run npx nx run picsa-server:reset, which performs a database reset and then seeds the database to a clean state. This is useful when local data becomes inconsistent during development.

When should I regenerate TypeScript types from Supabase?โ–ผ

Regenerate types after any database schema change, such as running migrations. Execute yarn nx run picsa-server:gen-types to synchronize db.types.ts with the current database schema.

What to do when the supabase-db MCP server fails to connect?โ–ผ

Verify Docker containers are running with docker ps, check the status command output, and confirm the port matches 54322. If MCP remains unavailable, fall back to querying the Supabase REST API with the service role key.