@cascivo/mcp 0.2.0 → 0.3.4

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 (205) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +53 -23
  3. package/dist/context/accordion.md +93 -0
  4. package/dist/context/action-sheet.md +117 -0
  5. package/dist/context/alert-dialog.md +122 -0
  6. package/dist/context/alert.md +110 -0
  7. package/dist/context/app-shell.md +98 -0
  8. package/dist/context/aspect-ratio.md +92 -0
  9. package/dist/context/avatar-group.md +111 -0
  10. package/dist/context/avatar.md +100 -0
  11. package/dist/context/badge.md +119 -0
  12. package/dist/context/block/console-app.md +66 -0
  13. package/dist/context/block/dashboard-charts.md +61 -0
  14. package/dist/context/block/empty-dashboard.md +60 -0
  15. package/dist/context/block/login-page.md +60 -0
  16. package/dist/context/block/notification-center.md +61 -0
  17. package/dist/context/block/page-with-breadcrumb.md +54 -0
  18. package/dist/context/block/settings-form-page.md +60 -0
  19. package/dist/context/block/sidebar-app.md +55 -0
  20. package/dist/context/block/stats-cards.md +61 -0
  21. package/dist/context/block/users-table-page.md +61 -0
  22. package/dist/context/blockquote.md +95 -0
  23. package/dist/context/bottom-sheet.md +112 -0
  24. package/dist/context/breadcrumb.md +106 -0
  25. package/dist/context/button-group.md +100 -0
  26. package/dist/context/button.md +117 -0
  27. package/dist/context/calendar.md +118 -0
  28. package/dist/context/card.md +90 -0
  29. package/dist/context/carousel.md +101 -0
  30. package/dist/context/chart/area-chart.md +99 -0
  31. package/dist/context/chart/bar-chart.md +114 -0
  32. package/dist/context/chart/boxplot.md +82 -0
  33. package/dist/context/chart/bubble-chart.md +80 -0
  34. package/dist/context/chart/bullet.md +75 -0
  35. package/dist/context/chart/calendar.md +79 -0
  36. package/dist/context/chart/candlestick.md +104 -0
  37. package/dist/context/chart/combo-chart.md +78 -0
  38. package/dist/context/chart/funnel.md +87 -0
  39. package/dist/context/chart/gauge.md +87 -0
  40. package/dist/context/chart/heatmap.md +77 -0
  41. package/dist/context/chart/histogram.md +74 -0
  42. package/dist/context/chart/kpi.md +70 -0
  43. package/dist/context/chart/line-chart.md +113 -0
  44. package/dist/context/chart/meter.md +71 -0
  45. package/dist/context/chart/pie-chart.md +126 -0
  46. package/dist/context/chart/polar.md +92 -0
  47. package/dist/context/chart/radar.md +81 -0
  48. package/dist/context/chart/radial-bar.md +96 -0
  49. package/dist/context/chart/sankey.md +89 -0
  50. package/dist/context/chart/scatter-chart.md +90 -0
  51. package/dist/context/chart/sparkline.md +69 -0
  52. package/dist/context/chart/stream.md +88 -0
  53. package/dist/context/chart/sunburst.md +93 -0
  54. package/dist/context/chart/treemap.md +84 -0
  55. package/dist/context/chat-bubble.md +116 -0
  56. package/dist/context/checkbox-card.md +104 -0
  57. package/dist/context/checkbox.md +104 -0
  58. package/dist/context/code-snippet.md +118 -0
  59. package/dist/context/code.md +103 -0
  60. package/dist/context/collapsible.md +104 -0
  61. package/dist/context/color-picker.md +101 -0
  62. package/dist/context/combobox.md +125 -0
  63. package/dist/context/command-menu.md +121 -0
  64. package/dist/context/comparison.md +117 -0
  65. package/dist/context/contained-list.md +103 -0
  66. package/dist/context/context-menu.md +103 -0
  67. package/dist/context/copy-button.md +106 -0
  68. package/dist/context/data-list.md +99 -0
  69. package/dist/context/data-table.md +149 -0
  70. package/dist/context/date-picker.md +116 -0
  71. package/dist/context/date-range-picker.md +113 -0
  72. package/dist/context/dock.md +117 -0
  73. package/dist/context/drawer.md +111 -0
  74. package/dist/context/dropdown.md +96 -0
  75. package/dist/context/editable.md +101 -0
  76. package/dist/context/editor/code-editor.md +146 -0
  77. package/dist/context/editor/highlight.md +74 -0
  78. package/dist/context/empty-state.md +101 -0
  79. package/dist/context/fab.md +128 -0
  80. package/dist/context/field.md +118 -0
  81. package/dist/context/file-uploader.md +121 -0
  82. package/dist/context/filter.md +129 -0
  83. package/dist/context/flow/flow-background.md +103 -0
  84. package/dist/context/flow/flow-canvas.md +82 -0
  85. package/dist/context/flow/flow-controls.md +84 -0
  86. package/dist/context/flow/flow-edge.md +128 -0
  87. package/dist/context/flow/flow-handle.md +83 -0
  88. package/dist/context/flow/flow-minimap.md +89 -0
  89. package/dist/context/flow/flow-node.md +97 -0
  90. package/dist/context/flow/flow-panel.md +75 -0
  91. package/dist/context/flow/flow-story.md +145 -0
  92. package/dist/context/flow/flow.md +139 -0
  93. package/dist/context/form.md +104 -0
  94. package/dist/context/header-panel.md +96 -0
  95. package/dist/context/header.md +104 -0
  96. package/dist/context/heading.md +107 -0
  97. package/dist/context/hover-card.md +108 -0
  98. package/dist/context/icon-button.md +115 -0
  99. package/dist/context/image.md +115 -0
  100. package/dist/context/indicator.md +95 -0
  101. package/dist/context/inline-loading.md +101 -0
  102. package/dist/context/input-group.md +122 -0
  103. package/dist/context/input.md +101 -0
  104. package/dist/context/item.md +109 -0
  105. package/dist/context/join.md +97 -0
  106. package/dist/context/kbd.md +100 -0
  107. package/dist/context/label.md +117 -0
  108. package/dist/context/layout/app-shell.md +85 -0
  109. package/dist/context/layout/auth-layout.md +74 -0
  110. package/dist/context/layout/auto-grid.md +69 -0
  111. package/dist/context/layout/center.md +67 -0
  112. package/dist/context/layout/columns.md +70 -0
  113. package/dist/context/layout/dashboard-layout.md +68 -0
  114. package/dist/context/layout/grid.md +70 -0
  115. package/dist/context/layout/masonry.md +70 -0
  116. package/dist/context/layout/page-header.md +75 -0
  117. package/dist/context/layout/section.md +69 -0
  118. package/dist/context/layout/settings-layout.md +68 -0
  119. package/dist/context/layout/spacer.md +64 -0
  120. package/dist/context/layout/split-view.md +71 -0
  121. package/dist/context/layout/stack.md +93 -0
  122. package/dist/context/link.md +112 -0
  123. package/dist/context/list.md +109 -0
  124. package/dist/context/log-viewer.md +124 -0
  125. package/dist/context/menu-button.md +137 -0
  126. package/dist/context/menu.md +108 -0
  127. package/dist/context/menubar.md +92 -0
  128. package/dist/context/modal.md +96 -0
  129. package/dist/context/multi-select.md +104 -0
  130. package/dist/context/native-select.md +118 -0
  131. package/dist/context/navigation-menu.md +95 -0
  132. package/dist/context/notification.md +116 -0
  133. package/dist/context/number-input.md +117 -0
  134. package/dist/context/otp-input.md +98 -0
  135. package/dist/context/overflow-menu.md +107 -0
  136. package/dist/context/pagination.md +123 -0
  137. package/dist/context/password-input.md +100 -0
  138. package/dist/context/popover.md +108 -0
  139. package/dist/context/progress-bar.md +107 -0
  140. package/dist/context/progress-circle.md +101 -0
  141. package/dist/context/progress-indicator.md +105 -0
  142. package/dist/context/progress.md +109 -0
  143. package/dist/context/prose.md +110 -0
  144. package/dist/context/pull-to-refresh.md +101 -0
  145. package/dist/context/qr-code.md +101 -0
  146. package/dist/context/radial-progress.md +117 -0
  147. package/dist/context/radio-card.md +95 -0
  148. package/dist/context/radio.md +94 -0
  149. package/dist/context/rating-group.md +97 -0
  150. package/dist/context/relative-time.md +90 -0
  151. package/dist/context/resizable.md +102 -0
  152. package/dist/context/scroll-area.md +101 -0
  153. package/dist/context/search.md +113 -0
  154. package/dist/context/section/cta.md +83 -0
  155. package/dist/context/section/feature-grid.md +98 -0
  156. package/dist/context/section/hero.md +101 -0
  157. package/dist/context/section/media-masonry.md +77 -0
  158. package/dist/context/section/page-footer.md +101 -0
  159. package/dist/context/section/stats-band.md +81 -0
  160. package/dist/context/segmented-control.md +101 -0
  161. package/dist/context/select.md +101 -0
  162. package/dist/context/separator.md +88 -0
  163. package/dist/context/sheet.md +100 -0
  164. package/dist/context/shell-header.md +105 -0
  165. package/dist/context/side-nav.md +134 -0
  166. package/dist/context/skeleton.md +101 -0
  167. package/dist/context/skip-nav.md +103 -0
  168. package/dist/context/slider.md +98 -0
  169. package/dist/context/spinner.md +89 -0
  170. package/dist/context/stack.md +96 -0
  171. package/dist/context/stat.md +101 -0
  172. package/dist/context/status.md +105 -0
  173. package/dist/context/steps.md +124 -0
  174. package/dist/context/structured-list.md +107 -0
  175. package/dist/context/swap.md +100 -0
  176. package/dist/context/swipe-item.md +110 -0
  177. package/dist/context/switcher.md +97 -0
  178. package/dist/context/tabs.md +93 -0
  179. package/dist/context/tag.md +110 -0
  180. package/dist/context/tags-input.md +94 -0
  181. package/dist/context/text.md +111 -0
  182. package/dist/context/textarea.md +98 -0
  183. package/dist/context/tile.md +116 -0
  184. package/dist/context/time-picker.md +102 -0
  185. package/dist/context/timeline.md +93 -0
  186. package/dist/context/toast.md +91 -0
  187. package/dist/context/toc.md +110 -0
  188. package/dist/context/toggle-group.md +118 -0
  189. package/dist/context/toggle.md +103 -0
  190. package/dist/context/toggletip.md +119 -0
  191. package/dist/context/tooltip.md +92 -0
  192. package/dist/context/tree-view.md +107 -0
  193. package/dist/context/user.md +100 -0
  194. package/dist/context/visually-hidden.md +90 -0
  195. package/dist/context.json +22456 -0
  196. package/dist/index.d.mts +3 -1
  197. package/dist/index.d.mts.map +1 -1
  198. package/dist/index.mjs +73 -32
  199. package/dist/index.mjs.map +1 -1
  200. package/dist/marketplace.json +70 -0
  201. package/dist/registry.json +2832 -358
  202. package/dist/tokens.catalog.json +2375 -0
  203. package/dist/tokens.variants.json +3291 -0
  204. package/package.json +4 -3
  205. package/readme.body.md +53 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/mcp",
