@besaitech/ng-design-system-mcp 0.0.5

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 ADDED
@@ -0,0 +1,97 @@
1
+ # @besaitech/ng-design-system-mcp
2
+
3
+ An [MCP](https://modelcontextprotocol.io) server that exposes the **`@besaitech/ng-design-system`**
4
+ Angular component library documentation to AI coding tools (Claude Code, Cursor, Windsurf…).
5
+
6
+ It lets the assistant look up real selectors, inputs, enum values, outputs (including
7
+ two-way `model()` change-events), exported types, content-projection slots, design tokens,
8
+ registered icon names, copyable examples, and the Tailwind-v4 setup — then **validate** the
9
+ code it generates — so it stops guessing the API.
10
+
11
+ The documentation is **generated from the library source at build time** and bundled into this
12
+ package as `data/docs.json`, version-stamped to the library release it describes. It never
13
+ drifts and never calls the network.
14
+
15
+ ## Install
16
+
17
+ Published to the public npm registry, same as the library it documents:
18
+
19
+ ```bash
20
+ npm install -g @besaitech/ng-design-system-mcp
21
+ ```
22
+
23
+ No scope mapping, no `.npmrc` and no token needed.
24
+
25
+ ## Register the server
26
+
27
+ ### Claude Code
28
+
29
+ ```sh
30
+ claude mcp add saitech-design-system -- npx -y @besaitech/ng-design-system-mcp
31
+ ```
32
+
33
+ ### `.mcp.json` (committed in a consuming repo)
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "saitech-design-system": {
39
+ "command": "npx",
40
+ "args": ["-y", "@besaitech/ng-design-system-mcp@0.0.5"]
41
+ }
42
+ }
43
+ }
44
+ ```
45
+
46
+ > **Pin the same version as your installed `@besaitech/ng-design-system`** so the docs match the
47
+ > code you ship. The `sds://meta` resource and `sds_get_setup` echo the bundled
48
+ > `libraryVersion` so the agent can confirm what it is coding against.
49
+
50
+ ### Cursor / Windsurf
51
+
52
+ Use the identical stdio command in the tool's MCP config (`command: npx`, `args: ["-y", "@besaitech/ng-design-system-mcp"]`).
53
+
54
+ ## What it provides
55
+
56
+ **Tools**
57
+
58
+ | tool | purpose |
59
+ | --- | --- |
60
+ | `sds_list_components` | discover the catalogue (filter by `kind` / `group`) |
61
+ | `sds_get_component` | full API for one component (fuzzy: class name, selector, or bare name) |
62
+ | `sds_get_examples` | curated, copyable snippets grouped by section |
63
+ | `sds_search` | keyword search across names, descriptions, inputs, types, examples |
64
+ | `sds_validate_usage` | lint generated markup (selectors, inputs, enums, required, icons, CVA `[value]`) |
65
+ | `sds_validate_icon` | check an `<sds-icon name>` against the registry (+ suggestions) |
66
+ | `sds_get_token` | design tokens with Tailwind utility + CSS variable |
67
+ | `sds_get_setup` | install + Tailwind-v4 checklist (the #1 "renders unstyled" fix) |
68
+
69
+ **Resources** — `sds://docs.json`, `sds://meta`, `sds://component/{selectorOrClass}`,
70
+ `sds://components/{selector}.md`, `sds://llms.txt`.
71
+
72
+ **Prompts** — `sds_generate_component_usage`, `sds_scaffold_form`, `sds_build_data_table`.
73
+
74
+ ## Contributor mode (inside the monorepo)
75
+
76
+ To serve docs from a live working tree (re-extracts from source on startup, no rebuild):
77
+
78
+ ```sh
79
+ node packages/mcp-server/dist/index.js --source /path/to/saitech-design-system
80
+ ```
81
+
82
+ `--data <path>` serves a specific `docs.json`. `--http` is reserved for a future shared
83
+ instance (currently falls back to stdio).
84
+
85
+ ## How it is built & released
86
+
87
+ From the workspace root:
88
+
89
+ ```sh
90
+ npm run docs:index # regenerate data/docs.json (+ docs/ by-products) from source
91
+ npm run build:mcp # docs:index, then tsc -> dist/
92
+ npm run release:mcp # bump, build, publish to npm
93
+ npm run release:all # release the library, then this server (lockstep)
94
+ ```
95
+
96
+ `prebuild:lib` regenerates the index before every `ng build saitech-design-system`, and CI
97
+ (`npm run check:docs`) fails if the committed index drifts from source.