Supabase
MCP server for interacting with the Supabase platform
★ 2556Apache-2.0databases
Install
Config snippet generator goes here (5 client tabs)
README
# Supabase MCP Server
[](https://registry.modelcontextprotocol.io/?q=com.supabase%2Fmcp)
> Connect your Supabase projects to Cursor, Claude, Windsurf, and other AI assistants.

The [Model Context Protocol](https://modelcontextprotocol.io/introduction) (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](#tools).
## Setup
### 1. Follow our security best practices
Before setting up the MCP server, we recommend you read our [security best practices](#security-risks) 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](https://supabase.com/docs/guides/getting-started/mcp#step-2-configure-your-ai-tool). You can also generate a custom MCP URL for your project by visiting the [MCP connection tab](https://supabase.com/dashboard/project/_?showConnect=true&connectTab=mcp) 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:
```json
{
"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](https://supabase.com/docs/guides/local-development/cli/getting-started), 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](https://supabase.com/docs/guides/self-hosting/docker), check the [Enabling MCP server](https://supabase.com/docs/guides/self-hosting/enable-mcp) 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](#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](#project-scoped-mode).
- `features`: Used to specify which tool groups to enable. See [feature groups](#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](https://supabase.com/dashboard/project/_/settings/general).
After scoping the server to a project, [account-level](#project-management) 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](#database) and [docs](#knowledge-base) tools, you would specify the server URL as:
```
https