@nyuchi/mzizi-mcp 0.9.0 → 0.10.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/LICENSE +202 -0
- package/README.md +115 -85
- package/dist/access.d.ts +69 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +72 -0
- package/dist/access.js.map +1 -0
- package/dist/auth/authkit-handler.d.ts +4 -3
- package/dist/auth/authkit-handler.d.ts.map +1 -1
- package/dist/auth/authkit-handler.js +52 -6
- package/dist/auth/authkit-handler.js.map +1 -1
- package/dist/auth/front.d.ts +17 -0
- package/dist/auth/front.d.ts.map +1 -0
- package/dist/auth/front.js +25 -0
- package/dist/auth/front.js.map +1 -0
- package/dist/auth/mcp-api-handler.d.ts +20 -7
- package/dist/auth/mcp-api-handler.d.ts.map +1 -1
- package/dist/auth/mcp-api-handler.js +43 -29
- package/dist/auth/mcp-api-handler.js.map +1 -1
- package/dist/desk-context.d.ts +33 -0
- package/dist/desk-context.d.ts.map +1 -0
- package/dist/desk-context.js +49 -0
- package/dist/desk-context.js.map +1 -0
- package/dist/docs-federation.d.ts +68 -0
- package/dist/docs-federation.d.ts.map +1 -0
- package/dist/docs-federation.js +282 -0
- package/dist/docs-federation.js.map +1 -0
- package/dist/env.d.ts +7 -8
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +5 -5
- package/dist/fundi-a2a.d.ts +1 -1
- package/dist/fundi-a2a.js +2 -2
- package/dist/fundi-a2a.js.map +1 -1
- package/dist/fundi-client.d.ts +24 -4
- package/dist/fundi-client.d.ts.map +1 -1
- package/dist/fundi-client.js +91 -4
- package/dist/fundi-client.js.map +1 -1
- package/dist/generated/registry-pin.d.ts +5 -0
- package/dist/generated/registry-pin.d.ts.map +1 -0
- package/dist/generated/registry-pin.js +3 -0
- package/dist/generated/registry-pin.js.map +1 -0
- package/dist/generated/registry.d.ts +23 -0
- package/dist/generated/registry.d.ts.map +1 -0
- package/dist/generated/registry.js +1204 -0
- package/dist/generated/registry.js.map +1 -0
- package/dist/generated/skills.d.ts +18 -0
- package/dist/generated/skills.d.ts.map +1 -0
- package/dist/generated/skills.js +67 -0
- package/dist/generated/skills.js.map +1 -0
- package/dist/http.d.ts +18 -9
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +16 -13
- package/dist/http.js.map +1 -1
- package/dist/issue-desk.d.ts +152 -0
- package/dist/issue-desk.d.ts.map +1 -0
- package/dist/issue-desk.js +392 -0
- package/dist/issue-desk.js.map +1 -0
- package/dist/issue-log.d.ts +80 -0
- package/dist/issue-log.d.ts.map +1 -0
- package/dist/issue-log.js +146 -0
- package/dist/issue-log.js.map +1 -0
- package/dist/issue-report.d.ts +138 -0
- package/dist/issue-report.d.ts.map +1 -0
- package/dist/issue-report.js +112 -0
- package/dist/issue-report.js.map +1 -0
- package/dist/rate-limit.d.ts +41 -0
- package/dist/rate-limit.d.ts.map +1 -0
- package/dist/rate-limit.js +58 -0
- package/dist/rate-limit.js.map +1 -0
- package/dist/registry.d.ts +126 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +280 -0
- package/dist/registry.js.map +1 -0
- package/dist/server.d.ts +96 -22
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +76 -32
- package/dist/server.js.map +1 -1
- package/dist/stdio.d.ts +6 -13
- package/dist/stdio.d.ts.map +1 -1
- package/dist/stdio.js +6 -29
- package/dist/stdio.js.map +1 -1
- package/dist/tools.d.ts +45 -6
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +313 -82
- package/dist/tools.js.map +1 -1
- package/dist/worker.d.ts +26 -14
- package/dist/worker.d.ts.map +1 -1
- package/dist/worker.js +42 -14
- package/dist/worker.js.map +1 -1
- package/package.json +24 -19
- package/dist/api-client.d.ts +0 -101
- package/dist/api-client.d.ts.map +0 -1
- package/dist/api-client.js +0 -200
- package/dist/api-client.js.map +0 -1
- package/dist/defaults.d.ts +0 -29
- package/dist/defaults.d.ts.map +0 -1
- package/dist/defaults.js +0 -29
- package/dist/defaults.js.map +0 -1
package/dist/worker.d.ts
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cloudflare Worker entry — mcp.mzizi.dev
|
|
3
3
|
*
|
|
4
|
-
* mzizi-mcp is
|
|
5
|
-
*
|
|
6
|
-
* resource server — it serves `/.well-known/*` metadata + Dynamic Client
|
|
7
|
-
* Registration (`/register`) + `/authorize` + `/token`, which is what lets
|
|
8
|
-
* remote MCP clients (including the claude.ai web "custom connector" flow)
|
|
9
|
-
* complete the handshake and connect.
|
|
4
|
+
* mzizi-mcp is free, with no gate except Fundi (owner decision, 2026-09-29).
|
|
5
|
+
* Two fronts share one MCP handler:
|
|
10
6
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* POST/GET/DELETE /mcp, no Authorization header
|
|
8
|
+
* → the free tier. Rate-limited per IP, then the MCP handler with no
|
|
9
|
+
* user: every tool except the Fundi ones (`access.ts`).
|
|
10
|
+
* everything else, including /mcp WITH a bearer token and /mcp/signin
|
|
11
|
+
* → the `@cloudflare/workers-oauth-provider` front, unchanged. It serves
|
|
12
|
+
* `/.well-known/*` metadata, Dynamic Client Registration (`/register`),
|
|
13
|
+
* `/authorize` and `/token`, validates the token on the API route and
|
|
14
|
+
* puts the WorkOS identity on `ctx.props`; the defaultHandler is the
|
|
15
|
+
* WorkOS AuthKit login/consent (AuthkitHandler).
|
|
13
16
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* Why an optional-auth front rather than a second Worker or a flag inside the
|
|
18
|
+
* provider: the provider is what makes `ctx.props` trustworthy, and it answers
|
|
19
|
+
* 401 to every tokenless request on its API route. Routing ONLY the tokenless
|
|
20
|
+
* `/mcp` request around it keeps that guarantee intact: a request that presents
|
|
21
|
+
* a token is always validated (a bad or expired one still gets the 401 that
|
|
22
|
+
* makes a client refresh), `ctx.props` is only ever set by the provider, and
|
|
23
|
+
* the handler learns "is there a user" from whether `ctx.props` is present.
|
|
24
|
+
*
|
|
25
|
+
* `/mcp/signin` is the same handler with the provider's 401 left in place, so a
|
|
26
|
+
* client that wants to sign in has a URL that asks for it (see access.ts).
|
|
18
27
|
*/
|
|
19
|
-
import
|
|
28
|
+
import type { Env } from "./env.js";
|
|
20
29
|
export type { Env } from "./env.js";
|
|
21
|
-
|
|
30
|
+
export { IssueDesk } from "./issue-desk.js";
|
|
31
|
+
declare const _default: {
|
|
32
|
+
fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response>;
|
|
33
|
+
};
|
|
22
34
|
export default _default;
|
|
23
35
|
//# sourceMappingURL=worker.d.ts.map
|
package/dist/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAKH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAInC,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAMnC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;;mBAapB,OAAO,OAAO,GAAG,OAAO,gBAAgB,GAAG,OAAO,CAAC,QAAQ,CAAC;;AADnF,wBASgC"}
|
package/dist/worker.js
CHANGED
|
@@ -1,25 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Cloudflare Worker entry — mcp.mzizi.dev
|
|
3
3
|
*
|
|
4
|
-
* mzizi-mcp is
|
|
5
|
-
*
|
|
6
|
-
* resource server — it serves `/.well-known/*` metadata + Dynamic Client
|
|
7
|
-
* Registration (`/register`) + `/authorize` + `/token`, which is what lets
|
|
8
|
-
* remote MCP clients (including the claude.ai web "custom connector" flow)
|
|
9
|
-
* complete the handshake and connect.
|
|
4
|
+
* mzizi-mcp is free, with no gate except Fundi (owner decision, 2026-09-29).
|
|
5
|
+
* Two fronts share one MCP handler:
|
|
10
6
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
7
|
+
* POST/GET/DELETE /mcp, no Authorization header
|
|
8
|
+
* → the free tier. Rate-limited per IP, then the MCP handler with no
|
|
9
|
+
* user: every tool except the Fundi ones (`access.ts`).
|
|
10
|
+
* everything else, including /mcp WITH a bearer token and /mcp/signin
|
|
11
|
+
* → the `@cloudflare/workers-oauth-provider` front, unchanged. It serves
|
|
12
|
+
* `/.well-known/*` metadata, Dynamic Client Registration (`/register`),
|
|
13
|
+
* `/authorize` and `/token`, validates the token on the API route and
|
|
14
|
+
* puts the WorkOS identity on `ctx.props`; the defaultHandler is the
|
|
15
|
+
* WorkOS AuthKit login/consent (AuthkitHandler).
|
|
13
16
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
17
|
+
* Why an optional-auth front rather than a second Worker or a flag inside the
|
|
18
|
+
* provider: the provider is what makes `ctx.props` trustworthy, and it answers
|
|
19
|
+
* 401 to every tokenless request on its API route. Routing ONLY the tokenless
|
|
20
|
+
* `/mcp` request around it keeps that guarantee intact: a request that presents
|
|
21
|
+
* a token is always validated (a bad or expired one still gets the 401 that
|
|
22
|
+
* makes a client refresh), `ctx.props` is only ever set by the provider, and
|
|
23
|
+
* the handler learns "is there a user" from whether `ctx.props` is present.
|
|
24
|
+
*
|
|
25
|
+
* `/mcp/signin` is the same handler with the provider's 401 left in place, so a
|
|
26
|
+
* client that wants to sign in has a URL that asks for it (see access.ts).
|
|
18
27
|
*/
|
|
19
28
|
import OAuthProvider from "@cloudflare/workers-oauth-provider";
|
|
20
29
|
import { AuthkitHandler } from "./auth/authkit-handler.js";
|
|
21
|
-
import { mcpApiHandler } from "./auth/mcp-api-handler.js";
|
|
22
|
-
|
|
30
|
+
import { mcpApiHandler, serveAnonymous } from "./auth/mcp-api-handler.js";
|
|
31
|
+
import { limitAnonymous } from "./rate-limit.js";
|
|
32
|
+
import { isAnonymousMcpRequest } from "./auth/front.js";
|
|
33
|
+
// The per-user issue desk. Exported here because Cloudflare resolves a Durable
|
|
34
|
+
// Object class off the Worker's entry module, and `wrangler.toml` names this
|
|
35
|
+
// file — an unexported class fails the deploy with "class not found", which
|
|
36
|
+
// reads like a config error and is a missing export.
|
|
37
|
+
export { IssueDesk } from "./issue-desk.js";
|
|
38
|
+
const oauth = new OAuthProvider({
|
|
39
|
+
// A prefix: it covers `/mcp` and `/mcp/signin`.
|
|
23
40
|
apiRoute: "/mcp",
|
|
24
41
|
apiHandler: mcpApiHandler,
|
|
25
42
|
defaultHandler: AuthkitHandler,
|
|
@@ -27,4 +44,15 @@ export default new OAuthProvider({
|
|
|
27
44
|
tokenEndpoint: "/token",
|
|
28
45
|
clientRegistrationEndpoint: "/register",
|
|
29
46
|
});
|
|
47
|
+
export default {
|
|
48
|
+
async fetch(request, env, ctx) {
|
|
49
|
+
if (isAnonymousMcpRequest(request)) {
|
|
50
|
+
const limited = await limitAnonymous(env.ANON_RATE_LIMIT, request);
|
|
51
|
+
if (limited)
|
|
52
|
+
return limited;
|
|
53
|
+
return serveAnonymous(request, env);
|
|
54
|
+
}
|
|
55
|
+
return oauth.fetch(request, env, ctx);
|
|
56
|
+
},
|
|
57
|
+
};
|
|
30
58
|
//# sourceMappingURL=worker.js.map
|
package/dist/worker.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worker.js","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,aAAa,MAAM,oCAAoC,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC1D,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAEzE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAIvD,+EAA+E;AAC/E,6EAA6E;AAC7E,4EAA4E;AAC5E,qDAAqD;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,MAAM,KAAK,GAAG,IAAI,aAAa,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,aAAsB;IAClC,cAAc,EAAE,cAAuB;IACvC,iBAAiB,EAAE,YAAY;IAC/B,aAAa,EAAE,QAAQ;IACvB,0BAA0B,EAAE,WAAW;CACxC,CAAC,CAAA;AAEF,eAAe;IACb,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE,GAAQ,EAAE,GAAqB;QAC3D,IAAI,qBAAqB,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,MAAM,OAAO,GAAG,MAAM,cAAc,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,CAAA;YAClE,IAAI,OAAO;gBAAE,OAAO,OAAO,CAAA;YAC3B,OAAO,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;QACrC,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACvC,CAAC;CAC6B,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nyuchi/mzizi-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"mcpName": "io.github.nyuchi/mzizi-mcp",
|
|
8
|
-
"description": "Mzizi MCP — Model Context Protocol server for the Mzizi
|
|
8
|
+
"description": "Mzizi MCP — Model Context Protocol server for the Mzizi design system: registry, design tokens, doctrine, agent skills and the docs.mzizi.dev docs. Free with no account; sign-in only for the Fundi tools. Registry data and skills are bundled at build time from a pinned registry commit; holds no database credential.",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"homepage": "https://mzizi.dev",
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
|
13
|
-
"url": "git+https://github.com/
|
|
13
|
+
"url": "git+https://github.com/mzizi-dev/agent-tools.git",
|
|
14
14
|
"directory": "mzizi-mcp"
|
|
15
15
|
},
|
|
16
16
|
"keywords": [
|
|
17
17
|
"mcp",
|
|
18
18
|
"model-context-protocol",
|
|
19
19
|
"mzizi",
|
|
20
|
-
"bundu",
|
|
21
|
-
"supabase",
|
|
22
20
|
"registry"
|
|
23
21
|
],
|
|
24
22
|
"type": "module",
|
|
@@ -43,38 +41,45 @@
|
|
|
43
41
|
"dependencies": {
|
|
44
42
|
"@cloudflare/workers-oauth-provider": "^0.8.2",
|
|
45
43
|
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
46
|
-
"@supabase/server": "^1.4.1",
|
|
47
|
-
"@supabase/supabase-js": "^2.110.9",
|
|
48
44
|
"@workos-inc/node": "^9.3.1",
|
|
49
45
|
"hono": "^4.12.32",
|
|
50
46
|
"jose": "^6.2.4",
|
|
51
47
|
"zod": "^4.4.3"
|
|
52
48
|
},
|
|
53
49
|
"devDependencies": {
|
|
50
|
+
"@cloudflare/vite-plugin": "^1.54.0",
|
|
54
51
|
"@cloudflare/workers-types": "^4.20260702.1",
|
|
55
52
|
"@modelcontextprotocol/inspector": "^2.0.0",
|
|
56
53
|
"@types/node": "^25.9.5",
|
|
54
|
+
"esbuild": "^0.28.1",
|
|
57
55
|
"typescript": "^6.0.3",
|
|
56
|
+
"vite": "^7.3.6",
|
|
57
|
+
"vite-plus": "^0.3.0",
|
|
58
58
|
"vitest": "^3.2.7",
|
|
59
|
-
"wrangler": "^4.
|
|
59
|
+
"wrangler": "^4.126.0"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
62
|
"node": ">=20"
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
|
-
"build": "tsc -p tsconfig.json",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
65
|
+
"build": "pnpm generate && tsc -p tsconfig.json",
|
|
66
|
+
"build:worker": "pnpm generate && vp build",
|
|
67
|
+
"cf:deploy": "pnpm generate && vp build && wrangler deploy -c dist-worker/mzizi_mcp/wrangler.json",
|
|
68
|
+
"cf:dev": "pnpm generate && vp dev",
|
|
69
|
+
"check": "pnpm generate && vp check --no-fmt",
|
|
70
|
+
"fmt": "vp fmt",
|
|
71
|
+
"generate": "node scripts/generate-skills.mjs && node scripts/generate-registry.mjs",
|
|
72
72
|
"inspect": "mcp-inspector --web node dist/stdio.js",
|
|
73
|
-
"inspect:tui": "mcp-inspector --tui node dist/stdio.js",
|
|
74
73
|
"inspect:cli": "mcp-inspector --cli node dist/stdio.js --method tools/list --format json",
|
|
75
74
|
"inspect:dev": "mcp-inspector --web --server-url http://localhost:8787/mcp --transport http",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
75
|
+
"inspect:tui": "mcp-inspector --tui node dist/stdio.js",
|
|
76
|
+
"integration": "pnpm generate && node scripts/integration.mjs",
|
|
77
|
+
"lint": "vp lint",
|
|
78
|
+
"registry:generate": "node scripts/generate-registry.mjs --force",
|
|
79
|
+
"skills:generate": "node scripts/generate-skills.mjs",
|
|
80
|
+
"test": "pnpm generate && vp test",
|
|
81
|
+
"test:watch": "vp test --watch",
|
|
82
|
+
"typecheck": "pnpm generate && tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json",
|
|
83
|
+
"wrangler": "wrangler"
|
|
79
84
|
}
|
|
80
85
|
}
|
package/dist/api-client.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP client for the Mzizi API — the MCP's only data source.
|
|
3
|
-
*
|
|
4
|
-
* The architecture: the Next.js app at mzizi.dev builds the registry from files at
|
|
5
|
-
* build time and serves it over `/api/v1/*`. This MCP is a client of that API. It does
|
|
6
|
-
* NOT talk to Supabase, and it does not hold a database credential, because component
|
|
7
|
-
* documents and doctrine are files in `nyuchi/mzizi` — not rows.
|
|
8
|
-
*
|
|
9
|
-
* What that buys, beyond matching the architecture:
|
|
10
|
-
*
|
|
11
|
-
* - One source of truth. The API and the MCP answer from the same build, so an agent
|
|
12
|
-
* over MCP and a consumer over HTTP cannot get different answers.
|
|
13
|
-
* - No credential. The previous design read `mcp_tool_registry` and dispatched to
|
|
14
|
-
* Supabase RPCs with an anon key; there is nothing to leak or rotate here.
|
|
15
|
-
* - The tool surface stops being data. It was built at startup from a table, which
|
|
16
|
-
* meant a row edit silently changed what the server exposed with no review. The
|
|
17
|
-
* tools are now code (see `tools.ts`), so a change to them is a diff.
|
|
18
|
-
*
|
|
19
|
-
* Failure policy: every method returns a discriminated result rather than throwing, so
|
|
20
|
-
* a tool can turn an upstream outage into a sentence the caller can act on. An MCP tool
|
|
21
|
-
* that throws an opaque fetch error teaches the agent nothing.
|
|
22
|
-
*/
|
|
23
|
-
export declare const DEFAULT_API_BASE = "https://mzizi.dev/api/v1";
|
|
24
|
-
export type ApiOk<T> = {
|
|
25
|
-
ok: true;
|
|
26
|
-
data: T;
|
|
27
|
-
};
|
|
28
|
-
export type ApiErr = {
|
|
29
|
-
ok: false;
|
|
30
|
-
/** Machine-readable reason, for a tool to branch on. */
|
|
31
|
-
reason: "not_found" | "timeout" | "network" | "bad_status" | "bad_body";
|
|
32
|
-
/** A sentence for the caller. Not a status code. */
|
|
33
|
-
message: string;
|
|
34
|
-
status?: number;
|
|
35
|
-
};
|
|
36
|
-
export type ApiResult<T> = ApiOk<T> | ApiErr;
|
|
37
|
-
export type MziziApiOptions = {
|
|
38
|
-
/** Base URL, no trailing slash. Defaults to the public API. */
|
|
39
|
-
baseUrl?: string;
|
|
40
|
-
timeoutMs?: number;
|
|
41
|
-
/** Injectable for tests and for a Worker's bound fetch. */
|
|
42
|
-
fetchImpl?: typeof fetch;
|
|
43
|
-
};
|
|
44
|
-
export declare class MziziApiClient {
|
|
45
|
-
private readonly baseUrl;
|
|
46
|
-
private readonly timeoutMs;
|
|
47
|
-
private readonly fetchImpl;
|
|
48
|
-
constructor(opts?: MziziApiOptions);
|
|
49
|
-
/**
|
|
50
|
-
* GET a JSON path under the API base.
|
|
51
|
-
*
|
|
52
|
-
* `path` is appended verbatim, so every caller must encode its own segments —
|
|
53
|
-
* a component name arriving from an agent is untrusted input, and an unencoded
|
|
54
|
-
* `../` would climb out of /api/v1.
|
|
55
|
-
*/
|
|
56
|
-
get<T>(path: string, query?: Record<string, string | number | undefined>): Promise<ApiResult<T>>;
|
|
57
|
-
/**
|
|
58
|
-
* Registry index, filtered and paged SERVER-SIDE.
|
|
59
|
-
*
|
|
60
|
-
* The filters used to be applied here, on the response — which could not work, because
|
|
61
|
-
* the index served only `name`, `description` and `dependencies`. Every `node` / `owner`
|
|
62
|
-
* filter matched `undefined !== value` on all 573 items and returned zero, for every
|
|
63
|
-
* value, silently. Filtering upstream also means the 135 KB full index is never
|
|
64
|
-
* transferred just to select nine rows from it.
|
|
65
|
-
*/
|
|
66
|
-
listComponents(query?: {
|
|
67
|
-
node?: number;
|
|
68
|
-
owner?: string;
|
|
69
|
-
collection?: string;
|
|
70
|
-
type?: string;
|
|
71
|
-
limit?: number;
|
|
72
|
-
offset?: number;
|
|
73
|
-
}): Promise<ApiResult<unknown>>;
|
|
74
|
-
/** One component, shadcn-shaped, with metadata and files. */
|
|
75
|
-
getComponent(name: string): Promise<ApiResult<unknown>>;
|
|
76
|
-
/** Per-component docs: use cases, variants, a11y. */
|
|
77
|
-
getComponentDocs(name: string): Promise<ApiResult<unknown>>;
|
|
78
|
-
/** Per-component version history. */
|
|
79
|
-
getComponentVersions(name: string): Promise<ApiResult<unknown>>;
|
|
80
|
-
/** Cross-resource search — components, docs, changelog. */
|
|
81
|
-
search(query: string): Promise<ApiResult<unknown>>;
|
|
82
|
-
/** The DNA double helix: nodes, rungs, strands, live counts. */
|
|
83
|
-
getArchitecture(): Promise<ApiResult<unknown>>;
|
|
84
|
-
/** One node. `n` is uncapped — the node set grows, so never bound it here. */
|
|
85
|
-
getNode(n: number): Promise<ApiResult<unknown>>;
|
|
86
|
-
/** Brand system: minerals, heritage, typography, spacing, ecosystem. */
|
|
87
|
-
getBrand(): Promise<ApiResult<unknown>>;
|
|
88
|
-
getUbuntuPillars(): Promise<ApiResult<unknown>>;
|
|
89
|
-
getUbuntuPrinciples(): Promise<ApiResult<unknown>>;
|
|
90
|
-
listAiInstructions(): Promise<ApiResult<unknown>>;
|
|
91
|
-
getAiInstructions(name: string): Promise<ApiResult<unknown>>;
|
|
92
|
-
listSkills(): Promise<ApiResult<unknown>>;
|
|
93
|
-
getSkill(name: string): Promise<ApiResult<unknown>>;
|
|
94
|
-
listChangelog(): Promise<ApiResult<unknown>>;
|
|
95
|
-
getRelease(version: string): Promise<ApiResult<unknown>>;
|
|
96
|
-
/** Live counts + usage metrics. Derived upstream, never a stored number. */
|
|
97
|
-
getStats(): Promise<ApiResult<unknown>>;
|
|
98
|
-
/** Service health. */
|
|
99
|
-
getHealth(): Promise<ApiResult<unknown>>;
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=api-client.d.ts.map
|
package/dist/api-client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.d.ts","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,gBAAgB,6BAA6B,CAAA;AAK1D,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,CAA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IACrD,gBAAgB,CAAC,IAAI,EAAE,MAAM;IAI7B,qCAAqC;IACrC,oBAAoB,CAAC,IAAI,EAAE,MAAM;IAIjC,2DAA2D;IAC3D,MAAM,CAAC,KAAK,EAAE,MAAM;IAIpB,gEAAgE;IAChE,eAAe;IAIf,8EAA8E;IAC9E,OAAO,CAAC,CAAC,EAAE,MAAM;IAIjB,wEAAwE;IACxE,QAAQ;IAIR,gBAAgB;IAIhB,mBAAmB;IAInB,kBAAkB;IAIlB,iBAAiB,CAAC,IAAI,EAAE,MAAM;IAI9B,UAAU;IAIV,QAAQ,CAAC,IAAI,EAAE,MAAM;IAIrB,aAAa;IAIb,UAAU,CAAC,OAAO,EAAE,MAAM;IAI1B,4EAA4E;IAC5E,QAAQ;IAIR,sBAAsB;IACtB,SAAS;CAGV"}
|
package/dist/api-client.js
DELETED
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* HTTP client for the Mzizi API — the MCP's only data source.
|
|
3
|
-
*
|
|
4
|
-
* The architecture: the Next.js app at mzizi.dev builds the registry from files at
|
|
5
|
-
* build time and serves it over `/api/v1/*`. This MCP is a client of that API. It does
|
|
6
|
-
* NOT talk to Supabase, and it does not hold a database credential, because component
|
|
7
|
-
* documents and doctrine are files in `nyuchi/mzizi` — not rows.
|
|
8
|
-
*
|
|
9
|
-
* What that buys, beyond matching the architecture:
|
|
10
|
-
*
|
|
11
|
-
* - One source of truth. The API and the MCP answer from the same build, so an agent
|
|
12
|
-
* over MCP and a consumer over HTTP cannot get different answers.
|
|
13
|
-
* - No credential. The previous design read `mcp_tool_registry` and dispatched to
|
|
14
|
-
* Supabase RPCs with an anon key; there is nothing to leak or rotate here.
|
|
15
|
-
* - The tool surface stops being data. It was built at startup from a table, which
|
|
16
|
-
* meant a row edit silently changed what the server exposed with no review. The
|
|
17
|
-
* tools are now code (see `tools.ts`), so a change to them is a diff.
|
|
18
|
-
*
|
|
19
|
-
* Failure policy: every method returns a discriminated result rather than throwing, so
|
|
20
|
-
* a tool can turn an upstream outage into a sentence the caller can act on. An MCP tool
|
|
21
|
-
* that throws an opaque fetch error teaches the agent nothing.
|
|
22
|
-
*/
|
|
23
|
-
export const DEFAULT_API_BASE = "https://mzizi.dev/api/v1";
|
|
24
|
-
/** How long any single upstream call may take before it is abandoned. */
|
|
25
|
-
const DEFAULT_TIMEOUT_MS = 10_000;
|
|
26
|
-
export class MziziApiClient {
|
|
27
|
-
baseUrl;
|
|
28
|
-
timeoutMs;
|
|
29
|
-
fetchImpl;
|
|
30
|
-
constructor(opts = {}) {
|
|
31
|
-
this.baseUrl = (opts.baseUrl ?? DEFAULT_API_BASE).replace(/\/+$/, "");
|
|
32
|
-
this.timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
33
|
-
// `.bind(globalThis)` is load-bearing, not defensive style.
|
|
34
|
-
//
|
|
35
|
-
// Storing the global on an instance and calling it as `this.fetchImpl(...)`
|
|
36
|
-
// invokes it as a METHOD, so its receiver is the MziziApiClient rather than
|
|
37
|
-
// the global scope. Workers' `fetch` is a native binding that validates its
|
|
38
|
-
// receiver and throws:
|
|
39
|
-
//
|
|
40
|
-
// Illegal invocation: function called with incorrect `this` reference
|
|
41
|
-
//
|
|
42
|
-
// Node's global fetch tolerates the same call, which is exactly why this
|
|
43
|
-
// shipped: the offline suite passed on Node while every network-backed tool
|
|
44
|
-
// on the deployed Worker was dead. An injected `fetchImpl` is a plain
|
|
45
|
-
// closure and needs no binding, so the tests never touched the broken path.
|
|
46
|
-
this.fetchImpl = opts.fetchImpl ?? fetch.bind(globalThis);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* GET a JSON path under the API base.
|
|
50
|
-
*
|
|
51
|
-
* `path` is appended verbatim, so every caller must encode its own segments —
|
|
52
|
-
* a component name arriving from an agent is untrusted input, and an unencoded
|
|
53
|
-
* `../` would climb out of /api/v1.
|
|
54
|
-
*/
|
|
55
|
-
async get(path, query) {
|
|
56
|
-
let url = `${this.baseUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
|
57
|
-
if (query) {
|
|
58
|
-
const qs = new URLSearchParams();
|
|
59
|
-
for (const [k, v] of Object.entries(query)) {
|
|
60
|
-
if (v !== undefined && v !== "")
|
|
61
|
-
qs.set(k, String(v));
|
|
62
|
-
}
|
|
63
|
-
const s = qs.toString();
|
|
64
|
-
if (s)
|
|
65
|
-
url += `?${s}`;
|
|
66
|
-
}
|
|
67
|
-
const controller = new AbortController();
|
|
68
|
-
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
69
|
-
try {
|
|
70
|
-
const res = await this.fetchImpl(url, {
|
|
71
|
-
signal: controller.signal,
|
|
72
|
-
headers: { accept: "application/json" },
|
|
73
|
-
});
|
|
74
|
-
if (res.status === 404) {
|
|
75
|
-
return {
|
|
76
|
-
ok: false,
|
|
77
|
-
reason: "not_found",
|
|
78
|
-
status: 404,
|
|
79
|
-
message: `The Mzizi API has no record at ${path}. Check the name — list_components returns the valid set.`,
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (!res.ok) {
|
|
83
|
-
// 503 is the API's documented "database not configured" signal. It is worth
|
|
84
|
-
// distinguishing in words, because it means the deployment is misconfigured
|
|
85
|
-
// rather than that the caller asked for something wrong.
|
|
86
|
-
const hint = res.status === 503
|
|
87
|
-
? " The API reports it is not fully configured; this is a deployment problem, not a bad request."
|
|
88
|
-
: "";
|
|
89
|
-
return {
|
|
90
|
-
ok: false,
|
|
91
|
-
reason: "bad_status",
|
|
92
|
-
status: res.status,
|
|
93
|
-
message: `The Mzizi API answered ${res.status} for ${path}.${hint}`,
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
try {
|
|
97
|
-
return { ok: true, data: (await res.json()) };
|
|
98
|
-
}
|
|
99
|
-
catch {
|
|
100
|
-
return {
|
|
101
|
-
ok: false,
|
|
102
|
-
reason: "bad_body",
|
|
103
|
-
status: res.status,
|
|
104
|
-
message: `The Mzizi API returned a non-JSON body for ${path}. The endpoint may be behind a redirect or an auth gate.`,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
catch (err) {
|
|
109
|
-
if (err?.name === "AbortError") {
|
|
110
|
-
return {
|
|
111
|
-
ok: false,
|
|
112
|
-
reason: "timeout",
|
|
113
|
-
message: `The Mzizi API did not respond within ${this.timeoutMs}ms for ${path}.`,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
ok: false,
|
|
118
|
-
reason: "network",
|
|
119
|
-
message: `Could not reach the Mzizi API at ${this.baseUrl}: ${err?.message ?? "unknown error"}.`,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
finally {
|
|
123
|
-
clearTimeout(timer);
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
// ── The endpoints the 10 tools are built from ──────────────────────
|
|
127
|
-
/**
|
|
128
|
-
* Registry index, filtered and paged SERVER-SIDE.
|
|
129
|
-
*
|
|
130
|
-
* The filters used to be applied here, on the response — which could not work, because
|
|
131
|
-
* the index served only `name`, `description` and `dependencies`. Every `node` / `owner`
|
|
132
|
-
* filter matched `undefined !== value` on all 573 items and returned zero, for every
|
|
133
|
-
* value, silently. Filtering upstream also means the 135 KB full index is never
|
|
134
|
-
* transferred just to select nine rows from it.
|
|
135
|
-
*/
|
|
136
|
-
listComponents(query = {}) {
|
|
137
|
-
return this.get("/ui", query);
|
|
138
|
-
}
|
|
139
|
-
/** One component, shadcn-shaped, with metadata and files. */
|
|
140
|
-
getComponent(name) {
|
|
141
|
-
return this.get(`/ui/${encodeURIComponent(name)}`);
|
|
142
|
-
}
|
|
143
|
-
/** Per-component docs: use cases, variants, a11y. */
|
|
144
|
-
getComponentDocs(name) {
|
|
145
|
-
return this.get(`/ui/${encodeURIComponent(name)}/docs`);
|
|
146
|
-
}
|
|
147
|
-
/** Per-component version history. */
|
|
148
|
-
getComponentVersions(name) {
|
|
149
|
-
return this.get(`/ui/${encodeURIComponent(name)}/versions`);
|
|
150
|
-
}
|
|
151
|
-
/** Cross-resource search — components, docs, changelog. */
|
|
152
|
-
search(query) {
|
|
153
|
-
return this.get("/search", { q: query });
|
|
154
|
-
}
|
|
155
|
-
/** The DNA double helix: nodes, rungs, strands, live counts. */
|
|
156
|
-
getArchitecture() {
|
|
157
|
-
return this.get("/architecture");
|
|
158
|
-
}
|
|
159
|
-
/** One node. `n` is uncapped — the node set grows, so never bound it here. */
|
|
160
|
-
getNode(n) {
|
|
161
|
-
return this.get(`/architecture/nodes/${encodeURIComponent(String(n))}`);
|
|
162
|
-
}
|
|
163
|
-
/** Brand system: minerals, heritage, typography, spacing, ecosystem. */
|
|
164
|
-
getBrand() {
|
|
165
|
-
return this.get("/brand");
|
|
166
|
-
}
|
|
167
|
-
getUbuntuPillars() {
|
|
168
|
-
return this.get("/ubuntu/pillars");
|
|
169
|
-
}
|
|
170
|
-
getUbuntuPrinciples() {
|
|
171
|
-
return this.get("/ubuntu/principles");
|
|
172
|
-
}
|
|
173
|
-
listAiInstructions() {
|
|
174
|
-
return this.get("/ai/instructions");
|
|
175
|
-
}
|
|
176
|
-
getAiInstructions(name) {
|
|
177
|
-
return this.get(`/ai/instructions/${encodeURIComponent(name)}`);
|
|
178
|
-
}
|
|
179
|
-
listSkills() {
|
|
180
|
-
return this.get("/skills");
|
|
181
|
-
}
|
|
182
|
-
getSkill(name) {
|
|
183
|
-
return this.get(`/skills/${encodeURIComponent(name)}`);
|
|
184
|
-
}
|
|
185
|
-
listChangelog() {
|
|
186
|
-
return this.get("/changelog");
|
|
187
|
-
}
|
|
188
|
-
getRelease(version) {
|
|
189
|
-
return this.get(`/changelog/${encodeURIComponent(version)}`);
|
|
190
|
-
}
|
|
191
|
-
/** Live counts + usage metrics. Derived upstream, never a stored number. */
|
|
192
|
-
getStats() {
|
|
193
|
-
return this.get("/stats");
|
|
194
|
-
}
|
|
195
|
-
/** Service health. */
|
|
196
|
-
getHealth() {
|
|
197
|
-
return this.get("/health");
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
//# sourceMappingURL=api-client.js.map
|
package/dist/api-client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-client.js","sourceRoot":"","sources":["../src/api-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,0BAA0B,CAAA;AAE1D,yEAAyE;AACzE,MAAM,kBAAkB,GAAG,MAAM,CAAA;AAqBjC,MAAM,OAAO,cAAc;IACR,OAAO,CAAQ;IACf,SAAS,CAAQ;IACjB,SAAS,CAAc;IAExC,YAAY,OAAwB,EAAE;QACpC,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,OAAO,IAAI,gBAAgB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,kBAAkB,CAAA;QACrD,4DAA4D;QAC5D,EAAE;QACF,4EAA4E;QAC5E,4EAA4E;QAC5E,4EAA4E;QAC5E,uBAAuB;QACvB,EAAE;QACF,wEAAwE;QACxE,EAAE;QACF,yEAAyE;QACzE,4EAA4E;QAC5E,sEAAsE;QACtE,4EAA4E;QAC5E,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IAC3D,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,CAAI,IAAY,EAAE,KAAmD;QAC5E,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,EAAE,CAAA;QACtE,IAAI,KAAK,EAAE,CAAC;YACV,MAAM,EAAE,GAAG,IAAI,eAAe,EAAE,CAAA;YAChC,KAAK,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BAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IACjE,CAAC;IAED,aAAa;QACX,OAAO,IAAI,CAAC,GAAG,CAAU,YAAY,CAAC,CAAA;IACxC,CAAC;IAED,UAAU,CAAC,OAAe;QACxB,OAAO,IAAI,CAAC,GAAG,CAAU,cAAc,kBAAkB,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IACvE,CAAC;IAED,4EAA4E;IAC5E,QAAQ;QACN,OAAO,IAAI,CAAC,GAAG,CAAU,QAAQ,CAAC,CAAA;IACpC,CAAC;IAED,sBAAsB;IACtB,SAAS;QACP,OAAO,IAAI,CAAC,GAAG,CAAU,SAAS,CAAC,CAAA;IACrC,CAAC;CACF"}
|
package/dist/defaults.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public connection defaults for the stdio bin.
|
|
3
|
-
*
|
|
4
|
-
* mzizi-mcp is a FREE, PUBLIC tool. The registry it serves
|
|
5
|
-
* (`component_documents` on the Mzizi Supabase project) is public,
|
|
6
|
-
* read-only, RLS-enforced anon access — exactly the audience Supabase's
|
|
7
|
-
* publishable/anon keys are designed for ("safe to ship in client apps").
|
|
8
|
-
*
|
|
9
|
-
* Baking the project URL + publishable key in as DEFAULTS makes
|
|
10
|
-
* `npx mzizi-mcp` work with zero configuration — which is what a headless
|
|
11
|
-
* agent (Claude Code, a CI job, a local MCP client) needs, since the hosted
|
|
12
|
-
* `mcp.mzizi.dev` endpoint sits behind an interactive, browser-only WorkOS
|
|
13
|
-
* signup gate that a headless session cannot complete.
|
|
14
|
-
*
|
|
15
|
-
* These are NOT secrets:
|
|
16
|
-
* - the URL is a public project endpoint;
|
|
17
|
-
* - the publishable key only grants the anon role, which RLS restricts to
|
|
18
|
-
* read-only SELECT on the public registry tables.
|
|
19
|
-
* There is no service-role key here and no write path.
|
|
20
|
-
*
|
|
21
|
-
* Both are overridable via env (`SUPABASE_URL` / `SUPABASE_PUBLISHABLE_KEY`,
|
|
22
|
-
* or their `NEXT_PUBLIC_` equivalents) for anyone pointing the bin at a
|
|
23
|
-
* fork or a self-hosted mirror. If the publishable key is ever rotated,
|
|
24
|
-
* ship a new release (or set the env var) — the env override always wins.
|
|
25
|
-
*/
|
|
26
|
-
export declare const DEFAULT_SUPABASE_URL = "https://grjsboqkaywpwatvrzmy.supabase.co";
|
|
27
|
-
/** Modern publishable key (sb_publishable_…) — anon role, RLS read-only. */
|
|
28
|
-
export declare const DEFAULT_SUPABASE_PUBLISHABLE_KEY = "sb_publishable_90MsojNH3bKYBWIJFb3VpA_O_hbz-wQ";
|
|
29
|
-
//# sourceMappingURL=defaults.d.ts.map
|
package/dist/defaults.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,eAAO,MAAM,oBAAoB,6CAA6C,CAAA;AAE9E,4EAA4E;AAC5E,eAAO,MAAM,gCAAgC,mDAAmD,CAAA"}
|
package/dist/defaults.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Public connection defaults for the stdio bin.
|
|
3
|
-
*
|
|
4
|
-
* mzizi-mcp is a FREE, PUBLIC tool. The registry it serves
|
|
5
|
-
* (`component_documents` on the Mzizi Supabase project) is public,
|
|
6
|
-
* read-only, RLS-enforced anon access — exactly the audience Supabase's
|
|
7
|
-
* publishable/anon keys are designed for ("safe to ship in client apps").
|
|
8
|
-
*
|
|
9
|
-
* Baking the project URL + publishable key in as DEFAULTS makes
|
|
10
|
-
* `npx mzizi-mcp` work with zero configuration — which is what a headless
|
|
11
|
-
* agent (Claude Code, a CI job, a local MCP client) needs, since the hosted
|
|
12
|
-
* `mcp.mzizi.dev` endpoint sits behind an interactive, browser-only WorkOS
|
|
13
|
-
* signup gate that a headless session cannot complete.
|
|
14
|
-
*
|
|
15
|
-
* These are NOT secrets:
|
|
16
|
-
* - the URL is a public project endpoint;
|
|
17
|
-
* - the publishable key only grants the anon role, which RLS restricts to
|
|
18
|
-
* read-only SELECT on the public registry tables.
|
|
19
|
-
* There is no service-role key here and no write path.
|
|
20
|
-
*
|
|
21
|
-
* Both are overridable via env (`SUPABASE_URL` / `SUPABASE_PUBLISHABLE_KEY`,
|
|
22
|
-
* or their `NEXT_PUBLIC_` equivalents) for anyone pointing the bin at a
|
|
23
|
-
* fork or a self-hosted mirror. If the publishable key is ever rotated,
|
|
24
|
-
* ship a new release (or set the env var) — the env override always wins.
|
|
25
|
-
*/
|
|
26
|
-
export const DEFAULT_SUPABASE_URL = "https://grjsboqkaywpwatvrzmy.supabase.co";
|
|
27
|
-
/** Modern publishable key (sb_publishable_…) — anon role, RLS read-only. */
|
|
28
|
-
export const DEFAULT_SUPABASE_PUBLISHABLE_KEY = "sb_publishable_90MsojNH3bKYBWIJFb3VpA_O_hbz-wQ";
|
|
29
|
-
//# sourceMappingURL=defaults.js.map
|
package/dist/defaults.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,0CAA0C,CAAA;AAE9E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,gCAAgC,GAAG,gDAAgD,CAAA"}
|