Skip to content

Commit a858263

Browse files
authored
docs: add remote MCP to README, remove stdio (#150)
* docs: add remote MCP, remove stdio * docs: remove URL builder image * docs: mention MCP URL for CLI
1 parent 199a0c4 commit a858263

File tree

1 file changed

+34
-118
lines changed

1 file changed

+34
-118
lines changed

README.md

Lines changed: 34 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -6,136 +6,52 @@
66

77
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).
88

9-
## Prerequisites
10-
11-
You will need Node.js ([active LTS](https://nodejs.org/en/about/previous-releases) or newer) installed on your machine. You can check this by running:
12-
13-
```shell
14-
node -v
15-
```
16-
17-
If you don't have Node.js 22+ installed, you can download it from [nodejs.org](https://nodejs.org/).
18-
199
## Setup
2010

21-
### 1. Personal access token (PAT)
22-
23-
First, go to your [Supabase settings](https://supabase.com/dashboard/account/tokens) and create a personal access token. Give it a name that describes its purpose, like "Cursor MCP Server".
24-
25-
This will be used to authenticate the MCP server with your Supabase account. Make sure to copy the token, as you won't be able to see it again.
26-
27-
### 2. Configure MCP client
28-
29-
Next, configure your MCP client (such as Cursor) to use this server. Most MCP clients store the configuration as JSON in the following format:
30-
31-
```json
32-
{
33-
"mcpServers": {
34-
"supabase": {
35-
"command": "npx",
36-
"args": [
37-
"-y",
38-
"@supabase/mcp-server-supabase@latest",
39-
"--read-only",
40-
"--project-ref=<project-ref>"
41-
],
42-
"env": {
43-
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
44-
}
45-
}
46-
}
47-
}
48-
```
49-
50-
Replace `<personal-access-token>` with the token you created in step 1. Alternatively you can omit `SUPABASE_ACCESS_TOKEN` in this config and instead set it globally on your machine. This allows you to keep your token out of version control if you plan on committing this configuration to a repository.
51-
52-
The following options are available:
53-
54-
- `--read-only`: Used to restrict the server to read-only queries and tools. Recommended by default. See [read-only mode](#read-only-mode).
55-
- `--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).
56-
- `--features`: Used to specify which tool groups to enable. See [feature groups](#feature-groups).
11+
### 1. Follow our security best practices
5712

58-
If you are on Windows, you will need to [prefix the command](#windows). If your MCP client doesn't accept JSON, the direct CLI command is:
59-
60-
```shell
61-
npx -y @supabase/mcp-server-supabase@latest --read-only --project-ref=<project-ref>
62-
```
13+
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.
6314

64-
> Note: Do not run this command directly - this is meant to be executed by your MCP client in order to start the server. `npx` automatically downloads the latest version of the MCP server from `npm` and runs it in a single command.
6515

66-
#### Windows
16+
### 2. Configure your MCP client
6717

68-
On Windows, you will need to prefix the command with `cmd /c`:
18+
The Supabase MCP server is hosted at `https://mcp.supabase.com/mcp` and supports the Streamable HTTP transport with OAuth authentication. 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` with a subset of tools.
6919

70-
```json
71-
{
72-
"mcpServers": {
73-
"supabase": {
74-
"command": "cmd",
75-
"args": [
76-
"/c",
77-
"npx",
78-
"-y",
79-
"@supabase/mcp-server-supabase@latest",
80-
"--read-only",
81-
"--project-ref=<project-ref>"
82-
],
83-
"env": {
84-
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
85-
}
86-
}
87-
}
88-
}
89-
```
20+
The easiest way to connect your MCP client (such as Cursor) to your project is clicking [Connect](https://supabase.com/dashboard/project/_?showConnect=true&tab=mcp) in the Supabase dashboard and navigating to the MCP tab. There you can choose options such as [feature groups](#feature-groups), and generate one-click installers or config entries for popular clients.
9021

91-
or with `wsl` if you are running Node.js inside WSL:
22+
Most MCP clients store the configuration as JSON in the following format:
9223

9324
```json
9425
{
9526
"mcpServers": {
9627
"supabase": {
97-
"command": "wsl",
98-
"args": [
99-
"npx",
100-
"-y",
101-
"@supabase/mcp-server-supabase@latest",
102-
"--read-only",
103-
"--project-ref=<project-ref>"
104-
],
105-
"env": {
106-
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
107-
}
28+
"type": "http",
29+
"url": "https://mcp.supabase.com/mcp"
10830
}
10931
}
11032
}
11133
```
11234

113-
Make sure Node.js is available in your system `PATH` environment variable. If you are running Node.js natively on Windows, you can set this by running the following commands in your terminal.
114-
115-
1. Get the path to `npm`:
35+
Your MCP client will automatically prompt you to login to Supabase during setup. This will open a browser window where you can login to your Supabase account and grant access to the MCP client. Be sure to choose the organization that contains the project you wish to work with. In the future, we'll offer more fine grain control over these permissions.
11636

117-
```shell
118-
npm config get prefix
119-
```
37+
For more information, visit the [Supabase MCP docs](https://supabase.com/docs/guides/getting-started/mcp).
12038

121-
2. Add the directory to your PATH:
39+
## Options
12240

123-
```shell
124-
setx PATH "%PATH%;<path-to-dir>"
125-
```
41+
The following options are configurable as URL query parameters:
12642

127-
3. Restart your MCP client.
43+
- `read_only`: Used to restrict the server to read-only queries and tools. Recommended by default. See [read-only mode](#read-only-mode).
44+
- `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).
45+
- `features`: Used to specify which tool groups to enable. See [feature groups](#feature-groups).
12846

129-
### 3. Follow our security best practices
130-
131-
Before running 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.
47+
When using the URL in the dashboard or docs, these parameters will be populated for you.
13248

13349
### Project scoped mode
13450

135-
Without project scoping, the MCP server will have access to all organizations and projects in your Supabase account. We recommend you restrict the server to a specific project by setting the `--project-ref` flag on the CLI command:
51+
Without project scoping, the MCP server will have access to all organizations and projects in your Supabase account. We recommend you restrict the server to a specific project by setting the `project_ref` query parameter in the server URL:
13652

137-
```shell
138-
npx -y @supabase/mcp-server-supabase@latest --project-ref=<project-ref>
53+
```
54+
https://mcp.supabase.com/mcp?project_ref=<project-ref>
13955
```
14056

14157
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).
@@ -144,10 +60,10 @@ After scoping the server to a project, [account-level](#project-management) tool
14460

14561
### Read-only mode
14662

147-
To restrict the Supabase MCP server to read-only queries, set the `--read-only` flag on the CLI command:
63+
To restrict the Supabase MCP server to read-only queries, set the `read_only` query parameter in the server URL:
14864

149-
```shell
150-
npx -y @supabase/mcp-server-supabase@latest --read-only
65+
```
66+
https://mcp.supabase.com/mcp?read_only=true
15167
```
15268

15369
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:
@@ -165,15 +81,15 @@ We recommend enabling this setting by default. This prevents write operations on
16581

16682
### Feature groups
16783

168-
You can enable or disable specific tool groups by passing the `--features` flag 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 run:
84+
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:
16985

170-
```shell
171-
npx -y @supabase/mcp-server-supabase@latest --features=database,docs
86+
```
87+
https://mcp.supabase.com/mcp?features=database,docs
17288
```
17389

17490
Available groups are: [`account`](#account), [`docs`](#knowledge-base), [`database`](#database), [`debugging`](#debugging), [`development`](#development), [`functions`](#edge-functions), [`storage`](#storage), and [`branching`](#branching-experimental-requires-a-paid-plan).
17591

176-
If this flag is not passed, the default feature groups are: `account`, `database`, `debugging`, `development`, `docs`, `functions`, and `branching`.
92+
If this parameter is not set, the default feature groups are: `account`, `database`, `debugging`, `development`, `docs`, `functions`, and `branching`.
17793

17894
## Tools
17995

@@ -183,7 +99,7 @@ The following Supabase tools are available to the LLM, [grouped by feature](#fea
18399

184100
#### Account
185101

186-
Enabled by default when no `--project-ref` is passed. Use `account` to target this group of tools with the [`--features`](#feature-groups) option.
102+
Enabled by default when no `project_ref` is set. Use `account` to target this group of tools with the [`features`](#feature-groups) option.
187103

188104
_**Note:** these tools will be unavailable if the server is [scoped to a project](#project-scoped-mode)._
189105

@@ -199,13 +115,13 @@ _**Note:** these tools will be unavailable if the server is [scoped to a project
199115

200116
#### Knowledge Base
201117

202-
Enabled by default. Use `docs` to target this group of tools with the [`--features`](#feature-groups) option.
118+
Enabled by default. Use `docs` to target this group of tools with the [`features`](#feature-groups) option.
203119

204120
- `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.
205121

206122
#### Database
207123

208-
Enabled by default. Use `database` to target this group of tools with the [`--features`](#feature-groups) option.
124+
Enabled by default. Use `database` to target this group of tools with the [`features`](#feature-groups) option.
209125

210126
- `list_tables`: Lists all tables within the specified schemas.
211127
- `list_extensions`: Lists all extensions in the database.
@@ -215,30 +131,30 @@ Enabled by default. Use `database` to target this group of tools with the [`--fe
215131

216132
#### Debugging
217133

218-
Enabled by default. Use `debugging` to target this group of tools with the [`--features`](#feature-groups) option.
134+
Enabled by default. Use `debugging` to target this group of tools with the [`features`](#feature-groups) option.
219135

220136
- `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.
221137
- `get_advisors`: Gets a list of advisory notices for a Supabase project. LLMs can use this to check for security vulnerabilities or performance issues.
222138

223139
#### Development
224140

225-
Enabled by default. Use `development` to target this group of tools with the [`--features`](#feature-groups) option.
141+
Enabled by default. Use `development` to target this group of tools with the [`features`](#feature-groups) option.
226142

227143
- `get_project_url`: Gets the API URL for a project.
228144
- `get_anon_key`: Gets the anonymous API key for a project.
229145
- `generate_typescript_types`: Generates TypeScript types based on the database schema. LLMs can save this to a file and use it in their code.
230146

231147
#### Edge Functions
232148

233-
Enabled by default. Use `functions` to target this group of tools with the [`--features`](#feature-groups) option.
149+
Enabled by default. Use `functions` to target this group of tools with the [`features`](#feature-groups) option.
234150

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

239155
#### Branching (Experimental, requires a paid plan)
240156

241-
Enabled by default. Use `branching` to target this group of tools with the [`--features`](#feature-groups) option.
157+
Enabled by default. Use `branching` to target this group of tools with the [`features`](#feature-groups) option.
242158

243159
- `create_branch`: Creates a development branch with migrations from production branch.
244160
- `list_branches`: Lists all development branches.
@@ -249,7 +165,7 @@ Enabled by default. Use `branching` to target this group of tools with the [`--f
249165

250166
#### Storage
251167

252-
Disabled by default to reduce tool count. Use `storage` to target this group of tools with the [`--features`](#feature-groups) option.
168+
Disabled by default to reduce tool count. Use `storage` to target this group of tools with the [`features`](#feature-groups) option.
253169

254170
- `list_storage_buckets`: Lists all storage buckets in a Supabase project.
255171
- `get_storage_config`: Gets the storage config for a Supabase project.

0 commit comments

Comments
 (0)