opencode-supabase 0.3.1-alpha.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-supabase",
|
|
3
|
-
"version": "0.3.1
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Supabase integration with server and TUI components",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,4 +49,4 @@
|
|
|
49
49
|
"solid-js": "1.9.11",
|
|
50
50
|
"typescript": "^5"
|
|
51
51
|
}
|
|
52
|
-
}
|
|
52
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: opencode-supabase-guide
|
|
3
|
-
description: Use when users ask to set up Supabase MCP in OpenCode, paste Supabase Studio MCP config, or need MCP tools connected.
|
|
3
|
+
description: Use when users ask to set up Supabase MCP in OpenCode, connect project to MCP, connect a project to MCP, connect MCP, conenct MCP, connect MCP server, connect Supabase MCP, paste Supabase Studio MCP config, or need MCP tools connected.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# OpenCode Supabase Guide
|
|
@@ -36,7 +36,33 @@ Supabase MCP adds project-scoped Supabase tools to OpenCode. Before MCP setup, t
|
|
|
36
36
|
3. After a project is selected, offer to connect that project to Supabase MCP.
|
|
37
37
|
4. If user confirms, call `supabase_open_mcp_setup`.
|
|
38
38
|
5. Tell user to paste the Studio prompt or OpenCode config snippet back here.
|
|
39
|
-
6. After config is added, tell user to
|
|
39
|
+
6. After config is added, tell user to close OpenCode or exit the current session, run `opencode mcp auth supabase`, complete OAuth in the browser, then start OpenCode again.
|
|
40
|
+
|
|
41
|
+
User phrases that MUST trigger this flow include: `connect project to MCP`, `connect a project to MCP`, `connect MCP`, `conenct MCP`, `connect MCP server`, `connect Supabase MCP`, and `connect to Supabase MCP`.
|
|
42
|
+
|
|
43
|
+
Never list projects as bullets and ask the user to reply in prose. Use this Question tool shape for project selection:
|
|
44
|
+
|
|
45
|
+
```json
|
|
46
|
+
{
|
|
47
|
+
"questions": [
|
|
48
|
+
{
|
|
49
|
+
"header": "Choose Project",
|
|
50
|
+
"question": "Which project do you want to connect to Supabase MCP?",
|
|
51
|
+
"multiple": false,
|
|
52
|
+
"options": [
|
|
53
|
+
{
|
|
54
|
+
"label": "opencode-tester",
|
|
55
|
+
"description": "Project ref: abcdefghijklmnopqrst"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"label": "analytics-prod",
|
|
59
|
+
"description": "Project ref: zyxwvutsrqponmlkjihg"
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
```
|
|
40
66
|
|
|
41
67
|
Use this Question tool shape before opening Studio:
|
|
42
68
|
|
|
@@ -99,13 +125,14 @@ I will set up MCP now.
|
|
|
99
125
|
|
|
100
126
|
After Studio config is pasted or applied:
|
|
101
127
|
|
|
102
|
-
OAuth is a required separate step. OpenCode
|
|
128
|
+
OAuth is a required separate step. The current OpenCode TUI session cannot reload the MCP config. Close OpenCode or exit the current session, then `opencode mcp auth supabase` starts browser OAuth for that MCP server. Start OpenCode again after OAuth completes.
|
|
103
129
|
|
|
104
130
|
Say this:
|
|
105
131
|
|
|
106
132
|
```text
|
|
107
|
-
|
|
133
|
+
Close OpenCode or exit the current session, then run `opencode mcp auth supabase`.
|
|
108
134
|
Complete OAuth in the browser.
|
|
135
|
+
Start OpenCode again after OAuth completes.
|
|
109
136
|
```
|
|
110
137
|
|
|
111
138
|
Do not say:
|
|
@@ -115,7 +142,7 @@ OAuth starts by itself after restart.
|
|
|
115
142
|
Run auth only if MCP fails.
|
|
116
143
|
```
|
|
117
144
|
|
|
118
|
-
Never tell the user to wait for automatic OAuth. Always tell them to
|
|
145
|
+
Never tell the user to wait for automatic OAuth. Always tell them to close OpenCode or exit the current session, run `opencode mcp auth supabase`, complete OAuth in the browser, and start OpenCode again after OAuth completes.
|
|
119
146
|
|
|
120
147
|
If config already exists:
|
|
121
148
|
|
|
@@ -123,7 +150,9 @@ Say this:
|
|
|
123
150
|
|
|
124
151
|
```text
|
|
125
152
|
Supabase MCP config already exists for this workspace. No file changes needed.
|
|
126
|
-
|
|
153
|
+
Close OpenCode or exit the current session, then run `opencode mcp auth supabase`.
|
|
154
|
+
Complete OAuth in the browser.
|
|
155
|
+
Start OpenCode again after OAuth completes.
|
|
127
156
|
```
|
|
128
157
|
|
|
129
158
|
Do not say:
|
|
@@ -146,10 +175,11 @@ Restarting loaded the config; cached auth let the MCP server work without a new
|
|
|
146
175
|
OpenCode does not automatically start OAuth after config is added. OAuth is a required separate step. After adding MCP config, tell the user:
|
|
147
176
|
|
|
148
177
|
```text
|
|
149
|
-
|
|
178
|
+
Close OpenCode or exit the current session, then run:
|
|
150
179
|
opencode mcp auth supabase
|
|
151
180
|
|
|
152
181
|
Complete OAuth in the browser.
|
|
182
|
+
Start OpenCode again after OAuth completes.
|
|
153
183
|
```
|
|
154
184
|
|
|
155
185
|
## Studio Prompt Handling
|
|
@@ -158,17 +188,18 @@ Extract MCP JSON from Studio prompt. Strip line numbers (`1{`). Preserve URLs ex
|
|
|
158
188
|
|
|
159
189
|
## Config Rules
|
|
160
190
|
|
|
161
|
-
Prefer `.opencode/opencode.json` (or `.opencode/opencode.jsonc`). Global (`~/.config/opencode/opencode.json`) only on explicit request. Use `question` tool before editing. Remind to
|
|
191
|
+
Prefer `.opencode/opencode.json` (or `.opencode/opencode.jsonc`). Global (`~/.config/opencode/opencode.json`) only on explicit request. Use `question` tool before editing. Remind to close OpenCode or exit the current session before auth, then start OpenCode again after OAuth completes.
|
|
162
192
|
|
|
163
193
|
If the Studio config is already present in `.opencode/opencode.json` or `.opencode/opencode.jsonc`, say:
|
|
164
194
|
|
|
165
195
|
```text
|
|
166
196
|
Supabase MCP config already exists for this workspace. No file changes needed.
|
|
167
197
|
|
|
168
|
-
|
|
198
|
+
Close OpenCode or exit the current session, then run:
|
|
169
199
|
opencode mcp auth supabase
|
|
170
200
|
|
|
171
201
|
Complete OAuth in the browser.
|
|
202
|
+
Start OpenCode again after OAuth completes.
|
|
172
203
|
```
|
|
173
204
|
|
|
174
205
|
Do not say `already wired` without explaining the restart and auth steps.
|
|
@@ -184,8 +215,8 @@ Do not say `already wired` without explaining the restart and auth steps.
|
|
|
184
215
|
| Choosing MCP features for user | Studio decides read-only, feature groups |
|
|
185
216
|
| Calling MCP setup while unauthenticated | Tell user to run `/supabase` first |
|
|
186
217
|
| Asking user without `question` tool | Always use `question` tool for confirmations, project selection, any interactive choice |
|
|
187
|
-
| Saying OAuth happens automatically | OAuth is a required separate step:
|
|
218
|
+
| Saying OAuth happens automatically | OAuth is a required separate step: close OpenCode or exit the current session, run `opencode mcp auth supabase`, complete browser OAuth, start OpenCode again |
|
|
188
219
|
|
|
189
220
|
## Troubleshooting
|
|
190
221
|
|
|
191
|
-
MCP tools missing after config? Say: `
|
|
222
|
+
MCP tools missing after config? Say: `Close OpenCode or exit the current session, run opencode mcp auth supabase, complete OAuth, then start OpenCode again.`
|
package/src/server/tools.ts
CHANGED
|
@@ -443,10 +443,12 @@ function formatMcpSetupResult(url: string) {
|
|
|
443
443
|
"",
|
|
444
444
|
"Skip any install Supabase Agent Skills step; this plugin already bundles them.",
|
|
445
445
|
"",
|
|
446
|
-
"After adding config
|
|
446
|
+
"After adding config:",
|
|
447
|
+
"1. Close OpenCode or exit the current session.",
|
|
448
|
+
"2. Run:",
|
|
447
449
|
"opencode mcp auth supabase",
|
|
448
|
-
"",
|
|
449
|
-
"
|
|
450
|
+
"3. Complete OAuth in the browser.",
|
|
451
|
+
"4. Start OpenCode again.",
|
|
450
452
|
].join("\n")
|
|
451
453
|
}
|
|
452
454
|
|