Skip to content

Commit a2e8882

Browse files
authored
docs(mcp): recommend read-only, project-scoped mode by default (supabase#36496)
1 parent e014d5b commit a2e8882

File tree

3 files changed

+45
-23
lines changed

3 files changed

+45
-23
lines changed

apps/docs/content/_partials/mcp_supabase_config.mdx

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,18 @@
1616
"args": [
1717
"-y",
1818
"@supabase/mcp-server-supabase@latest",
19-
"--access-token",
20-
"<personal-access-token>"
21-
]
19+
"--read-only",
20+
"--project-ref=<project-ref>"
21+
],
22+
"env": {
23+
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
24+
}
2225
}
2326
}
2427
}
2528
```
2629

27-
Replace `<personal-access-token>` with your personal access token.
30+
Replace `<project-ref>` with your project ref, and `<personal-access-token>` with your personal access token.
2831

2932
</TabPanel>
3033

@@ -40,15 +43,18 @@
4043
"npx",
4144
"-y",
4245
"@supabase/mcp-server-supabase@latest",
43-
"--access-token",
44-
"<personal-access-token>"
45-
]
46+
"--read-only",
47+
"--project-ref=<project-ref>"
48+
],
49+
"env": {
50+
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
51+
}
4652
}
4753
}
4854
}
4955
```
5056

51-
Replace `<personal-access-token>` with your personal access token.
57+
Replace `<project-ref>` with your project ref, and `<personal-access-token>` with your personal access token.
5258

5359
<Admonition type="note">
5460

@@ -83,15 +89,18 @@
8389
"npx",
8490
"-y",
8591
"@supabase/mcp-server-supabase@latest",
86-
"--access-token",
87-
"<personal-access-token>"
88-
]
92+
"--read-only",
93+
"--project-ref=<project-ref>"
94+
],
95+
"env": {
96+
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
97+
}
8998
}
9099
}
91100
}
92101
```
93102

94-
Replace `<personal-access-token>` with your personal access token.
103+
Replace `<project-ref>` with your project ref, and `<personal-access-token>` with your personal access token.
95104

96105
This assumes you have Windows Subsystem for Linux (WSL) enabled and `node`/`npx` are installed within the WSL environment.
97106

@@ -107,15 +116,18 @@
107116
"args": [
108117
"-y",
109118
"@supabase/mcp-server-supabase@latest",
110-
"--access-token",
111-
"<personal-access-token>"
112-
]
119+
"--read-only",
120+
"--project-ref=<project-ref>"
121+
],
122+
"env": {
123+
"SUPABASE_ACCESS_TOKEN": "<personal-access-token>"
124+
}
113125
}
114126
}
115127
}
116128
```
117129

118-
Replace `<personal-access-token>` with your personal access token.
130+
Replace `<project-ref>` with your project ref, and `<personal-access-token>` with your personal access token.
119131

120132
</TabPanel>
121133

