Supabase MCP Server

Supabase MCP servers enable AI models to interact with Supabase backends, providing capabilities for PostgreSQL databases, real-time subscriptions, authentication, and storage operations.

GitHub starsnpm versionnpm downloads

Overview

The MCP Supabase Server enables AI models to interact with Supabase backends, providing a standardized interface for working with this powerful PostgreSQL-based platform. Supabase combines the reliability of PostgreSQL with modern features like real-time subscriptions, authentication, and storage, making it ideal for building scalable AI-powered applications.

Official Server:

Maintained by the Supabase Community

Key Features

🗄️

PostgreSQL Database Operations

Execute SQL queries, manage tables, and handle database migrations

🚀

Edge Functions Management

Deploy and manage serverless Edge Functions

🌿

Branching Support

Create development branches with isolated environments

📊

Project Management

Full project lifecycle management and monitoring

Available Tools

Quick Reference

ToolPurposeCategory
list_projectsList all Supabase projectsProject
create_projectCreate new Supabase projectProject
execute_sqlExecute SQL queriesDatabase
list_tablesList database tablesDatabase
apply_migrationApply database migrationsDatabase
deploy_edge_functionDeploy Edge FunctionsEdge Functions
get_logsRetrieve service logsMonitoring
generate_typescript_typesGenerate TypeScript typesDevelopment

Project Management

list_projects

Warning:

Unavailable if server is scoped to a specific project

Lists all Supabase projects for the authenticated user.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "list_projects",
  arguments: {}
});
get_project

Retrieves detailed information about a specific project.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "get_project",
  arguments: {
    project_id: "your-project-id"
  }
});
create_project

Creates a new Supabase project with specified configuration.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "create_project",
  arguments: {
    name: "My New Project",
    organization_id: "org-id",
    region: "us-east-1"
  }
});
pause_project

Pauses a Supabase project to save resources.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "pause_project",
  arguments: {
    project_id: "your-project-id"
  }
});

Database Operations

execute_sql

Executes raw SQL queries in the database. Use this for regular queries that don't change the schema.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "execute_sql",
  arguments: {
    sql: "SELECT * FROM users WHERE active = true"
  }
});
list_tables

Lists all tables within the specified schemas.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "list_tables",
  arguments: {
    schemas: ["public"]
  }
});
apply_migration

Applies a SQL migration to the database. SQL passed to this tool will be tracked, so use it for DDL operations (schema changes).

use_mcp_tool({
  server_name: "supabase",
  tool_name: "apply_migration",
  arguments: {
    name: "add_users_table",
    sql: "CREATE TABLE users (id SERIAL PRIMARY KEY, email TEXT UNIQUE);"
  }
});
list_migrations

Lists all migrations that have been applied to the database.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "list_migrations",
  arguments: {}
});
list_extensions

Lists all PostgreSQL extensions available in the database.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "list_extensions",
  arguments: {}
});
get_logs

Retrieves logs for debugging and monitoring. Available services: api, postgres, edge functions, auth, storage, realtime.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "get_logs",
  arguments: {
    service: "postgres",
    limit: 100
  }
});

Edge Functions

list_edge_functions

Lists all Edge Functions deployed in the Supabase project.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "list_edge_functions",
  arguments: {}
});
deploy_edge_function

Deploy a new Edge Function or update an existing one.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "deploy_edge_function",
  arguments: {
    name: "hello-world",
    code: "Deno.serve(() => new Response('Hello World!'))"
  }
});

Development Branching

Paid Feature:

Branching features require a paid Supabase plan

create_branch

Creates a development branch with migrations from the production branch.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "create_branch",
  arguments: {
    name: "feature-branch",
    base: "main"
  }
});
list_branches

Lists all development branches in the project.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "list_branches",
  arguments: {}
});
merge_branch

Merges migrations and edge functions from a development branch to production.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "merge_branch",
  arguments: {
    branch_name: "feature-branch"
  }
});
delete_branch

Deletes a development branch.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "delete_branch",
  arguments: {
    branch_name: "feature-branch"
  }
});

Development Tools

generate_typescript_types

Generates TypeScript types based on your database schema for type-safe development.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "generate_typescript_types",
  arguments: {
    schema: "public"
  }
});
get_project_url

Retrieves the API URL for the current project.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "get_project_url",
  arguments: {}
});
get_anon_key

Retrieves the anonymous API key for the current project.

use_mcp_tool({
  server_name: "supabase",
  tool_name: "get_anon_key",
  arguments: {}
});

Installation

{
  "mcpServers": {
    "supabase": {
      "command": "npx",
      "args": [
        "-y",
        "@supabase/mcp-server-supabase@latest",
        "--access-token",
        "<your-personal-access-token>"
      ]
    }
  }
}

Getting your access token:

Generate a personal access token from your Supabase account settings

Use Cases

Database Management

  • Execute SQL queries and manage database schema
  • Apply and track database migrations
  • List tables, extensions, and database structure

Application Development

  • Deploy and manage Edge Functions
  • Generate TypeScript types for type-safe development
  • Access project configuration and API keys

Team Collaboration

  • Create development branches for isolated testing
  • Merge changes from development to production
  • Monitor application logs and performance

Project Operations

  • Create and manage multiple Supabase projects
  • Pause and restore projects to manage costs
  • Monitor resource usage and billing

Sources