@sky.ui/mcp 0.0.1 → 0.0.2

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 (43) hide show
  1. package/README.md +191 -182
  2. package/data/chart-api-sections.json +4184 -4184
  3. package/data/reactivity-readme-snapshot.json +1 -1
  4. package/data/theme-authoring-contract.json +598 -598
  5. package/dist/catalog.d.ts.map +1 -1
  6. package/dist/catalog.js +40 -29
  7. package/dist/catalog.js.map +1 -1
  8. package/dist/cem.d.ts +1 -1
  9. package/dist/cem.d.ts.map +1 -1
  10. package/dist/cem.js +5 -11
  11. package/dist/cem.js.map +1 -1
  12. package/dist/docs-read.js +6 -6
  13. package/dist/docs.js +4 -4
  14. package/dist/framework-wrappers.d.ts.map +1 -1
  15. package/dist/framework-wrappers.js +4 -8
  16. package/dist/framework-wrappers.js.map +1 -1
  17. package/dist/mcp-runtime-status.js +2 -2
  18. package/dist/package-resolve.d.ts +10 -0
  19. package/dist/package-resolve.d.ts.map +1 -0
  20. package/dist/package-resolve.js +87 -0
  21. package/dist/package-resolve.js.map +1 -0
  22. package/dist/reactivity-info.d.ts.map +1 -1
  23. package/dist/reactivity-info.js +4 -11
  24. package/dist/reactivity-info.js.map +1 -1
  25. package/dist/server.js +4 -4
  26. package/dist/source-read.d.ts.map +1 -1
  27. package/dist/source-read.js +6 -10
  28. package/dist/source-read.js.map +1 -1
  29. package/dist/utils-suggestion-grounding.d.ts.map +1 -1
  30. package/dist/utils-suggestion-grounding.js +4 -11
  31. package/dist/utils-suggestion-grounding.js.map +1 -1
  32. package/docs/agent-recipe-example-site.md +91 -91
  33. package/docs/ai-design-mcp-blueprint.md +75 -75
  34. package/docs/cross-model-mcp-playbook.md +127 -127
  35. package/docs/example-site-and-mcp-training.md +82 -82
  36. package/docs/mcp-capability-status.md +51 -51
  37. package/docs/mcp-tooling-roadmap.md +36 -36
  38. package/docs/sky-chart-option-api.md +47 -47
  39. package/docs/starter-prompt.md +17 -17
  40. package/docs/theme-config-guide.md +178 -178
  41. package/docs/utils-usage-guide.md +112 -110
  42. package/docs/vue-wrapper-v-model.md +36 -36
  43. package/package.json +72 -63