3
- "version": "0.2.0",
3
+ "version": "0.3.4",
4
4
  "private": false,
5
5
  "description": "MCP server exposing the cascivo component registry to AI agents",
6
6
  "keywords": [
@@ -23,7 +23,8 @@
23
23
  "directory": "packages/mcp"
24
24
  },
25
25
  "bin": {
26
- "cascade-mcp": "./dist/index.mjs"
26
+ "cascade-mcp": "./dist/index.mjs",
27
+ "cascivo-mcp": "./dist/index.mjs"
27
28
  },
28
29
  "files": [
29
30
  "dist"
@@ -51,7 +52,7 @@
51
52
  "vite-plus": "^0.2.1"
52
53
  },
53
54
  "scripts": {
54
- "build": "vp pack && node -e \"const fs=require('fs');const f='dist/index.mjs';const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!/'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.copyFileSync('../../registry.json','dist/registry.json')\" && chmod +x dist/index.mjs",
55
+ "build": "vp pack && node scripts/postbuild.mjs",
55
56
  "check": "tsc --noEmit",
56
57
  "test": "vp test"
57
58
  }
package/readme.body.md CHANGED
@@ -13,26 +13,56 @@ Add it to your MCP client configuration:
13
13
  }
14
14
  ```
15
15
 
16
- The server speaks the MCP stdio transport. By default it reads the `registry.json` bundled with the package; override with the `CASCIVO_REGISTRY_PATH` environment variable to point at a local registry.
16
+ The server speaks the MCP stdio transport. It is **self-contained**: the registry, token catalog, variant matrix, component context, and marketplace catalog are all bundled with the package, so discovery, token, and validation tools work offline — hosted data is only fetched as a fallback. Override the registry with the `CASCIVO_REGISTRY_PATH` environment variable; add extra registries via `CASCADE_REGISTRIES`.
17
17
 
18
18
  ## Tools
19
19
 
20
- | Tool | Input | Returns |
21
- | -------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
22
- | `list_components` | `{ category? }` | All component manifests, optionally filtered by category |
23
- | `get_component` | `{ name }` | The full manifest for one component |
24
- | `search_components` | `{ query }` | Components matching name, tags, or description |
25
- | `add_to_project` | `{ name, outputDir? }` | Runs `cascivo add <name>` as a child process |
26
- | `create_app` | `{ name, theme?, sections?, cwd? }` | Scaffolds a full Vite + React app (shell + side nav + theme) via `cascivo create` |
27
- | `create_theme` | `{ primary, neutral, accent, name? }` | A custom theme as CSS (semantic token layer) |
28
- | `scaffold_page` | `{ description, components? }` | A JSX page layout string |
29
- | `scaffold_view` | `{ description, components? }` | A validated starter `ViewConfig` + the bound-vocabulary `grammar` for its components |
30
- | `validate_view` | `{ config }` | Validation errors (component, prop type/enum, refs) with exact paths |
31
- | `get_view_grammar` | `{ components? }` | Bound-vocabulary grammar + generation prompt for valid `ViewConfig` JSON |
32
- | `get_variant_matrix` | `{ role?, theme? }` | Deterministic intent→token map (role + state slot) + every token resolved per theme |
33
- | `validate_component` | `{ tsx?, css?, name? }` | Static structural-invariant check of generated source (banned hooks, off-scale breakpoints, missing CSS fallbacks, hallucinated tokens) |
34
-
35
- `category` is one of `inputs`, `display`, `overlay`, `navigation`, `feedback`.
20
+ ### Discovery
21
+
22
+ | Tool | Input | Returns |
23
+ | ------------------- | ---------------------- | -------------------------------------------------------------------------------------------------- |
24
+ | `list_registries` | `{}` | Available registries: the cascivo directory plus any configured via `CASCADE_REGISTRIES` |
25
+ | `list_components` | `{ category?, type? }` | All component manifests, filterable by category and entry type (`component`, `layout`, `block`, …) |
26
+ | `get_component` | `{ name, registry? }` | The full manifest (props, states, tokens, a11y, examples) optionally from an external registry |
27
+ | `search_components` | `{ query, registry? }` | Fuzzy search by name, tags, or description |
28
+ | `get_context` | `{ name }` | Intent, whenToUse/whenNotToUse, and authoring guidance for one component |
29
+ | `select_component` | `{ need }` | Heuristic ranking of components for a natural-language need, with scores and reasons |
30
+
31
+ `category` is one of `inputs`, `display`, `overlay`, `navigation`, `feedback`, `chart`.
32
+
33
+ ### Tokens & theming
34
+
35
+ | Tool | Input | Returns |
36
+ | -------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------- |
37
+ | `get_tokens` | `{ group?, layer?, includeAliases? }` | The closed token catalog — canonical names only by default, so agents never hard-code values |
38
+ | `get_variant_matrix` | `{ role?, theme? }` | Deterministic intent→token map (colour role + state slot) + every token resolved per theme |
39
+ | `create_theme` | `{ primary, neutral, accent, name? }` | A custom theme as CSS (semantic token layer) generated from three colors |
40
+
41
+ ### Scaffold & validate
42
+
43
+ | Tool | Input | Returns |
44
+ | -------------------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
45
+ | `scaffold_view` | `{ description, components? }` | A validated starter `ViewConfig` + the bound-vocabulary `grammar` for its components |
46
+ | `validate_view` | `{ config }` | Validation errors (component, prop type/enum, refs) with exact paths |
47
+ | `get_view_grammar` | `{ components? }` | Bound-vocabulary grammar + generation prompt for valid `ViewConfig` JSON |
48
+ | `validate_component` | `{ tsx?, css?, name? }` | Static structural-invariant check of generated source (banned hooks, off-scale breakpoints, missing CSS fallbacks, hallucinated tokens) |
49
+ | `scaffold_flow` | `{ description, steps?, layout? }` | Starter nodes/edges + ready-to-paste `<Flow />` JSX (from `@cascivo/flow`) for a diagram |
50
+ | `scaffold_page` | `{ description, components? }` | **Deprecated** — use `scaffold_view`; still returns a JSX scaffold plus the `scaffold_view` output |
51
+
52
+ ### Templates
53
+
54
+ | Tool | Input | Returns |
55
+ | ---------------- | ------------------------------------------------ | -------------------------------------------------------------------------------- |
56
+ | `list_templates` | `{ category?, tag?, framework?, verifiedOnly? }` | Marketplace templates (whole-page compositions) from the catalog |
57
+ | `get_template` | `{ name }` | One template: its components, install command, demo link, and screenshots |
58
+ | `add_template` | `{ name, cwd? }` | Installs a template (components + page/fixture files) by running the cascivo CLI |
59
+
60
+ ### Project
61
+
62
+ | Tool | Input | Returns |
63
+ | ---------------- | ----------------------------------- | --------------------------------------------------------------------------------- |
64
+ | `add_to_project` | `{ name, outputDir? }` | Runs `cascivo add <name>` as a child process |
65
+ | `create_app` | `{ name, theme?, sections?, cwd? }` | Scaffolds a full Vite + React app (shell + side nav + theme) via `cascivo create` |
36
66
 
37
67
  ### Bound-vocabulary generation (anti-hallucination)
38
68
 
@@ -41,11 +71,11 @@ prompt** plus a compact **allowed-vocabulary grammar** (each component → its
41
71
  props → enum/size/variant values) for emitting valid `ViewConfig` JSON rendered
42
72
  by `@cascivo/render` `<CascadeView />`. This is [OpenUI](https://openui.com)'s
43
73
  "generate the system prompt from the component library" mechanism (see
44
- [`docs/ROADMAP-V40.md`](../../docs/ROADMAP-V40.md)): because the grammar is
45
- **derived**, not authored, an LLM is structurally prevented from inventing
46
- components, props, or enum values, and the grammar can never drift from the
47
- components. Pair it with `validate_view` (which now also checks prop types/enums)
48
- as the enforcement backstop.
74
+ [`ROADMAP-V40.md`](https://github.com/cascivo/cascivo/blob/main/docs/internal/ROADMAP-V40.md)):
75
+ because the grammar is **derived**, not authored, an LLM is structurally
76
+ prevented from inventing components, props, or enum values, and the grammar can
77
+ never drift from the components. Pair it with `validate_view` (which also checks
78
+ prop types/enums) as the enforcement backstop.
49
79
 
50
80
  ```ts
51
81
  import { buildGenerationPrompt, loadRegistry } from '@cascivo/mcp'
@@ -64,4 +94,4 @@ const server = createServer({ registryPath: './registry.json' })
64
94
  await server.connect(new StdioServerTransport())
65
95
  ```
66
96
 
67
- The pure helpers (`listComponents`, `getComponent`, `searchComponents`, `generateThemeCss`, `scaffoldPage`) are exported too, so the registry can be queried without spinning up the protocol.
97
+ The pure helpers (`listComponents`, `getComponent`, `searchComponents`, `generateThemeCss`, `scaffoldPage`, `buildGrammar`, `buildGenerationPrompt`, `loadRegistry`) are exported too, so the registry can be queried without spinning up the protocol.