@meetopenbot/supabase 1.1.0
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/README.md +33 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +40 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @meetopenbot/supabase
|
|
2
|
+
|
|
3
|
+
Supabase specialist agent for OpenBot: MCP-backed projects, SQL, migrations, and Edge Functions.
|
|
4
|
+
|
|
5
|
+
## Features (MVP)
|
|
6
|
+
|
|
7
|
+
- **Agent** — OpenAI + Supabase's official MCP (`https://mcp.supabase.com/mcp`)
|
|
8
|
+
- **Auth** — personal access token via the `SUPABASE_ACCESS_TOKEN` workspace variable
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
1. Create a personal access token at [Supabase → Account → Access Tokens](https://supabase.com/dashboard/account/tokens).
|
|
13
|
+
|
|
14
|
+
2. Add the plugin to your agent's `AGENT.md`:
|
|
15
|
+
|
|
16
|
+
```yaml
|
|
17
|
+
plugins:
|
|
18
|
+
- id: "@meetopenbot/supabase"
|
|
19
|
+
config:
|
|
20
|
+
model: openai/gpt-4o-mini
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Store the token as a secret workspace variable named `SUPABASE_ACCESS_TOKEN`. LLM calls use `OPENAI_API_KEY` when set (BYOK), otherwise OpenBot Credits.
|
|
24
|
+
|
|
25
|
+
Production projects can contain sensitive data. Prefer a project-scoped, read-only token when you only need to inspect data.
|
|
26
|
+
|
|
27
|
+
## Build
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pnpm --filter @meetopenbot/supabase build
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Restart the OpenBot runtime to load the plugin.
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineMcpAgent } from '@meetopenbot/plugin-sdk';
|
|
2
|
+
const SYSTEM_PROMPT = `You are the OpenBot Supabase specialist agent. Help users inspect and manage Supabase projects: database schema, SQL, migrations, logs, advisors, Edge Functions, branching, and docs.
|
|
3
|
+
|
|
4
|
+
## Ground rules
|
|
5
|
+
- Use Supabase MCP tools for all project facts. Never invent project refs, table names, SQL results, keys, or counts.
|
|
6
|
+
- Authentication is already configured. Do not call auth tools.
|
|
7
|
+
- Use prior conversation context when provided. Treat the latest user message as the current request.
|
|
8
|
+
- If the request is ambiguous (which project, which schema, or destructive SQL), ask a short clarifying question instead of guessing.
|
|
9
|
+
- Omit optional tool parameters when unused. Never pass empty strings or empty arrays for optional filters.
|
|
10
|
+
- Confirm before apply_migration, execute_sql that writes or deletes, deploy_edge_function, pause_project, or branch merge/reset/delete unless the user was explicit.
|
|
11
|
+
- Prefer list_tables / list_projects to discover names before querying. Prefer read-only SQL unless the user asked to change data.
|
|
12
|
+
- Do not expose service-role or other secret keys. Publishable/anon keys are fine when the user asks for them.
|
|
13
|
+
|
|
14
|
+
## Tool selection
|
|
15
|
+
- Discovery: list_projects, get_project, list_organizations. Then list_tables, list_extensions, list_migrations.
|
|
16
|
+
- Data and schema: execute_sql for queries; apply_migration for schema changes.
|
|
17
|
+
- Debugging: query_logs, get_advisors.
|
|
18
|
+
- App wiring: get_project_url, get_publishable_keys, generate_typescript_types.
|
|
19
|
+
- Functions: list_edge_functions, get_edge_function, deploy_edge_function.
|
|
20
|
+
- Product help: search_docs.
|
|
21
|
+
- Branching (paid): create/list/delete/merge/reset/rebase branch tools.
|
|
22
|
+
- Storage: only when those tools are available.
|
|
23
|
+
|
|
24
|
+
## Response style
|
|
25
|
+
Reply in concise plain text. Lead with the outcome, then key details (project ref, table names, row counts, URLs). Mention if you searched but found nothing.`;
|
|
26
|
+
export const plugin = await defineMcpAgent({
|
|
27
|
+
name: 'Supabase',
|
|
28
|
+
description: 'Supabase MCP-backed specialist agent for projects, SQL, and Edge Functions',
|
|
29
|
+
models: { providers: ['openai'], default: 'openai/gpt-4o-mini' },
|
|
30
|
+
secret: { envKeys: ['SUPABASE_ACCESS_TOKEN'] },
|
|
31
|
+
mcp: {
|
|
32
|
+
url: 'https://mcp.supabase.com/mcp',
|
|
33
|
+
headers: (token) => ({ Authorization: `Bearer ${token}` }),
|
|
34
|
+
},
|
|
35
|
+
system: SYSTEM_PROMPT,
|
|
36
|
+
maxSteps: 10,
|
|
37
|
+
history: true,
|
|
38
|
+
sanitizeEmptyArgs: true,
|
|
39
|
+
});
|
|
40
|
+
export default plugin;
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@meetopenbot/supabase",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Supabase MCP-backed specialist agent for OpenBot",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@meetopenbot/plugin-sdk": "^1.0.4"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.10.1",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc && node ../../scripts/write-plugin-declaration.mjs",
|
|
30
|
+
"dev": "tsc --watch --preserveWatchOutput",
|
|
31
|
+
"typecheck": "tsc --noEmit"
|
|
32
|
+
}
|
|
33
|
+
}
|