package/README.md CHANGED
@@ -1,182 +1,191 @@
1
- # @sky.ui/mcp
2
-
3
- Model Context Protocol (MCP) server for [Sky UI](https://library.sky-ui.com). Gives AI coding assistants accurate component APIs, usage snippets, theme tokens, and utility classes—instead of guessing tag names or props.
4
-
5
- Transport: **stdio** (Cursor, VS Code, Claude Desktop, and other MCP clients).
6
-
7
- ---
8
-
9
- ## Install
10
-
11
- ```bash
12
- npm install @sky.ui/mcp @sky.ui/core
13
- ```
14
-
15
- | Package | Required | Role |
16
- |---------|----------|------|
17
- | `@sky.ui/core` | yes | Component metadata (CEM / AST) |
18
- | `@sky.ui/utils` | no | Live utility-class catalog |
19
- | `@sky.ui/reactivity` | no | Reactivity layer docs (optional peer via snapshot) |
20
-
21
- ---
22
-
23
- ## Quick start
24
-
25
- Add to **`.cursor/mcp.json`** or **`.vscode/mcp.json`**:
26
-
27
- ```json
28
- {
29
- "mcpServers": {
30
- "sky-ui": {
31
- "command": "npx",
32
- "args": ["-y", "@sky.ui/mcp@latest"]
33
- }
34
- }
35
- }
36
- ```
37
-
38
- Reload the MCP panel after saving.
39
-
40
- **Health check:**
41
-
42
- ```bash
43
- npx @sky.ui/mcp -- --health
44
- ```
45
-
46
- **Installed locally** (monorepo or app dependency):
47
-
48
- ```json
49
- {
50
- "mcpServers": {
51
- "sky-ui": {
52
- "command": "node",
53
- "args": ["./node_modules/@sky.ui/mcp/dist/mcp-stdio-entry.js"]
54
- }
55
- }
56
- }
57
- ```
58
-
59
- The process speaks over stdin/stdout. If it exits immediately in a plain terminal, that is normal—no MCP client is attached.
60
-
61
- ---
62
-
63
- ## Tools
64
-
65
- | Tool | Description |
66
- |------|-------------|
67
- | `get_project_guide` | Installation and bundler setup (Lit, React, Vue) |
68
- | `sky_components` | List, search, or search-by-API over the component catalog |
69
- | `get_sky_component_docs` | Props, events, slots, methods, types, and live doc-page snippets |
70
- | `get_component_usage` | Copy-paste starter snippets for Lit, React, or Vue |
71
- | `get_reactivity_layer` | `@sky.ui/reactivity` API reference |
72
- | `get_chart_usage` | `sky-chart` option reference (Pro) |
73
- | `get_theme` | Theme authoring: guide, fields, variables, compose |
74
- | `get_docs` | Allowlisted guides (utils, charts, agent recipes) |
75
- | `utility_classes` | Search and validate `@sky.ui/utils` class names |
76
-
77
- Learn more: [modelcontextprotocol.io](https://modelcontextprotocol.io).
78
-
79
- ---
80
-
81
- ## How documentation is sourced
82
-
83
- Sky UI MCP combines two layers:
84
-
85
- 1. **Package metadata (authoritative API)** — `get_sky_component_docs` and `sky_components` read **`@sky.ui/core`** (installed in the project). Props, events, slots, and methods come from the Custom Elements Manifest and TypeScript sources.
86
-
87
- 2. **Published docs site (examples & routing)** — By default, MCP enriches component docs from **[library.sky-ui.com](https://library.sky-ui.com)**:
88
- - `GET /api/mcp/manifest`
89
- - `GET /api/mcp/component/{id}`
90
-
91
- Enrichment adds **`exampleSiteSections`** (HTML / Sky / Vue / React snippets from doc pages) and **`exampleSitePageAi`** (routing hints). Responses include `_skyUiMcp.truthLayer` so assistants treat package API as canonical and site data as supplementary.
92
-
93
- No configuration is required for production; the default origin is `https://library.sky-ui.com`.
94
-
95
- ---
96
-
97
- ## Environment variables
98
-
99
- | Variable | Default | Description |
100
- |----------|---------|-------------|
101
- | `SKY_UI_EXAMPLE_SITE_BASE_URL` | `https://library.sky-ui.com` | Docs site origin (no path). Override for local dev, e.g. `http://localhost:3000`. |
102
- | `SKY_UI_EXAMPLE_SITE_DISABLE` | — | Set `1` to skip live site fetches (offline / air-gapped). |
103
- | `SKY_UI_EXAMPLE_SITE_EXTRA_HOSTS` | — | Comma-separated hostnames allowed after redirects. |
104
- | `SKY_UI_MAIN_PACKAGE_ROOT` | auto | Path to `@sky.ui/core` when not resolved from `node_modules`. |
105
- | `SKY_UI_PERSONAL_TOKEN` | — | Pro package access (see below). |
106
- | `SKY_UI_AUTH_TOKEN` | — | Alias for personal token. |
107
-
108
- **Local docs site** (while running the Sky UI documentation site locally):
109
-
110
- ```json
111
- "env": {
112
- "SKY_UI_EXAMPLE_SITE_BASE_URL": "http://localhost:3000"
113
- }
114
- ```
115
-
116
- ---
117
-
118
- ## Pro packages (`@sky.ui.pro/*`)
119
-
120
- Pro artifacts require a license token:
121
-
122
- 1. Run `npx sky.ui.pro login` once, **or**
123
- 2. Set `SKY_UI_PERSONAL_TOKEN` / `SKY_UI_AUTH_TOKEN` in the MCP server `env` block.
124
-
125
- Cursor does not inherit shell profile variables—set tokens explicitly in MCP config when needed.
126
-
127
- ---
128
-
129
- ## Optional: HTTP POST server
130
-
131
- For clients that cannot use stdio:
132
-
133
- ```bash
134
- npx @sky.ui/mcp serve:post
135
- ```
136
-
137
- | Setting | Default |
138
- |---------|---------|
139
- | Port | `3001` (`SKY_UI_MCP_POST_PORT`) |
140
- | Endpoints | `GET /health`, `POST /tool`, Streamable HTTP on `/` |
141
-
142
- See `docs/cross-model-mcp-playbook.md` for auth, CORS, and rate-limit options.
143
-
144
- ---
145
-
146
- ## Setup checklist
147
-
148
- 1. Install `@sky.ui/mcp` and `@sky.ui/core` in the workspace (or use `npx`).
149
- 2. Ensure `@sky.ui/core` is built (`custom-elements.json` present) or install a published version from npm.
150
- 3. Add the MCP server to your editor config and reload.
151
- 4. Run `npx @sky.ui/mcp -- --health` and confirm `docsReady` and `exampleSite.baseUrl`.
152
-
153
- ---
154
-
155
- ## Troubleshooting
156
-
157
- | Symptom | Action |
158
- |---------|--------|
159
- | `COMPONENT_DOCS_FAILED` | Install `@sky.ui/core`; set `SKY_UI_MAIN_PACKAGE_ROOT` if needed |
160
- | `customElementsManifest: null` | Build `@sky.ui/core` or install a published build |
161
- | Missing `exampleSiteSections` | Confirm [library.sky-ui.com/api/mcp/manifest](https://library.sky-ui.com/api/mcp/manifest) is reachable, or set `SKY_UI_EXAMPLE_SITE_BASE_URL` |
162
- | Stale tools in Cursor | Reload MCP after upgrading `@sky.ui/mcp` |
163
- | `UTILS_SUGGESTION_FAILED` | Install `@sky.ui/utils` or upgrade MCP (includes snapshot fallback) |
164
- | Process exits in terminal | Expected without an MCP client on stdin |
165
-
166
- ---
167
-
168
- ## Related packages
169
-
170
- | Package | Link |
171
- |---------|------|
172
- | `@sky.ui/core` | [npm](https://www.npmjs.com/package/@sky.ui/core) |
173
- | `@sky.ui/react` | [npm](https://www.npmjs.com/package/@sky.ui/react) |
174
- | `@sky.ui/vue` | [npm](https://www.npmjs.com/package/@sky.ui/vue) |
175
- | `@sky.ui/utils` | [npm](https://www.npmjs.com/package/@sky.ui/utils) |
176
- | `@sky.ui/reactivity` | [npm](https://www.npmjs.com/package/@sky.ui/reactivity) |
177
-
178
- ---
179
-
180
- ## License
181
-
182
- [Sky UI Free EULA](./LICENSE.md) — proprietary; not open source.
1
+ # @sky.ui/mcp
2
+
3
+ Model Context Protocol (MCP) server for [Sky UI](https://library.sky-ui.com). Gives AI coding assistants accurate component APIs, usage snippets, theme tokens, and utility classes—instead of guessing tag names or props.
4
+
5
+ Transport: **stdio** (Cursor, VS Code, Claude Desktop, and other MCP clients).
6
+
7
+ ---
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install "@sky.ui/mcp" "@sky.ui/core"
13
+ ```
14
+
15
+ > Quote scoped names (`"@sky.ui/…"`) required in PowerShell. See [powershell-scoped-packages.md](../../docs/powershell-scoped-packages.md).
16
+
17
+ | Package | Required | Role |
18
+ |---------|----------|------|
19
+ | `@sky.ui/core` | yes | Component metadata (CEM / AST) |
20
+ | `@sky.ui/utils` | no | Live utility-class catalog |
21
+ | `@sky.ui/reactivity` | no | Reactivity layer docs (optional peer via snapshot) |
22
+
23
+ ---
24
+
25
+ ## Quick start
26
+
27
+ Add to **`.cursor/mcp.json`** or **`.vscode/mcp.json`**:
28
+
29
+ ```json
30
+ {
31
+ "mcpServers": {
32
+ "sky-ui": {
33
+ "command": "npx",
34
+ "args": ["-y", "@sky.ui/mcp@latest"]
35
+ }
36
+ }
37
+ }
38
+ ```
39
+
40
+ Reload the MCP panel after saving.
41
+
42
+ **Global / `npx` (recommended pattern):** MCP resolves `@sky.ui/core` from your **workspace** `node_modules` (via `process.cwd()` / `INIT_CWD`), not from the global install — same as ESLint, Prettier, and PostCSS plugins. Still install `@sky.ui/core` in the project:
43
+
44
+ ```bash
45
+ npm install "@sky.ui/mcp" "@sky.ui/core"
46
+ ```
47
+
48
+ **Health check:**
49
+
50
+ ```bash
51
+ npx @sky.ui/mcp -- --health
52
+ ```
53
+
54
+ **Installed locally** (monorepo or app dependency):
55
+
56
+ ```json
57
+ {
58
+ "mcpServers": {
59
+ "sky-ui": {
60
+ "command": "node",
61
+ "args": ["./node_modules/@sky.ui/mcp/dist/mcp-stdio-entry.js"]
62
+ }
63
+ }
64
+ }
65
+ ```
66
+
67
+ The process speaks over stdin/stdout. If it exits immediately in a plain terminal, that is normal—no MCP client is attached.
68
+
69
+ ---
70
+
71
+ ## Tools
72
+
73
+ | Tool | Description |
74
+ |------|-------------|
75
+ | `get_project_guide` | Installation and bundler setup (Lit, React, Vue) |
76
+ | `sky_components` | List, search, or search-by-API over the component catalog |
77
+ | `get_sky_component_docs` | Props, events, slots, methods, types, and live doc-page snippets |
78
+ | `get_component_usage` | Copy-paste starter snippets for Lit, React, or Vue |
79
+ | `get_reactivity_layer` | `@sky.ui/reactivity` API reference |
80
+ | `get_chart_usage` | `sky-chart` option reference (Pro) |
81
+ | `get_theme` | Theme authoring: guide, fields, variables, compose |
82
+ | `get_docs` | Allowlisted guides (utils, charts, agent recipes) |
83
+ | `utility_classes` | Search and validate `@sky.ui/utils` class names |
84
+
85
+ Learn more: [modelcontextprotocol.io](https://modelcontextprotocol.io).
86
+
87
+ ---
88
+
89
+ ## How documentation is sourced
90
+
91
+ Sky UI MCP combines two layers:
92
+
93
+ 1. **Package metadata (authoritative API)** `get_sky_component_docs` and `sky_components` read **`@sky.ui/core`** (installed in the project). Props, events, slots, and methods come from the Custom Elements Manifest and TypeScript sources.
94
+
95
+ 2. **Published docs site (examples & routing)** — By default, MCP enriches component docs from **[library.sky-ui.com](https://library.sky-ui.com)**:
96
+ - `GET /api/mcp/manifest`
97
+ - `GET /api/mcp/component/{id}`
98
+
99
+ Enrichment adds **`exampleSiteSections`** (HTML / Sky / Vue / React snippets from doc pages) and **`exampleSitePageAi`** (routing hints). Responses include `_skyUiMcp.truthLayer` so assistants treat package API as canonical and site data as supplementary.
100
+
101
+ No configuration is required for production; the default origin is `https://library.sky-ui.com`.
102
+
103
+ ---
104
+
105
+ ## Environment variables
106
+
107
+ | Variable | Default | Description |
108
+ |----------|---------|-------------|
109
+ | `SKY_UI_EXAMPLE_SITE_BASE_URL` | `https://library.sky-ui.com` | Docs site origin (no path). Override for local dev, e.g. `http://localhost:3000`. |
110
+ | `SKY_UI_EXAMPLE_SITE_DISABLE` | — | Set `1` to skip live site fetches (offline / air-gapped). |
111
+ | `SKY_UI_EXAMPLE_SITE_EXTRA_HOSTS` | — | Comma-separated hostnames allowed after redirects. |
112
+ | `SKY_UI_MAIN_PACKAGE_ROOT` | auto | Path to `@sky.ui/core` when not resolved from `node_modules`. |
113
+ | `SKY_UI_MCP_PROJECT_ROOT` | auto | Workspace root when MCP runs globally (`npx`) but deps live in a project (same idea as ESLint cwd). |
114
+ | `SKY_UI_PERSONAL_TOKEN` | — | Pro package access (see below). |
115
+ | `SKY_UI_AUTH_TOKEN` | — | Alias for personal token. |
116
+
117
+ **Local docs site** (while running the Sky UI documentation site locally):
118
+
119
+ ```json
120
+ "env": {
121
+ "SKY_UI_EXAMPLE_SITE_BASE_URL": "http://localhost:3000"
122
+ }
123
+ ```
124
+
125
+ ---
126
+
127
+ ## Pro packages (`@sky.ui.pro/*`)
128
+
129
+ Pro artifacts require a license token:
130
+
131
+ 1. Run `npx sky.ui.pro login` once, **or**
132
+ 2. Set `SKY_UI_PERSONAL_TOKEN` / `SKY_UI_AUTH_TOKEN` in the MCP server `env` block.
133
+
134
+ Cursor does not inherit shell profile variables—set tokens explicitly in MCP config when needed.
135
+
136
+ ---
137
+
138
+ ## Optional: HTTP POST server
139
+
140
+ For clients that cannot use stdio:
141
+
142
+ ```bash
143
+ npx @sky.ui/mcp serve:post
144
+ ```
145
+
146
+ | Setting | Default |
147
+ |---------|---------|
148
+ | Port | `3001` (`SKY_UI_MCP_POST_PORT`) |
149
+ | Endpoints | `GET /health`, `POST /tool`, Streamable HTTP on `/` |
150
+
151
+ See `docs/cross-model-mcp-playbook.md` for auth, CORS, and rate-limit options.
152
+
153
+ ---
154
+
155
+ ## Setup checklist
156
+
157
+ 1. Install `@sky.ui/mcp` and `@sky.ui/core` in the workspace (or use `npx`).
158
+ 2. Ensure `@sky.ui/core` is built (`custom-elements.json` present) or install a published version from npm.
159
+ 3. Add the MCP server to your editor config and reload.
160
+ 4. Run `npx @sky.ui/mcp -- --health` and confirm `docsReady` and `exampleSite.baseUrl`.
161
+
162
+ ---
163
+
164
+ ## Troubleshooting
165
+
166
+ | Symptom | Action |
167
+ |---------|--------|
168
+ | `COMPONENT_DOCS_FAILED` | Install `@sky.ui/core`; set `SKY_UI_MAIN_PACKAGE_ROOT` if needed |
169
+ | `customElementsManifest: null` | Build `@sky.ui/core` or install a published build |
170
+ | Missing `exampleSiteSections` | Confirm [library.sky-ui.com/api/mcp/manifest](https://library.sky-ui.com/api/mcp/manifest) is reachable, or set `SKY_UI_EXAMPLE_SITE_BASE_URL` |
171
+ | Stale tools in Cursor | Reload MCP after upgrading `@sky.ui/mcp` |
172
+ | `UTILS_SUGGESTION_FAILED` | Install `@sky.ui/utils` or upgrade MCP (includes snapshot fallback) |
173
+ | Process exits in terminal | Expected without an MCP client on stdin |
174
+
175
+ ---
176
+
177
+ ## Related packages
178
+
179
+ | Package | Link |
180
+ |---------|------|
181
+ | `@sky.ui/core` | [npm](https://www.npmjs.com/package/@sky.ui/core) |
182
+ | `@sky.ui/react` | [npm](https://www.npmjs.com/package/@sky.ui/react) |
183
+ | `@sky.ui/vue` | [npm](https://www.npmjs.com/package/@sky.ui/vue) |
184
+ | `@sky.ui/utils` | [npm](https://www.npmjs.com/package/@sky.ui/utils) |
185
+ | `@sky.ui/reactivity` | [npm](https://www.npmjs.com/package/@sky.ui/reactivity) |
186
+
187
+ ---
188
+
189
+ ## License
190
+
191
+ [Sky UI Free EULA](https://unpkg.com/@sky.ui/mcp/LICENSE.md) — proprietary; not open source.