Gene Library Courses Download Pricing Contact Sign in
supabase logo
databases Official Website

Supabase MCP Server – Database and Backend Tools

Supabase's official MCP server gives AI agents controlled access to supported Supabase project and account operations. Use it for database development, migrations, debugging, type generation, Edge Function deployment, branch workflows, storage configuration, and Supabase documentation search.

#postgres#backend#database-tools

Overview

Supabase's official MCP server connects compatible AI agents to hosted or local
Supabase environments. It gives an agent structured access to database schemas,
SQL execution, migrations, logs, advisors, project metadata, Edge Functions,
branches, storage configuration, and Supabase documentation instead of relying
only on manually copied context.

What the MCP server enables

Supabase organizes its tools into feature groups. Depending on the selected
options, project scope, plan, and permissions, an AI agent can:

  • List tables, extensions, and migrations.
  • Execute SQL and apply tracked database migrations.
  • Retrieve API, Postgres, Auth, Storage, Realtime, and Edge Function logs.
  • Review security and performance advisor notices.
  • Retrieve project URLs and publishable keys.
  • Generate TypeScript types from the database schema.
  • List, inspect, and deploy Edge Functions.
  • Search current Supabase documentation.
  • Manage projects and organizations when account tools are enabled.
  • Create and manage development branches on eligible paid plans.
  • Inspect storage buckets and supported storage configuration.

When to use it

Use Supabase MCP when an AI coding agent needs live backend context or must make
approved development changes. Common workflows include inspecting a schema,
writing and applying migrations, debugging failed requests, reviewing advisors,
generating types, deploying an Edge Function, preparing a development branch,
or researching the correct Supabase implementation pattern.

Connection and authentication

The hosted endpoint is https://mcp.supabase.com/mcp over Streamable HTTP.
Supabase uses dynamic client registration and an interactive browser login by
default, so a personal access token is not normally required.

For CI or clients that cannot complete browser-based authentication, a Supabase
personal access token can be passed as a Bearer token in the Authorization
header. Supabase CLI also exposes a local MCP endpoint at
http://localhost:54321/mcp, but the local server currently offers a limited
subset of tools and no OAuth 2.1.

Key considerations

Supabase recommends project scoping and read-only mode by default. The
project_ref parameter limits access to one project, while read_only=true
disables mutating tools and runs SQL as a read-only Postgres user. Feature
groups can further reduce the available tool set. Do not connect the server to
production data unless necessary, keep human approval enabled for tool calls,
and account for prompt-injection risks in database content. Branching requires
a paid plan, Storage tools are disabled by default, and the server remains
pre-1.0, so breaking changes are possible.

Supported Transports

streamable_http

URL: https://mcp.supabase.com/mcp

streamable_http

URL: http://localhost:54321/mcp

Frequently Asked Questions

When should an AI agent use the Supabase MCP server?
Use it when a development workflow needs live Supabase project context or approved backend changes, such as schema inspection, SQL queries, migrations, debugging, type generation, Edge Function deployment, branch management, or documentation search.
What does the Supabase MCP server add to an AI agent's capabilities?
It gives the agent structured access to current Supabase database, project, debugging, function, branching, storage, and documentation tools instead of relying only on static model knowledge or manually pasted project details.
What can an AI agent access or manage through Supabase MCP?
Depending on enabled feature groups and permissions, the agent can work with tables, extensions, migrations, SQL, service logs, advisors, project URLs, publishable keys, generated TypeScript types, Edge Functions, projects, organizations, branches, storage buckets, and storage configuration.
How is authentication configured for the Supabase MCP server?
The hosted server uses dynamic client registration and an interactive Supabase login by default. For CI or clients without browser-based OAuth, a Supabase personal access token can be supplied as a Bearer token through the SUPABASE_ACCESS_TOKEN environment variable.
Which transport should be used for the Supabase MCP server?
Use Streamable HTTP at https://mcp.supabase.com/mcp for the hosted server. Use http://localhost:54321/mcp only for Supabase CLI local development, understanding that the local endpoint has a limited tool set and no OAuth 2.1 support.