apps/docs/content/_partials/mcp_supabase_vscode_config.mdx

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"servers": {
2222
"supabase": {
2323
"command": "npx",
24-
"args": ["-y", "@supabase/mcp-server-supabase@latest"],
24+
"args": ["-y", "@supabase/mcp-server-supabase@latest", "--read-only", "--project-ref=<project-ref>"],
2525
"env": {
2626
"SUPABASE_ACCESS_TOKEN": "${input:supabase-access-token}"
2727
}
@@ -30,6 +30,8 @@
3030
}
3131
```
3232

33+
Replace `<project-ref>` with your project ref.
34+
3335
</TabPanel>
3436

3537
<TabPanel id="windows" label="Windows">
@@ -47,7 +49,7 @@
4749
"servers": {
4850
"supabase": {
4951
"command": "cmd",
50-
"args": ["/c", "npx", "-y", "@supabase/mcp-server-supabase@latest"],
52+
"args": ["/c", "npx", "-y", "@supabase/mcp-server-supabase@latest", "--read-only", "--project-ref=<project-ref>"],
5153
"env": {
5254
"SUPABASE_ACCESS_TOKEN": "${input:supabase-access-token}"
5355
}
@@ -56,6 +58,8 @@
5658
}
5759
```
5860

61+
Replace `<project-ref>` with your project ref.
62+
5963
<Admonition type="note">
6064

6165
Make sure that `node` and `npx` are available in your system `PATH`. Assuming `node` is installed, you can get the path by running:
@@ -93,7 +97,7 @@
9397
"servers": {
9498
"supabase": {
9599
"command": "wsl",
96-
"args": ["npx", "-y", "@supabase/mcp-server-supabase@latest"],
100+
"args": ["npx", "-y", "@supabase/mcp-server-supabase@latest", "--read-only", "--project-ref=<project-ref>"],
97101
"env": {
98102
"SUPABASE_ACCESS_TOKEN": "${input:supabase-access-token}"
99103
}
@@ -102,6 +106,8 @@
102106
}
103107
```
104108

109+
Replace `<project-ref>` with your project ref.
110+
105111
This assumes you have Windows Subsystem for Linux (WSL) enabled and `node`/`npx` are installed within the WSL environment.
106112

107113
</TabPanel>
@@ -121,7 +127,7 @@
121127
"servers": {
122128
"supabase": {
123129
"command": "npx",
124-
"args": ["-y", "@supabase/mcp-server-supabase@latest"],
130+
"args": ["-y", "@supabase/mcp-server-supabase@latest", "--read-only", "--project-ref=<project-ref>"],
125131
"env": {
126132
"SUPABASE_ACCESS_TOKEN": "${input:supabase-access-token}"
127133
}
@@ -130,6 +136,8 @@
130136
}
131137
```
132138

139+
Replace `<project-ref>` with your project ref.
140+
133141
</TabPanel>
134142

135143
</Tabs>

apps/docs/content/guides/getting-started/mcp.mdx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ First, go to your [Supabase settings](https://supabase.com/dashboard/account/tok
2323

2424
## Step 2: Configure in your AI tool
2525

26-
MCP compatible tools can connect to Supabase using the [Supabase MCP server](https://github.com/supabase-community/supabase-mcp). Below are instructions for connecting to this server using popular AI tools:
26+
MCP compatible tools can connect to Supabase using the [Supabase MCP server](https://github.com/supabase-community/supabase-mcp).
27+
28+
Follow the instructions for your AI tool to connect the Supabase MCP server. The configuration below uses read-only, project-scoped mode by default. We recommend these settings to prevent the agent from making unintended changes to your database. Note that read-only mode applies only to database operations. Write operations on project-management tools, such as `create_project`, are still available.
2729

2830
### Cursor
2931

@@ -53,9 +55,9 @@ MCP compatible tools can connect to Supabase using the [Supabase MCP server](htt
5355

5456
<div className="mb-8 not-prose [&>p]:flex [&>p]:flex-col [&>p]:gap-2">
5557
[![Install with NPX in VS
56-
Code](https://img.shields.io/badge/VS_Code-NPM-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=supabase&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22supabase-access-token%22%2C%22description%22%3A%22Supabase%20personal%20access%20token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40supabase%2Fmcp-server-supabase%40latest%22%5D%2C%22env%22%3A%7B%22SUPABASE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Asupabase-access-token%7D%22%7D%7D)
58+
Code](https://img.shields.io/badge/VS_Code-NPM-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=supabase&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22supabase-access-token%22%2C%22description%22%3A%22Supabase%20personal%20access%20token%22%2C%22password%22%3Atrue%7D%5D%26config%3D%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40supabase%2Fmcp-server-supabase%40latest%22%2C%22--readonly%22%2C%22--project-ref%3D%24SUPABASE_MCP_PROJECT_REF%22%5D%2C%22env%22%3A%7B%22SUPABASE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Asupabase-access-token%7D%22%2C%22SUPABASE_MCP_PROJECT_REF%22%3A%22%24%7Binput%3Asupabase-project-ref%7D%22%7D%7D)
5759
[![Install with NPX in VS Code
58-
Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=supabase&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22supabase-access-token%22%2C%22description%22%3A%22Supabase%20personal%20access%20token%22%2C%22password%22%3Atrue%7D%5D&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40supabase%2Fmcp-server-supabase%40latest%22%5D%2C%22env%22%3A%7B%22SUPABASE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Asupabase-access-token%7D%22%7D%7D&quality=insiders)
60+
Insiders](https://img.shields.io/badge/VS_Code_Insiders-NPM-24bfa5?style=flat-square&logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect/mcp/install?name=supabase&inputs=%5B%7B%22type%22%3A%22promptString%22%2C%22id%22%3A%22supabase-access-token%22%2C%22description%22%3A%22Supabase%20personal%20access%20token%22%2C%22password%22%3Atrue%7D%5D%26config%3D%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40supabase%2Fmcp-server-supabase%40latest%22%2C%22--readonly%22%2C%22--project-ref%3D%24SUPABASE_MCP_PROJECT_REF%22%5D%2C%22env%22%3A%7B%22SUPABASE_ACCESS_TOKEN%22%3A%22%24%7Binput%3Asupabase-access-token%7D%22%2C%22SUPABASE_MCP_PROJECT_REF%22%3A%22%24%7Binput%3Asupabase-project-ref%7D%22%7D%7D)
5961
</div>
6062

6163
1. Open [VS Code](https://code.visualstudio.com/) and create a `.vscode` directory in your project root if it doesn't exist.

0 commit comments

Comments
 (0)