@wallarm-org/mcp 3.2.0-rc-fix-dark-theme-tokens.1 → 3.3.0-rc-fix-claude-code.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.
- package/README.md +21 -6
- package/dist/index.js +1245 -104
- package/dist/metadata/components.json +48840 -0
- package/dist/metadata/guidelines.json +1705 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @wallarm-org/mcp
|
|
2
2
|
|
|
3
|
-
MCP (Model Context Protocol) server for Wallarm Design System. Provides component metadata, props, variants, design tokens, and search capabilities to AI assistants via stdio transport.
|
|
3
|
+
MCP (Model Context Protocol) server for Wallarm Design System. Provides component metadata, props, variants, design tokens, design guidelines (foundations and patterns), and search capabilities to AI assistants via stdio transport.
|
|
4
4
|
|
|
5
5
|
Full guide: [wallarm.github.io/design-system/ai/mcp](https://wallarm.github.io/design-system/ai/mcp).
|
|
6
6
|
|
|
@@ -53,10 +53,21 @@ For local development or custom setups:
|
|
|
53
53
|
|
|
54
54
|
| Tool | Input | Description |
|
|
55
55
|
|---|---|---|
|
|
56
|
-
| `search_component` | `{ query: string }` |
|
|
57
|
-
| `get_component` | `{ name: string }` |
|
|
58
|
-
| `
|
|
59
|
-
| `
|
|
56
|
+
| `search_component` | `{ query: string }` | Word-based search over names, descriptions, prop names, variants and an alias map (`modal` → `Dialog`). Prop types are not searched. Top 10 by relevance |
|
|
57
|
+
| `get_component` | `{ name: string, section?: string, page?: number }` | Overview by default (import, compact props, variants, sub-component and example names, usage docs, related guidelines). `section`: `props` (with variants), `subcomponents`, `examples`, `docs/<Name>` or a sub-component name for full detail. A sub-component as `name` (`PageHeader`) returns its section of the parent |
|
|
58
|
+
| `get_example` | `{ component: string, example: string, page?: number }` | One example's code. Keys are story names, `<Story file>/<name>` when a name repeats; fuzzy match (4+ characters, flagged as "Closest match"), lists names on a miss |
|
|
59
|
+
| `search_token` | `{ query: string }` | Search design tokens by name, Tailwind class, value, or category; results include the utility classes. Top 20 by relevance |
|
|
60
|
+
| `get_token_category` | `{ name: string, page?: number }` | All tokens in a category (case-insensitive) with Tailwind classes, e.g. `spacing`, `colors-primary` |
|
|
61
|
+
| `list_guidelines` | `{ kind?: 'foundation' \| 'pattern' }` | Guidelines with slug, title, description and the components they use |
|
|
62
|
+
| `get_guideline` | `{ slug: string, section?: string, page?: number }` | A guideline as markdown, or one section (`rules`, `example`, …). A pattern's examples carry its stories' code, and the overview ends with their names; `section: 'stories'` returns all story code. Long pages and sections are paginated. Also accepts a guideline's own relative links (`../foundations/spacing.md#rules`, the anchor picks the section). Unknown slugs get the nearest slugs |
|
|
63
|
+
|
|
64
|
+
`get_component` also lists the guidelines that use the component.
|
|
65
|
+
|
|
66
|
+
Responses stay under 40,000 characters (`RESPONSE_LIMIT`, below Claude Code's 25k-token MCP output limit). Props tables drop `undefined` from types, collapse long unions to `…(+K)`, omit empty columns, and list props shared by most sub-components (forwarded HTML attributes) once. Anything longer is paginated at headings with a `Page i/N` footer naming the next call.
|
|
67
|
+
|
|
68
|
+
### Instructions
|
|
69
|
+
|
|
70
|
+
On `initialize` the server sends `instructions`: the design-system rules digest (`src/guidelines/rules.md` in the design system) followed by which tool to use for what and the metadata source (installed design system or bundled snapshot, with its version). When the installed design system has no `guidelines.json` (versions before guidelines shipped), the `guidelines.json` bundled into this package is used and labelled as a bundled snapshot; only without it does the server fall back to the bundled `rules.md` digest and the guideline tools say guidelines are not available.
|
|
60
71
|
|
|
61
72
|
### Resources
|
|
62
73
|
|
|
@@ -64,7 +75,7 @@ For local development or custom setups:
|
|
|
64
75
|
|---|---|
|
|
65
76
|
| `ds://components` | Markdown table listing all components with import paths |
|
|
66
77
|
| `ds://tokens` | All design tokens organized by category |
|
|
67
|
-
| `ds://components/{name}` |
|
|
78
|
+
| `ds://components/{name}` | Overview of a specific component (same as `get_component` without `section`) |
|
|
68
79
|
|
|
69
80
|
## 📦 Metadata Resolution
|
|
70
81
|
|
|
@@ -73,6 +84,10 @@ The server automatically resolves `components.json` in this order:
|
|
|
73
84
|
1. `--metadata-path <path>` CLI argument
|
|
74
85
|
2. `import.meta.resolve('@wallarm-org/design-system/metadata')`
|
|
75
86
|
3. Walk up from `cwd` looking for `node_modules/@wallarm-org/design-system/dist/metadata/components.json`
|
|
87
|
+
4. `<cwd>/apps/*/node_modules` and `<cwd>/packages/*/node_modules` (monorepos that install the design system in one app)
|
|
88
|
+
5. The snapshot of `components.json` and `guidelines.json` bundled into this package's `dist/metadata/` at build time
|
|
89
|
+
|
|
90
|
+
`guidelines.json` is read from the same directory as the resolved `components.json`; it is optional and best-effort — a malformed or incompatible file is logged to stderr and ignored, and guidelines of an unknown `kind` are dropped, so the component and token tools keep working. With the bundled snapshot, the instructions and every `get_component` footer say `bundled snapshot vX — may differ from your installed version`; otherwise `installed @wallarm-org/design-system vX`.
|
|
76
91
|
|
|
77
92
|
## 🛠 Development
|
|
78
93
|
|