@nyuchi/mzizi-mcp 0.9.1 → 0.10.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.
Files changed (97) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +117 -86
  3. package/dist/access.d.ts +69 -0
  4. package/dist/access.d.ts.map +1 -0
  5. package/dist/access.js +72 -0
  6. package/dist/access.js.map +1 -0
  7. package/dist/auth/authkit-handler.d.ts +4 -3
  8. package/dist/auth/authkit-handler.d.ts.map +1 -1
  9. package/dist/auth/authkit-handler.js +52 -6
  10. package/dist/auth/authkit-handler.js.map +1 -1
  11. package/dist/auth/front.d.ts +17 -0
  12. package/dist/auth/front.d.ts.map +1 -0
  13. package/dist/auth/front.js +25 -0
  14. package/dist/auth/front.js.map +1 -0
  15. package/dist/auth/mcp-api-handler.d.ts +20 -7
  16. package/dist/auth/mcp-api-handler.d.ts.map +1 -1
  17. package/dist/auth/mcp-api-handler.js +43 -29
  18. package/dist/auth/mcp-api-handler.js.map +1 -1
  19. package/dist/desk-context.d.ts +33 -0
  20. package/dist/desk-context.d.ts.map +1 -0
  21. package/dist/desk-context.js +49 -0
  22. package/dist/desk-context.js.map +1 -0
  23. package/dist/docs-federation.d.ts +68 -0
  24. package/dist/docs-federation.d.ts.map +1 -0
  25. package/dist/docs-federation.js +282 -0
  26. package/dist/docs-federation.js.map +1 -0
  27. package/dist/env.d.ts +7 -8
  28. package/dist/env.d.ts.map +1 -1
  29. package/dist/env.js +5 -5
  30. package/dist/fundi-a2a.d.ts +1 -1
  31. package/dist/fundi-a2a.js +2 -2
  32. package/dist/fundi-a2a.js.map +1 -1
  33. package/dist/fundi-client.d.ts +24 -4
  34. package/dist/fundi-client.d.ts.map +1 -1
  35. package/dist/fundi-client.js +91 -4
  36. package/dist/fundi-client.js.map +1 -1
  37. package/dist/generated/registry-pin.d.ts +5 -0
  38. package/dist/generated/registry-pin.d.ts.map +1 -0
  39. package/dist/generated/registry-pin.js +3 -0
  40. package/dist/generated/registry-pin.js.map +1 -0
  41. package/dist/generated/registry.d.ts +23 -0
  42. package/dist/generated/registry.d.ts.map +1 -0
  43. package/dist/generated/registry.js +1204 -0
  44. package/dist/generated/registry.js.map +1 -0
  45. package/dist/generated/skills.d.ts +18 -0
  46. package/dist/generated/skills.d.ts.map +1 -0
  47. package/dist/generated/skills.js +67 -0
  48. package/dist/generated/skills.js.map +1 -0
  49. package/dist/http.d.ts +18 -9
  50. package/dist/http.d.ts.map +1 -1
  51. package/dist/http.js +16 -13
  52. package/dist/http.js.map +1 -1
  53. package/dist/issue-desk.d.ts +152 -0
  54. package/dist/issue-desk.d.ts.map +1 -0
  55. package/dist/issue-desk.js +392 -0
  56. package/dist/issue-desk.js.map +1 -0
  57. package/dist/issue-log.d.ts +80 -0
  58. package/dist/issue-log.d.ts.map +1 -0
  59. package/dist/issue-log.js +146 -0
  60. package/dist/issue-log.js.map +1 -0
  61. package/dist/issue-report.d.ts +138 -0
  62. package/dist/issue-report.d.ts.map +1 -0
  63. package/dist/issue-report.js +112 -0
  64. package/dist/issue-report.js.map +1 -0
  65. package/dist/rate-limit.d.ts +41 -0
  66. package/dist/rate-limit.d.ts.map +1 -0
  67. package/dist/rate-limit.js +58 -0
  68. package/dist/rate-limit.js.map +1 -0
  69. package/dist/registry.d.ts +126 -0
  70. package/dist/registry.d.ts.map +1 -0
  71. package/dist/registry.js +280 -0
  72. package/dist/registry.js.map +1 -0
  73. package/dist/server.d.ts +96 -22
  74. package/dist/server.d.ts.map +1 -1
  75. package/dist/server.js +76 -32
  76. package/dist/server.js.map +1 -1
  77. package/dist/stdio.d.ts +6 -13
  78. package/dist/stdio.d.ts.map +1 -1
  79. package/dist/stdio.js +6 -29
  80. package/dist/stdio.js.map +1 -1
  81. package/dist/tools.d.ts +45 -6
  82. package/dist/tools.d.ts.map +1 -1
  83. package/dist/tools.js +299 -82
  84. package/dist/tools.js.map +1 -1
  85. package/dist/worker.d.ts +26 -14
  86. package/dist/worker.d.ts.map +1 -1
  87. package/dist/worker.js +42 -14
  88. package/dist/worker.js.map +1 -1
  89. package/package.json +25 -20
  90. package/dist/api-client.d.ts +0 -101
  91. package/dist/api-client.d.ts.map +0 -1
  92. package/dist/api-client.js +0 -200
  93. package/dist/api-client.js.map +0 -1
  94. package/dist/defaults.d.ts +0 -29
  95. package/dist/defaults.d.ts.map +0 -1
  96. package/dist/defaults.js +0 -29
  97. package/dist/defaults.js.map +0 -1
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -1,15 +1,19 @@
1
1
  # @nyuchi/mzizi-mcp
