Skip to Content

Supabase

Manage backend services such as project management, database operations, and Edge Functions deployment through the Supabase API.

Key Features

  • Project management and cost estimation
  • Database table and extension management
  • SQL query execution and migration application
  • Edge Functions deployment and management
  • Database branch management (experimental)
  • TypeScript type generation
  • Documentation search and log debugging

Basic Information

Authentication Method

Authenticate using Personal Access Token.

Input Parameters

  • Access Token (required): Personal access token issued from Supabase

Supported MCP Tools

Project Management Tools

list_projects

Lists all Supabase projects for the user.

get_cost

Estimates the cost of creating a new project or branch.

Input Parameters:

  • type (required): Cost calculation type (“project” or “branch”)
  • organization_id (required): Organization ID

confirm_cost

Proceeds with creation after cost confirmation. Returns a unique confirmation ID that must be passed to create_project or create_branch.

Input Parameters:

  • type (required): Cost calculation type (“project” or “branch”)
  • recurrence (required): Billing cycle (“hourly” or “monthly”)
  • amount (required): Cost amount

Database Operation Tools

list_tables

Lists all tables in one or more schemas.

Input Parameters:

  • project_id (optional): Project ID
  • schemas (optional): List of schemas to include (default: [“public”])

list_extensions

Lists all extensions in the database.

Input Parameters:

  • project_id (optional): Project ID

execute_sql

Executes raw SQL on the database. For DDL operations, use apply_migration instead.

Input Parameters:

  • project_id (optional): Project ID
  • query (required): SQL query to execute

list_migrations

Lists all database migrations.

Input Parameters:

  • project_id (optional): Project ID

apply_migration

Applies a new database migration. Use this tool for DDL operations.

Input Parameters:

  • project_id (optional): Project ID
  • name (required): Migration name (snake_case format)
  • query (required): SQL query to apply

Edge Functions Tools

list_edge_functions

Lists all Edge Functions in the project.

Input Parameters:

  • project_id (optional): Project ID

deploy_edge_function

Deploys an Edge Function to a Supabase project.

Input Parameters:

  • project_id (optional): Project ID
  • name (required): Function name
  • entrypoint_path (optional): Function entrypoint (default: “index.ts”)
  • import_map_path (optional): Function’s import map
  • files (required): Array of files to upload (including entrypoint and dependencies)
    • Each file: name (filename), content (file content)

Debugging & Monitoring Tools

get_logs

Retrieves application logs for debugging. Only returns logs from the last 1 minute.

Input Parameters:

  • project_id (optional): Project ID
  • service (required): Service to get logs from (one of “api”, “branch-action”, “postgres”, “edge-function”, “auth”, “storage”, “realtime”)
  • endTimestamp (optional): End timestamp

get_advisors

Gets security and performance recommendations. It’s recommended to run this regularly after DDL changes.

Input Parameters:

  • project_id (optional): Project ID
  • type (required): Recommendation type (“security” or “performance”)

Project Configuration Tools

get_project_url

Gets the project’s API URL.

Input Parameters:

  • project_id (optional): Project ID

get_anon_key

Retrieves the anonymous API key for the project.

Input Parameters:

  • project_id (optional): Project ID

Branch Management Tools (Experimental)

create_branch

Creates a new database branch for development. Applies all migrations from the main project to the new branch database.

Input Parameters:

  • project_id (optional): Project ID
  • name (optional): Name of the branch to create (default: “develop”)
  • confirm_cost_id (required): Cost confirmation ID (must call confirm_cost first)

list_branches

Lists all database branches. You can check branch status to track completion of merge/rebase/reset operations.

Input Parameters:

  • project_id (optional): Project ID

delete_branch

Deletes a database branch.

Input Parameters:

  • branch_id (required): Branch ID

merge_branch

Merges development branch migrations and Edge Functions to production.

Input Parameters:

  • branch_id (required): Branch ID

reset_branch

Resets development branch migrations. Untracked data or schema changes will be lost.

Input Parameters:

  • branch_id (required): Branch ID
  • migration_version (optional): Reset to specific migration version

rebase_branch

Rebases development branch based on production. Helps handle migration drift by applying new migrations from production to the branch.

Input Parameters:

  • branch_id (required): Branch ID

Development Tools

search_docs

Searches Supabase documentation for relevant information. Uses GraphQL for searching.

Input Parameters:

  • graphql_query (required): GraphQL query string

generate_typescript_types

Generates TypeScript types from database schema.

Input Parameters:

  • project_id (optional): Project ID

Usage Example

For example,

  • When you input the prompt “Show me my Supabase project list”,
  • The LLM will call the list_projects tool through MCP to retrieve all user projects.
  • Then, it responds in the chat with the project list.

Database management:

  • When you input “Check the structure of the users table”,
  • The LLM will call the list_tables tool to retrieve table information.

API Key Setup Method

  1. Log in to Supabase Dashboard .
  2. Go to Account Tokens  page.
  3. Click the “Generate new token” button.
  4. Enter a token name and generate it.
  5. Copy the generated token and keep it safe.
  6. Select Supabase integration in QueryPie AI.
  7. Complete the connection by entering the issued Personal Access Token.

Precautions

  • Keep your generated Personal Access Token secure.
  • Copy the token after creation and store it in a safe place.
  • Branch functionality is experimental, so use it carefully.
Last updated on