원클릭으로
supabase-interaction
Instructions for interacting with the local Supabase backend.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Instructions for interacting with the local Supabase backend.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Coding standards, architectural rules, and project-specific conventions for the Angular application.
Core principles that must be applied to ALL tasks, including mandatory self-documentation and knowledge persistence at the end of workflows.
Tailwind CSS configuration and Angular Material component usage guidelines.
| name | Supabase Interaction |
| description | Instructions for interacting with the local Supabase backend. |
This skill provides methods for AI agents to interact with the local Supabase backend.
PRIMARY METHOD: Use the supabase-db MCP Server.
The supabase-db MCP server is the most robust and reliable way to query the database, inspect schemas, and manage data. It connects directly to the PostgreSQL instance.
Before attempting other methods, ensure the supabase-db MCP server is configured and available.
mcp_config.jsonRead the mcp_config.json file (usually in .gemini/antigravity/ or similar agent configuration paths). Look for a "supabase-db" entry in the "mcpServers" object.
If the configuration is MISSING, you MUST propose adding it.
Add the following configuration to mcp_config.json:
"supabase-db": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-postgres",
"postgresql://postgres:postgres@localhost:54322/postgres" // Default local Supabase connection string
]
}
Note: The port 54322 is the standard port for local Supabase Postgres. Verify this if connection fails.
Use the list_resources or run_command tools (if available) to verify the server is running. A simple query test is the best verification:
SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' LIMIT 5;
If this works, STOP HERE and use this method for all database interactions.
supabase-db (Preferred)Once configured, use the available tools from the supabase-db server:
query: Run read-only SQL queries to fetch data.
SELECT * FROM user_roles; or SELECT * FROM storage.buckets;execute (if available): Run DML statements (INSERT, UPDATE, DELETE) - Use with caution.information_schema directly.Advantages:
supabase-db is unavailable)If the MCP server cannot be configured or fails to connect, use the legacy methods below.
To check if the local Supabase instance is running and get connection details:
npx nx run picsa-server:supabase -- status
Output contains API URL, DB URL, and service keys.
If direct DB access fails, use the Supabase REST API via a script.
Get the API URL and Service Role Key:
npx nx run picsa-server:supabase -- status -o json > supabase_status.json
Generate a script to query the API (using fetch and the service key).
If you need to reset the database to a clean state:
npx nx run picsa-server:reset
This command runs db reset and then seeds the database.
SELECT queries.docker ps) or use the status command.To regenerate TypeScript definitions from the database schema:
yarn nx run picsa-server:gen-types
This command should be run after any database schema changes (e.g., migrations) to ensure the application's types (db.types.ts) are synchronized with the database.