@exposify/supabase 0.3.14 → 0.3.15
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 +40 -7
- package/dist/cli.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @exposify/supabase
|
|
1
|
+
# @exposify/supabase
|
|
2
2
|
|
|
3
3
|
Make a Supabase-backed app's database and edge functions usable by AI agents:
|
|
4
4
|
one edge function serves MCP, with tools generated from your database
|
|
@@ -7,9 +7,42 @@ register. The caller's JWT passes straight through to PostgREST — **RLS is
|
|
|
7
7
|
the authorization layer**. The agent can do exactly what that logged-in user
|
|
8
8
|
can do, nothing more.
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
> **Which package?** Use **`@exposify/supabase`** when you want an MCP
|
|
11
|
+
> endpoint served straight from a Supabase **edge function** over PostgREST,
|
|
12
|
+
> with RLS as the authorization layer. If you have a **Next.js app** (even one
|
|
13
|
+
> whose users sign in with Supabase Auth), use
|
|
14
|
+
> [**`@exposify/next`**](https://github.com/ayadagain/agentready/tree/main/packages/next)
|
|
15
|
+
> instead, so tool calls run through your Next server and your own middleware
|
|
16
|
+
> and checks apply.
|
|
17
|
+
|
|
18
|
+
## Quickstart
|
|
19
|
+
|
|
20
|
+
From your Supabase project's root (the directory containing `supabase/`):
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npx @exposify/supabase init # scaffold the migration + mcp function
|
|
24
|
+
supabase db push # apply the exposify_meta() migration
|
|
25
|
+
supabase functions deploy mcp # deploy the MCP edge function
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Then point an MCP client at the function's URL with a user's JWT — e.g. with
|
|
29
|
+
the Claude Code CLI:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
claude mcp add --transport http my-app \
|
|
33
|
+
https://<project-ref>.supabase.co/functions/v1/mcp \
|
|
34
|
+
--header "Authorization: Bearer <user-jwt>"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Every RLS-enabled table you can `SELECT` becomes a `query_<table>` tool
|
|
38
|
+
automatically; writes and RPCs are opt-in. `init` is interactive and can run
|
|
39
|
+
`db push`/`functions deploy` for you, wire in the hosted broker or Supabase
|
|
40
|
+
Auth OAuth (so clients sign in by themselves instead of pasting an hourly
|
|
41
|
+
JWT), and write tool descriptions from your SQL comments — see the sections
|
|
42
|
+
below. Check the whole setup any time with `npx @exposify/supabase doctor`.
|
|
43
|
+
|
|
44
|
+
The rest of this guide is reference, end to end. For the design rationale, see
|
|
45
|
+
the [design spec](https://github.com/ayadagain/agentready/blob/main/docs/superpowers/specs/2026-08-15-agentify-supabase-design.md).
|
|
13
46
|
|
|
14
47
|
## Prerequisites
|
|
15
48
|
|
|
@@ -199,7 +232,7 @@ things:
|
|
|
199
232
|
Until the project has a sign-in method (the Supabase preset in the
|
|
200
233
|
dashboard), agents use the function signed out, as `anon`, with no sign-in
|
|
201
234
|
asked: there's nothing to sign in with. The log says which it is
|
|
202
|
-
(`[
|
|
235
|
+
(`[exposify] How agents sign in: ...`), and adding the method takes effect
|
|
203
236
|
within a minute.
|
|
204
237
|
|
|
205
238
|
MCP clients then click Connect and sign in through the broker (or send a
|
|
@@ -490,7 +523,7 @@ Supabase user JWTs expire (default 1h) and their refresh tokens rotate; a plain
|
|
|
490
523
|
MCP client can hold a bearer token but can't refresh it. Exposify's hosted
|
|
491
524
|
broker holds each user's session, refreshes it, and swaps the agent's
|
|
492
525
|
long-lived connection token (`extb_...`) for a live Supabase JWT on every
|
|
493
|
-
call ([
|
|
526
|
+
call (see the [hosted broker guide](https://github.com/ayadagain/agentready/blob/main/docs/hosted-broker.md)). `init` sets it
|
|
494
527
|
up (see "Using the hosted broker" above); by hand:
|
|
495
528
|
|
|
496
529
|
```sh
|
|
@@ -589,7 +622,7 @@ the function prints whether MCP is up. It shows in `supabase functions serve`
|
|
|
589
622
|
locally and in the function's logs in production:
|
|
590
623
|
|
|
591
624
|
```
|
|
592
|
-
[
|
|
625
|
+
[exposify] MCP ready at https://<ref>.supabase.co/functions/v1/mcp: 9 tools (5 query, 2 write, 1 rpc, search_docs), 3 docs indexed, auth: passthrough (caller's JWT)
|
|
593
626
|
```
|
|
594
627
|
|
|
595
628
|
- **Manifest fallback:** the same line, marked "from the bundled manifest",
|
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -107,7 +107,7 @@ function warnOnce(message) {
|
|
|
107
107
|
if (warned.has(message)) return;
|
|
108
108
|
warned.add(message);
|
|
109
109
|
try {
|
|
110
|
-
console.warn(`[
|
|
110
|
+
console.warn(`[exposify] ${message}`);
|
|
111
111
|
} catch {
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -755,7 +755,7 @@ function createSupabaseOAuthGate(oauth, supabaseUrl, fetchImpl) {
|
|
|
755
755
|
|
|
756
756
|
// src/startup.ts
|
|
757
757
|
var import_core4 = require("@exposify/core");
|
|
758
|
-
var LOG_PREFIX = "[
|
|
758
|
+
var LOG_PREFIX = "[exposify]";
|
|
759
759
|
var INTROSPECTION_FIX = "check that SUPABASE_SERVICE_ROLE_KEY is available to the function and the exposify_meta migration is applied (`supabase db push`); the reason is logged above. To survive this, bundle a manifest with `npx @exposify/supabase generate`";
|
|
760
760
|
function supabaseToolsPhrase(ladder, cfg, hasDocs) {
|
|
761
761
|
const query = ladder.tables.length;
|
|
@@ -874,7 +874,7 @@ function aiReady(options = {}) {
|
|
|
874
874
|
manifest: options.manifest
|
|
875
875
|
}).then((ladder) => {
|
|
876
876
|
for (const w of ladder.warnings) {
|
|
877
|
-
console.error(`[
|
|
877
|
+
console.error(`[exposify] degradation ladder: ${w.rung}: ${w.reason}`);
|
|
878
878
|
}
|
|
879
879
|
return ladder;
|
|
880
880
|
});
|
package/dist/index.js
CHANGED
|
@@ -70,7 +70,7 @@ function warnOnce(message) {
|
|
|
70
70
|
if (warned.has(message)) return;
|
|
71
71
|
warned.add(message);
|
|
72
72
|
try {
|
|
73
|
-
console.warn(`[
|
|
73
|
+
console.warn(`[exposify] ${message}`);
|
|
74
74
|
} catch {
|
|
75
75
|
}
|
|
76
76
|
}
|
|
@@ -722,7 +722,7 @@ function createSupabaseOAuthGate(oauth, supabaseUrl, fetchImpl) {
|
|
|
722
722
|
|
|
723
723
|
// src/startup.ts
|
|
724
724
|
import { formatFailed, formatReady, formatWarning } from "@exposify/core";
|
|
725
|
-
var LOG_PREFIX = "[
|
|
725
|
+
var LOG_PREFIX = "[exposify]";
|
|
726
726
|
var INTROSPECTION_FIX = "check that SUPABASE_SERVICE_ROLE_KEY is available to the function and the exposify_meta migration is applied (`supabase db push`); the reason is logged above. To survive this, bundle a manifest with `npx @exposify/supabase generate`";
|
|
727
727
|
function supabaseToolsPhrase(ladder, cfg, hasDocs) {
|
|
728
728
|
const query = ladder.tables.length;
|
|
@@ -841,7 +841,7 @@ function aiReady(options = {}) {
|
|
|
841
841
|
manifest: options.manifest
|
|
842
842
|
}).then((ladder) => {
|
|
843
843
|
for (const w of ladder.warnings) {
|
|
844
|
-
console.error(`[
|
|
844
|
+
console.error(`[exposify] degradation ladder: ${w.rung}: ${w.reason}`);
|
|
845
845
|
}
|
|
846
846
|
return ladder;
|
|
847
847
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exposify/supabase",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.15",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prepack": "yarn build"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@exposify/core": "0.3.
|
|
30
|
+
"@exposify/core": "0.3.19",
|
|
31
31
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
32
32
|
"zod": "^3.24.0"
|
|
33
33
|
},
|