2
2
 
3
- Registry-driven Model Context Protocol server for the mzizi design system — the
4
- drop-in replacement for the legacy `design.nyuchi.com` MCP.
3
+ > Model Context Protocol server for the Mzizi design system — the registry and skills served from files bundled at build time, the docs joined in from docs.mzizi.dev, and no database behind any of it.
5
4
 
6
- The tool catalog is loaded at startup from the Supabase `mcp_tool_registry` table
7
- (RLS public-read, anon role) and dispatched dynamically. Adding, renaming, or
8
- retiring a tool is a registry edit, not a code change. The server is read-only on
9
- the anonymous surface — write-kind tools are excluded.
5
+ [![npm](https://img.shields.io/npm/v/%40nyuchi%2Fmzizi-mcp?style=flat-square&logo=npm)](https://www.npmjs.com/package/@nyuchi/mzizi-mcp)
6
+ [![License: Apache 2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=flat-square)](https://www.apache.org/licenses/LICENSE-2.0)
7
+
8
+ **Live:** `https://mcp.mzizi.dev/mcp` | **Home:** [mzizi.dev](https://mzizi.dev) | **Docs:** [docs.mzizi.dev](https://docs.mzizi.dev)
9
+
10
+ Mzizi is an open-architecture project governed by **Mzizi**, operated and
11
+ developed by **Nyuchi**.
12
+
13
+ ---
10
14
 
11
15
  **Live at** `https://mcp.mzizi.dev/mcp` (Cloudflare Worker `mzizi-mcp`, version
12
- 0.7.0 — `MZIZI_MCP_VERSION` in `src/server.ts` is what `serverInfo.version`
16
+ 0.9.1 — `MZIZI_MCP_VERSION` in `src/server.ts` is what `serverInfo.version`
13
17
  reports, and it moves in lockstep with `package.json` and `server.json`). A
14
18
  **free WorkOS signup gate** fronts the endpoint — a WorkOS
15
19
  **Connect OAuth application** (public client, PKCE; no client secret) — so sign up
@@ -17,7 +21,8 @@ once and read the whole registry at no cost. The worker advertises
17
21
  `/.well-known/oauth-protected-resource` so MCP clients can run the OAuth discovery
18
22
  dance automatically.
19
23
 
20
- **MCP Registry name:** `io.github.nyuchi/mzizi-mcp`
24
+ **MCP Registry name:** `io.github.mzizi-dev/mzizi-mcp` (from 0.10.1; the older
25
+ `io.github.nyuchi/mzizi-mcp` entry is stale and no longer updated)
21
26
 
22
27
  ---
23
28
 
@@ -42,8 +47,9 @@ connect. After that, reads are free and unlimited.
42
47
  ### stdio (local / offline)
43
48
 
44
49
  Run the stdio bin via npx — useful for Claude Code, Cursor, or any assistant that
45
- speaks stdio MCP. **It is zero-config** — the public mzizi registry URL + its
46
- publishable (anon, RLS read-only) key are baked in, so no `env` is needed:
50
+ speaks stdio MCP. **It is zero-config and credential-free**: the registry data and
51
+ skills ship inside the package, so every `mzizi_*` read works offline. The `docs_*`
52
+ tools forward to the public docs MCP and need network.
47
53
 
48
54
  ```json
49
55
  {
@@ -59,78 +65,86 @@ publishable (anon, RLS read-only) key are baked in, so no `env` is needed:
59
65
 
60
66
  This is the **sanctioned headless path**: the hosted `mcp.mzizi.dev` endpoint
61
67
  sits behind an interactive, browser-only WorkOS signup gate that a headless agent
62
- (Claude Code, CI, an offline client) can't complete, whereas the stdio bin reads
63
- the same public registry directly with no login.
64
-
65
- To point the bin at a fork or a self-hosted mirror, override the defaults with
66
- `SUPABASE_URL` and `SUPABASE_PUBLISHABLE_KEY` (their `NEXT_PUBLIC_` equivalents
67
- are also accepted). Neither value is a secret — the publishable key only grants
68
- the anon role, which RLS restricts to read-only reads of the public registry.
68
+ (Claude Code, CI, an offline client) can't complete. `mzizi_report_issue` needs a
69
+ signed-in user and says so on the stdio bin.
69
70
 
70
71
  ---
71
72
 
72
- ## Registry-driven dispatch
73
+ ## Where the data comes from
73
74
 
74
- | Registry `kind` | Dispatch |
75
- | --------------- | ----------------------------------------- |
76
- | `sql_function` | `supabase.rpc(fn, args)` |
77
- | `edge_function` | `supabase.functions.invoke(fn, { body })` |
78
- | `source_table` | `supabase.from(table).select()` |
75
+ Nothing is read from a database, and no registry data is fetched at request time.
79
76
 
80
- The registry currently holds 62 rows (60 enabled). After filtering out write-kind
81
- and first-party tools, ~55 tools are exposed on the anonymous public surface,
82
- spread across 17 categories.
77
+ | Data | Source | How it gets into the Worker |
78
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
79
+ | Components, index, component docs, brand tokens, architecture helix + nodes, Ubuntu pillars/principles, conventions, AI instruction sets, changelog, rename map | [mzizi-dev/mzizi-registry](https://github.com/mzizi-dev/mzizi-registry) at the commit pinned in [`registry.pin.json`](./registry.pin.json) | `scripts/generate-registry.mjs` fetches that exact commit and calls the registry's **own API route handlers** once per resource, writing `src/generated/registry.ts` |
80
+ | Agent skills | `../mzizi-skills/skills/*/SKILL.md` in this repo | `scripts/generate-skills.mjs` → `src/generated/skills.ts` |
81
+ | Documentation | the Mintlify MCP at `https://docs.mzizi.dev/mcp` | federated live — see below |
83
82
 
84
- ---
83
+ Both generated files are build output: gitignored, never committed, rebuilt by
84
+ `pnpm generate` (which `build`, `build:worker`, `cf:dev`, `cf:deploy`, `test`,
85
+ `typecheck` and `check` all run first), by the Vite config, and by
86
+ `wrangler.toml`'s `[build] command`. They are no-ops when current.
85
87
 
86
- ## Core tools (always present, defined in code)
88
+ Because the generator runs the registry's route handlers rather than
89
+ re-deriving their output, a tool here answers with the same payload
90
+ `api.mzizi.dev/v1` would give at the pinned commit. The registry checkout has no
91
+ `node_modules`: every npm package a route imports is replaced with a module that
92
+ throws on use, so a route that still reads a database **fails the build** rather
93
+ than shipping an empty answer.
87
94
 
88
- | Tool | Backed by | Returns |
89
- | --------------------- | -------------------------------------- | -------------------------------------------------------------- |
90
- | `list_collections` | `component_documents` aggregate | Every collection + document counts + per-owner breakdown |
91
- | `get_database_status` | `component_documents` count | Provider health + document-store row count + tool count |
92
- | `fundi_status` | fundi `/admin/whoami` (M2M delegation) | fundi identity + granted scopes (only when `FUNDI_URL` is set) |
95
+ **Moving to newer registry content** is a one-line PR: set `ref` in
96
+ `registry.pin.json` to a newer full commit SHA of mzizi-registry. CI regenerates
97
+ and runs the bundle tests against it.
93
98
 
94
- `fundi_status` is only registered on the server when `FUNDI_URL` is configured. It proxies to
95
- the fundi worker using a WorkOS M2M token minted from `WORKOS_M2M_CLIENT_ID` /
96
- `WORKOS_M2M_CLIENT_SECRET`, plus the authenticated user's token in `X-Fundi-User-Token`.
97
- This makes mzizi-mcp the **sanctioned fundi caller** — the CLI reaches fundi through
98
- mzizi-mcp, never by holding the M2M secret itself.
99
+ Former `nyuchi-*` component names (renamed to `mzizi-*` on 2026-09-27) resolve
100
+ through the registry's `lib/component-renames.json`, bundled with the rest.
99
101
 
100
- ---
102
+ ### Docs — joined in from docs.mzizi.dev
101
103
 
102
- ## Tool categories (registry-driven)
103
-
104
- | Category | Example tools |
105
- | --------------- | --------------------------------------------------------------------------------- |
106
- | `component` | `get_component`, `list_components`, `search_components`, `get_component_links` |
107
- | `architecture` | `get_node_documents` |
108
- | `brand` | `get_brand_tokens`, `list_ecosystem_brands` |
109
- | `skills` | `get_skill`, `list_skills` |
110
- | `doctrine` | doctrine-read tools |
111
- | `documents` | `read_documents`, `read_versions` |
112
- | `release` | `list_changelog`, `get_changelog_entry`, `compute_release_diff` |
113
- | `resolver` | `resolve_primitive`, `list_framework_descriptors` |
114
- | `a11y` | `calculate_contrast_ratio`, `simulate_color_blindness`, `run_accessibility_audit` |
115
- | `observability` | `list_observability_events`, `is_domain_allowed` |
116
- | `fundi` | `get_healing_log`, `list_recent_fundi_issues` |
117
- | `chaos` | `list_chaos_events` |
118
- | `system` | system-read tools |
119
- | `ai` | `get_ai_instructions`, `list_ai_instructions` |
120
- | `governance` | `get_bundu_convention` |
121
- | `meta` | `mcp_describe` |
122
-
123
- Call `mcp_describe` (with optional `p_category` filter) to enumerate the full live
124
- catalog.
104
+ The documentation site runs its own MCP server (Mintlify; streamable HTTP, public,
105
+ stateless). This server lists its tools under a `docs_` prefix and forwards each
106
+ call, passing the result through untouched:
125
107
 
126
- ---
108
+ - the upstream tool list is cached for 5 minutes;
109
+ - if a refresh fails the last good list is reused, and with nothing cached a
110
+ built-in snapshot of the upstream definitions keeps the surface stable;
111
+ - a failed call is a tool error naming the docs server and the reason.
127
112
 
128
- ## Resources
113
+ ---
129
114
 
130
- | URI | Content |
131
- | --------------------- | ---------------------------------------------------- |
132
- | `mzizi://collections` | Every collection + document counts + owner breakdown |
133
- | `mzizi://components` | Lean index of the `components` collection |
115
+ ## Tools
116
+
117
+ | Tool | Returns |
118
+ | ---------------------------------- | -------------------------------------------------------------------------- |
119
+ | `mzizi_search` | Word search over components, conventions, AI instruction sets and releases |
120
+ | `mzizi_get_component` | One component in full, source inline; `include: ["docs", "versions"]` |
121
+ | `mzizi_list_components` | The lean, paged index; filter by `node`, `owner`, `collection`, `type` |
122
+ | `mzizi_get_tokens` | Brand system; `family: "colors"` for all 21 colour families |
123
+ | `mzizi_get_architecture` | The DNA helix, or one node/rung with `node` (uncapped) |
124
+ | `mzizi_get_doctrine` | `ubuntu-pillars`, `ubuntu-principles`, `ai-instructions`, `conventions` |
125
+ | `mzizi_get_skills` | The agent skills, listed or one in full |
126
+ | `mzizi_check_accessibility` | Contrast ratio against the Mzizi AAA floor, computed locally |
127
+ | `mzizi_report_issue` | Your issue desk (signed-in users on the Worker) |
128
+ | `mzizi_fundi` | Delegate to fundi (only when the Worker is wired to fundi) |
129
+ | `mzizi_mcp_describe` | This server's tools, what each replaces, and its data sources |
130
+ | `docs_search_mzizi` | Search the documentation (forwarded) |
131
+ | `docs_query_docs_filesystem_mzizi` | Read-only `rg`/`cat`/`tree` over the doc pages (forwarded) |
132
+ | `docs_submit_feedback` | Report a documentation problem (forwarded) |
133
+
134
+ The `docs_*` names mirror whatever docs.mzizi.dev lists; the three above are what
135
+ it lists today. `GET /catalogue.json` and the `mzizi://tools` resource are computed
136
+ from the same registration path.
137
+
138
+ **Shape notes (changed when the registry moved into the build).**
139
+
140
+ - `mzizi_get_component` with `include: ["versions"]` is derived from the committed
141
+ changelog and rename map: rows are `{version, title, change, breaking,
142
+ released_at}` with `meta.previousNames`. The database view it used to read is gone
143
+ from this path.
144
+ - `mzizi_search` returns `{data: [{kind, name, title?, description?}], meta}`, with
145
+ `kind` one of `component | convention | ai-instruction | release`. Documentation
146
+ pages are searched by `docs_search_mzizi`.
147
+ - `mzizi_get_doctrine` gained the `conventions` topic (list, or one by `name`).
134
148
 
135
149
  ---
136
150
 
@@ -140,13 +154,17 @@ catalog.
140
154
 
141
155
  Secrets (`wrangler secret put`):
142
156
 
143
- | Secret | Required | Notes |
144
- | -------------------------- | -------- | -------------------------------------------------------------- |
145
- | `SUPABASE_URL` | yes | Public Supabase project URL |
146
- | `SUPABASE_PUBLISHABLE_KEY` | yes | Anon (RLS public-read) key |
147
- | `SUPABASE_SECRET_KEY` | no | Service-role key; placeholder is used if unset |
148
- | `COOKIE_ENCRYPTION_KEY` | yes | HMAC key for the consent cookie (random bytes) |
149
- | `WORKOS_AUTHKIT_DOMAIN` | no | AuthKit domain for `/oauth2/*` (`https://accounts.mukoko.com`) |
157
+ | Secret | Required | Notes |
158
+ | ----------------------- | -------- | -------------------------------------------------------------- |
159
+ | `COOKIE_ENCRYPTION_KEY` | yes | HMAC key for the consent cookie (random bytes) |
160
+ | `WORKOS_AUTHKIT_DOMAIN` | no | AuthKit domain for `/oauth2/*` (`https://accounts.mukoko.com`) |
161
+
162
+ **There is deliberately no `GITHUB_TOKEN` here.** The issue desk used to file GitHub issues
163
+ itself with a PAT that was never set on this Worker, so every report parked at `drafted` and no
164
+ maintainer ever saw one. `mzizi_report_issue` now reproduces, drafts, and **logs** the issue to
165
+ fundi over the `FUNDI_SERVICE` binding; fundi holds the PAT, files the GitHub issue with its
166
+ healing plan in it, and writes that issue's lifecycle back to D1 — which is what lets the desk
167
+ (and the console) say whether yours was picked up or closed.
150
168
 
151
169
  `WORKOS_AUTHKIT_DOMAIN` is a **secret and not a `[vars]` entry**, even though a hostname is not
152
170
  confidential: a var wins on every deploy and silently discards a same-named remote value, so a
@@ -172,12 +190,13 @@ Plain vars (`[vars]` in `wrangler.toml`, not secrets):
172
190
  | -------------------------- | ------ | --------------------------------------------------- |
173
191
  | `WORKOS_M2M_CLIENT_SECRET` | secret | Fundi M2M app secret (Worker secret; never in code) |
174
192
 
175
- ### stdio / local dev (`.dev.vars` or environment)
193
+ ### stdio / local dev
194
+
195
+ The stdio bin takes no environment and holds no credential. (`MZIZI_API_BASE` is
196
+ gone: there is no registry API to point at. Build with a different pin instead.)
176
197
 
177
- | Variable | Required | Notes |
178
- | -------------------------- | -------- | ----------------------------------- |
179
- | `SUPABASE_URL` | no | Defaults to canonical mzizi project |
180
- | `SUPABASE_PUBLISHABLE_KEY` | yes | Anon key |
198
+ At build time only, `MZIZI_REGISTRY_DIR` points the generator at an existing
199
+ mzizi-registry checkout instead of fetching one; its `HEAD` must equal the pin.
181
200
 
182
201
  ---
183
202
 
@@ -191,7 +210,7 @@ Plain vars (`[vars]` in `wrangler.toml`, not secrets):
191
210
 
192
211
  Source files:
193
212
 
194
- - `src/server.ts` — `createMziziMcpServer(supabase)` factory
213
+ - `src/server.ts` — `createMziziMcpServer()` factory
195
214
  - `src/http.ts` — `createMziziHttpHandler()` for any fetch runtime
196
215
  - `src/worker.ts` — Cloudflare Worker bound to `env` (the gated deployment)
197
216
  - `src/stdio.ts` — `bin: mzizi-mcp` for the MCP registry / local Claude Code
@@ -201,6 +220,9 @@ Source files:
201
220
  ## Build and deploy
202
221
 
203
222
  ```bash
223
+ # generate src/generated/* (registry bundle at the pin + skills); every script below runs it first
224
+ pnpm --filter @nyuchi/mzizi-mcp generate
225
+
204
226
  # typecheck
205
227
  pnpm --filter @nyuchi/mzizi-mcp typecheck
206
228
 
@@ -210,16 +232,25 @@ pnpm --filter @nyuchi/mzizi-mcp build
210
232
  # local Worker dev
211
233
  pnpm --filter @nyuchi/mzizi-mcp cf:dev
212
234
 
213
- # deploy manually (CI handles pushes to main)
235
+ # deploy manually (Workers Builds handles pushes to main)
214
236
  pnpm --filter @nyuchi/mzizi-mcp cf:deploy
215
237
  ```
216
238
 
217
- CI deploys automatically on push to `main` touching `mzizi-mcp/**` via
218
- `.github/workflows/deploy-mzizi-mcp.yml`.
239
+ **Cloudflare Workers Builds** deploys this Worker on every push to `main` — it is connected
240
+ to the repo and surfaces as the `Workers Builds: mzizi-mcp` check. There is no deploy workflow
241
+ in `.github/workflows/`; the one that used to live there was redundant and is gone (#98).
242
+
243
+ A build fetches the pinned mzizi-registry commit (public, anonymous `git fetch` of one
244
+ commit), so the build environment needs outbound access to github.com. A failed fetch
245
+ fails the build, and a failed build deploys nothing — the running version stays up.
246
+
247
+ **Rollback:** Cloudflare dashboard → Workers & Pages → `mzizi-mcp` → Deployments → pick
248
+ the previous version → _Rollback_, or `wrangler rollback` from `mzizi-mcp/`. Reverting
249
+ the merge commit on `main` redeploys the previous source through Workers Builds.
219
250
 
220
251
  ---
221
252
 
222
253
  ## License
223
254
 
224
- Apache-2.0. Part of the mzizi tooling — an open-architecture project of the
225
- [Bundu Foundation](https://mzizi.dev), operated by [nyuchi](https://nyuchi.com).
255
+ Apache-2.0. Part of the mzizi tooling — an open-architecture project of
256
+ [Mzizi](https://mzizi.dev), operated by [nyuchi](https://nyuchi.com).
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Who may call what: the free tier and the Fundi gate, in one place.
3
+ *
4
+ * Owner decision, 2026-09-29: the MCP server is free with no gate, except
5
+ * Fundi. An anonymous session can `initialize`, list the tools and call every
6
+ * one of them except the tools below, which act as a console user and so need
7
+ * the WorkOS sign-in:
8
+ *
9
+ * mzizi_fundi delegates a run to Fundi, forwarding the user's token
10
+ * mzizi_report_issue files into the Fundi issue desk, keyed by the user
11
+ *
12
+ * The gated tools are still LISTED to an anonymous caller. A tool that only
13
+ * appears after sign-in cannot tell an agent that signing in would help; a
14
+ * listed tool that refuses with "sign in, here is how" can.
15
+ *
16
+ * Kept free of Worker imports: the stdio bin, the catalogue and the tests all
17
+ * read it.
18
+ */
19
+ /** Where the free tier is served. No token needed. */
20
+ export declare const MCP_URL = "https://mcp.mzizi.dev/mcp";
21
+ /**
22
+ * The same MCP, behind the sign-in up front.
23
+ *
24
+ * `/mcp` answers anonymous requests, so a client connected there is never sent
25
+ * the 401 that makes most MCP clients start their OAuth flow. This path keeps
26
+ * the old behaviour: without a token it answers 401 with a `WWW-Authenticate`
27
+ * pointing at `/.well-known/oauth-protected-resource/mcp/signin`, the client
28
+ * signs in through WorkOS, and every later request carries the token. It is
29
+ * the same handler; only the front differs (see `worker.ts`).
30
+ */
31
+ export declare const SIGN_IN_MCP_URL = "https://mcp.mzizi.dev/mcp/signin";
32
+ /** Bare tool names (without `mzizi_`) that need a signed-in user. */
33
+ export declare const SIGN_IN_TOOLS: readonly string[];
34
+ export type ToolAccess = "free" | "sign-in";
35
+ /** Access for a registered tool name, bare (`fundi`) or federated (`docs_…`). */
36
+ export declare function accessFor(name: string): ToolAccess;
37
+ /**
38
+ * Anonymous requests per client IP per window, on the Worker.
39
+ *
40
+ * Mirrors `[[ratelimits]]` in wrangler.toml, which is what actually enforces
41
+ * it; this copy is what the catalogue and the 429 body report. Keep the two
42
+ * equal (test/free-tier.test.ts reads wrangler.toml to check).
43
+ */
44
+ export declare const ANONYMOUS_RATE_LIMIT: {
45
+ readonly limit: 120;
46
+ readonly periodSeconds: 60;
47
+ };
48
+ /** How to get the token, in words an agent can relay to a person. */
49
+ export declare const SIGN_IN_HOW: string;
50
+ /** The in-band refusal a gated tool returns to an anonymous caller. */
51
+ export declare function signInRequired(bareName: string): {
52
+ isError: boolean;
53
+ content: {
54
+ type: "text";
55
+ text: string;
56
+ }[];
57
+ };
58
+ /** The access model as the catalogue and `mzizi_mcp_describe` state it. */
59
+ export declare function accessSummary(registered: string[]): {
60
+ model: string;
61
+ signIn: {
62
+ tools: string[];
63
+ how: string;
64
+ url: string;
65
+ oauthProtectedResource: string;
66
+ };
67
+ rateLimit: string;
68
+ };
69
+ //# sourceMappingURL=access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH,sDAAsD;AACtD,eAAO,MAAM,OAAO,8BAA8B,CAAC;AAEnD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,qCAAqC,CAAC;AAElE,qEAAqE;AACrE,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAA8B,CAAC;AAE1E,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,iFAAiF;AACjF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAElD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;CAA6C,CAAC;AAE/E,qEAAqE;AACrE,eAAO,MAAM,WAAW,QAEkI,CAAC;AAE3J,uEAAuE;AACvE,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM;;;;;;EAQ9C;AAED,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE;;;;;;;;;EAejD"}
package/dist/access.js ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Who may call what: the free tier and the Fundi gate, in one place.
3
+ *
4
+ * Owner decision, 2026-09-29: the MCP server is free with no gate, except
5
+ * Fundi. An anonymous session can `initialize`, list the tools and call every
6
+ * one of them except the tools below, which act as a console user and so need
7
+ * the WorkOS sign-in:
8
+ *
9
+ * mzizi_fundi delegates a run to Fundi, forwarding the user's token
10
+ * mzizi_report_issue files into the Fundi issue desk, keyed by the user
11
+ *
12
+ * The gated tools are still LISTED to an anonymous caller. A tool that only
13
+ * appears after sign-in cannot tell an agent that signing in would help; a
14
+ * listed tool that refuses with "sign in, here is how" can.
15
+ *
16
+ * Kept free of Worker imports: the stdio bin, the catalogue and the tests all
17
+ * read it.
18
+ */
19
+ import { toolError } from "./tool-result.js";
20
+ /** Where the free tier is served. No token needed. */
21
+ export const MCP_URL = "https://mcp.mzizi.dev/mcp";
22
+ /**
23
+ * The same MCP, behind the sign-in up front.
24
+ *
25
+ * `/mcp` answers anonymous requests, so a client connected there is never sent
26
+ * the 401 that makes most MCP clients start their OAuth flow. This path keeps
27
+ * the old behaviour: without a token it answers 401 with a `WWW-Authenticate`
28
+ * pointing at `/.well-known/oauth-protected-resource/mcp/signin`, the client
29
+ * signs in through WorkOS, and every later request carries the token. It is
30
+ * the same handler; only the front differs (see `worker.ts`).
31
+ */
32
+ export const SIGN_IN_MCP_URL = "https://mcp.mzizi.dev/mcp/signin";
33
+ /** Bare tool names (without `mzizi_`) that need a signed-in user. */
34
+ export const SIGN_IN_TOOLS = ["fundi", "report_issue"];
35
+ /** Access for a registered tool name, bare (`fundi`) or federated (`docs_…`). */
36
+ export function accessFor(name) {
37
+ return SIGN_IN_TOOLS.includes(name) ? "sign-in" : "free";
38
+ }
39
+ /**
40
+ * Anonymous requests per client IP per window, on the Worker.
41
+ *
42
+ * Mirrors `[[ratelimits]]` in wrangler.toml, which is what actually enforces
43
+ * it; this copy is what the catalogue and the 429 body report. Keep the two
44
+ * equal (test/free-tier.test.ts reads wrangler.toml to check).
45
+ */
46
+ export const ANONYMOUS_RATE_LIMIT = { limit: 120, periodSeconds: 60 };
47
+ /** How to get the token, in words an agent can relay to a person. */
48
+ export const SIGN_IN_HOW = `Sign in with a free Mzizi account (WorkOS). If your MCP client offers to sign in or authenticate this server, do that. ` +
49
+ `Otherwise connect to ${SIGN_IN_MCP_URL} instead of ${MCP_URL}: it asks you to sign in or create an account, then serves every tool, this one included.`;
50
+ /** The in-band refusal a gated tool returns to an anonymous caller. */
51
+ export function signInRequired(bareName) {
52
+ const why = bareName === "fundi"
53
+ ? "Fundi runs as your Mzizi console user"
54
+ : "It files into the Fundi issue desk under your Mzizi console user";
55
+ return toolError(`Sign-in required: mzizi_${bareName} needs a signed-in user. ${why}, so it is the one part of this server that needs an account; every other tool works without one. ${SIGN_IN_HOW}`);
56
+ }
57
+ /** The access model as the catalogue and `mzizi_mcp_describe` state it. */
58
+ export function accessSummary(registered) {
59
+ return {
60
+ model: "Free: every tool works without an account, except the ones marked sign-in. Those are Fundi's: they act as your Mzizi console user.",
61
+ signIn: {
62
+ tools: registered
63
+ .filter((n) => accessFor(n) === "sign-in")
64
+ .map((n) => `mzizi_${n}`),
65
+ how: SIGN_IN_HOW,
66
+ url: SIGN_IN_MCP_URL,
67
+ oauthProtectedResource: "https://mcp.mzizi.dev/.well-known/oauth-protected-resource",
68
+ },
69
+ rateLimit: `Anonymous requests to ${MCP_URL} are limited to ${ANONYMOUS_RATE_LIMIT.limit} per ${ANONYMOUS_RATE_LIMIT.periodSeconds} seconds per IP address. Signed-in requests are not.`,
70
+ };
71
+ }
72
+ //# sourceMappingURL=access.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.js","sourceRoot":"","sources":["../src/access.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,sDAAsD;AACtD,MAAM,CAAC,MAAM,OAAO,GAAG,2BAA2B,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,kCAAkC,CAAC;AAElE,qEAAqE;AACrE,MAAM,CAAC,MAAM,aAAa,GAAsB,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;AAI1E,iFAAiF;AACjF,MAAM,UAAU,SAAS,CAAC,IAAY;IACpC,OAAO,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;AAC3D,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,aAAa,EAAE,EAAE,EAAW,CAAC;AAE/E,qEAAqE;AACrE,MAAM,CAAC,MAAM,WAAW,GACtB,yHAAyH;IACzH,wBAAwB,eAAe,eAAe,OAAO,2FAA2F,CAAC;AAE3J,uEAAuE;AACvE,MAAM,UAAU,cAAc,CAAC,QAAgB;IAC7C,MAAM,GAAG,GACP,QAAQ,KAAK,OAAO;QAClB,CAAC,CAAC,uCAAuC;QACzC,CAAC,CAAC,kEAAkE,CAAC;IACzE,OAAO,SAAS,CACd,2BAA2B,QAAQ,4BAA4B,GAAG,qGAAqG,WAAW,EAAE,CACrL,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,aAAa,CAAC,UAAoB;IAChD,OAAO;QACL,KAAK,EACH,oIAAoI;QACtI,MAAM,EAAE;YACN,KAAK,EAAE,UAAU;iBACd,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;iBACzC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC;YAC3B,GAAG,EAAE,WAAW;YAChB,GAAG,EAAE,eAAe;YACpB,sBAAsB,EACpB,4DAA4D;SAC/D;QACD,SAAS,EAAE,yBAAyB,OAAO,mBAAmB,oBAAoB,CAAC,KAAK,QAAQ,oBAAoB,CAAC,aAAa,sDAAsD;KACzL,CAAC;AACJ,CAAC"}