databases

Supabase MCP Server

by supabase-community

Connect Supabase projects to AI with Supabase MCP Server. Standardize LLM communication for secure, efficient developmen

Connect Supabase projects directly with AI assistants using the Model Context Protocol (MCP). This server standardizes communication between Large Language Models and Supabase, enabling AI to manage tables, query data, and interact with project features like edge functions, storage, and branching. Customize access with read-only or project-scoped modes and select specific tool groups to fit your needs. Integrated tools cover account management, documentation search, database operations, debugging, and more, empowering AI to assist with development, monitoring, and deployment tasks in your Supabase environment efficiently and securely.

github stars

2.5K

Direct project integrationConfigurable access modesSecurity-focused design

best for

  • / Full-stack developers using Supabase
  • / Database administration and monitoring
  • / AI-assisted development workflows

capabilities

  • / Manage database tables and schemas
  • / Query and analyze data
  • / Access edge functions and storage
  • / Search Supabase documentation
  • / Debug project issues
  • / Monitor project performance

what it does

Connects AI assistants directly to Supabase projects, allowing them to manage database tables, query data, and interact with Supabase features like storage and edge functions.

about

Supabase MCP Server is an official MCP server published by supabase-community that provides AI assistants with tools and capabilities via the Model Context Protocol. Connect Supabase projects to AI with Supabase MCP Server. Standardize LLM communication for secure, efficient developmen It is categorized under databases.

how to install

You can install Supabase MCP Server in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server supports remote connections over HTTP, so no local installation is required.

license

Apache-2.0

Supabase MCP Server is released under the Apache-2.0 license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

readme

Supabase MCP Server

MCP Registry Version

Connect your Supabase projects to Cursor, Claude, Windsurf, and other AI assistants.

supabase-mcp-demo

The Model Context Protocol (MCP) standardizes how Large Language Models (LLMs) talk to external services like Supabase. It connects AI assistants directly with your Supabase project and allows them to perform tasks like managing tables, fetching config, and querying data. See the full list of tools.

Setup

1. Follow our security best practices

Before setting up the MCP server, we recommend you read our security best practices to understand the risks of connecting an LLM to your Supabase projects and how to mitigate them.

2. Configure your MCP client

To configure the Supabase MCP server on your client, visit our setup documentation. You can also generate a custom MCP URL for your project by visiting the MCP connection tab in the Supabase dashboard.

Your MCP client will automatically prompt you to log in to Supabase during setup. Be sure to choose the organization that contains the project you wish to work with.

Most MCP clients require the following information:

{
  "mcpServers": {
    "supabase": {
      "type": "http",
      "url": "https://mcp.supabase.com/mcp"
    }
  }
}

If you don't see your MCP client listed in our documentation, check your client's MCP documentation and copy the above MCP information into their expected format (json, yaml, etc).

CLI

If you're running Supabase locally with Supabase CLI, you can access the MCP server at http://localhost:54321/mcp. Currently, the MCP Server in CLI environments offers a limited subset of tools and no OAuth 2.1.

Self-hosted

For self-hosted Supabase, check the Enabling MCP server page. Currently, the MCP Server in self-hosted environments offers a limited subset of tools and no OAuth 2.1.

Options

The following options are configurable as URL query parameters:

  • read_only: Used to restrict the server to read-only queries and tools. Recommended by default. See read-only mode.
  • project_ref: Used to scope the server to a specific project. Recommended by default. If you omit this, the server will have access to all projects in your Supabase account. See project scoped mode.
  • features: Used to specify which tool groups to enable. See feature groups.

When using the URL in the dashboard or docs, these parameters will be populated for you.

Project scoped mode

Without project scoping, the MCP server will have access to all projects in your Supabase organization. We recommend you restrict the server to a specific project by setting the project_ref query parameter in the server URL:

https://mcp.supabase.com/mcp?project_ref=<project-ref>

Replace <project-ref> with the ID of your project. You can find this under Project ID in your Supabase project settings.

After scoping the server to a project, account-level tools like list_projects and list_organizations will no longer be available. The server will only have access to the specified project and its resources.

Read-only mode

To restrict the Supabase MCP server to read-only queries, set the read_only query parameter in the server URL:

https://mcp.supabase.com/mcp?read_only=true

We recommend enabling this setting by default. This prevents write operations on any of your databases by executing SQL as a read-only Postgres user (via execute_sql). All other mutating tools are disabled in read-only mode, including: apply_migration create_project pause_project restore_project deploy_edge_function create_branch delete_branch merge_branch reset_branch rebase_branch update_storage_config.

Feature groups

You can enable or disable specific tool groups by passing the features query parameter to the MCP server. This allows you to customize which tools are available to the LLM. For example, to enable only the database and docs tools, you would specify the server URL as:

https://mcp.supabase.com/mcp?features=database,docs

Available groups are: account, docs, database, debugging, development, functions, storage, and branching.

If this parameter is not set, the default feature groups are: account, database, debugging, development, docs, functions, and branching.

Tools

Note: This server is pre-1.0, so expect some breaking changes between versions. Since LLMs will automatically adapt to the tools available, this shouldn't affect most users.

The following Supabase tools are available to the LLM, grouped by feature.

Account

Enabled by default when no project_ref is set. Use account to target this group of tools with the features option.

Note: these tools will be unavailable if the server is scoped to a project.

  • list_projects: Lists all Supabase projects for the user.
  • get_project: Gets details for a project.
  • create_project: Creates a new Supabase project.
  • pause_project: Pauses a project.
  • restore_project: Restores a project.
  • list_organizations: Lists all organizations that the user is a member of.
  • get_organization: Gets details for an organization.
  • get_cost: Gets the cost of a new project or branch for an organization.
  • confirm_cost: Confirms the user's understanding of new project or branch costs. This is required to create a new project or branch.

Knowledge Base

Enabled by default. Use docs to target this group of tools with the features option.

  • search_docs: Searches the Supabase documentation for up-to-date information. LLMs can use this to find answers to questions or learn how to use specific features.

Database

Enabled by default. Use database to target this group of tools with the features option.

  • list_tables: Lists all tables within the specified schemas.
  • list_extensions: Lists all extensions in the database.
  • list_migrations: Lists all migrations in the database.
  • apply_migration: Applies a SQL migration to the database. SQL passed to this tool will be tracked within the database, so LLMs should use this for DDL operations (schema changes).
  • execute_sql: Executes raw SQL in the database. LLMs should use this for regular queries that don't change the schema.

Debugging

Enabled by default. Use debugging to target this group of tools with the features option.

  • get_logs: Gets logs for a Supabase project by service type (api, postgres, edge functions, auth, storage, realtime). LLMs can use this to help with debugging and monitoring service performance.
  • get_advisors: Gets a list of advisory notices for a Supabase project. LLMs can use this to check for security vulnerabilities or performance issues.

Development

Enabled by default. Use development to target this group of tools with the features option.

  • get_project_url: Gets the API URL for a project.
  • get_publishable_keys: Gets the anonymous API keys for a project. Returns an array of client-safe API keys including legacy anon keys and modern publishable keys. Publishable keys are recommended for new applications.
  • generate_typescript_types: Generates TypeScript types based on the database schema. LLMs can save this to a file and use it in their code.

Edge Functions

Enabled by default. Use functions to target this group of tools with the features option.

  • list_edge_functions: Lists all Edge Functions in a Supabase project.
  • get_edge_function: Retrieves file contents for an Edge Function in a Supabase project.
  • deploy_edge_function: Deploys a new Edge Function to a Supabase project. LLMs can use this to deploy new functions or update existing ones.

Branching (Experimental, requires a paid plan)

Enabled by default. Use branching to target this group of tools with the features option.

  • create_branch: Creates a development branch with migrations from production branch.
  • list_branches: Lists all development branches.
  • delete_branch: Deletes a development branch.
  • merge_branch: Merges migrations and edge functions from a development branch to production.
  • reset_branch: Resets migrations of a development branch to a prior version.
  • rebase_branch: Rebases development branch on production to handle migration drift.

Storage

Disabled by default to reduce tool count. Use storage to target this group of tools with the features option.

  • list_storage_buckets: Lists all storage buckets in a Supabase project.
  • get_storage_config: Gets the storage config for a Supabase project.
  • update_storage_config: Updates the storage config for a Supabase project (requ