@santi020k/lumen-mcp 3.0.1 → 4.1.0
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 +125 -42
- package/data/lumen-data.json +35094 -18138
- package/dist/cloudflare-worker.js +1 -1
- package/dist/compatibility.d.ts +18 -0
- package/dist/compatibility.d.ts.map +1 -0
- package/dist/compatibility.js +30 -0
- package/dist/contracts.d.ts +189 -0
- package/dist/contracts.d.ts.map +1 -0
- package/dist/contracts.js +122 -0
- package/dist/data.d.ts +22 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/migration.d.ts +10 -0
- package/dist/migration.d.ts.map +1 -0
- package/dist/migration.js +16 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +50 -21
- package/dist/tools.d.ts +2 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +76 -6
- package/package.json +8 -5
package/README.md
CHANGED
|
@@ -1,4 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://lumen.santi020k.com">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/santi020k/lumen/main/docs/assets/readme/package-dark.svg">
|
|
5
|
+
<img src="https://raw.githubusercontent.com/santi020k/lumen/main/docs/assets/readme/package-light.svg" alt="Lumen UI — Web. Native. Thoughtfully connected." width="1200" height="184">
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<h1 align="center">Lumen UI · MCP Server</h1>
|
|
11
|
+
|
|
12
|
+
<p align="center">Structured catalog · Component discovery · AI tooling</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://www.npmjs.com/package/@santi020k/lumen-mcp"><img src="https://img.shields.io/npm/v/@santi020k/lumen-mcp?style=flat-square&color=0369a0" alt="npm version"></a>
|
|
16
|
+
<a href="https://github.com/santi020k/lumen/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-13967e?style=flat-square" alt="MIT license"></a>
|
|
17
|
+
</p>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://lumen.santi020k.com/docs/mcp">Documentation</a>
|
|
21
|
+
·
|
|
22
|
+
<a href="https://www.npmjs.com/package/@santi020k/lumen-mcp">npm</a>
|
|
23
|
+
·
|
|
24
|
+
<a href="https://github.com/santi020k/lumen/tree/main/packages/mcp">Source</a>
|
|
25
|
+
·
|
|
26
|
+
<a href="https://github.com/santi020k/lumen/issues">Issues</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
**Package:** `@santi020k/lumen-mcp`
|
|
30
|
+
|
|
31
|
+
**On this page:** [Install and connect](#install-and-connect) · [Resources](#resources) · [Further reading](#further-reading)
|
|
32
|
+
|
|
33
|
+
<details>
|
|
34
|
+
<summary>Browse all sections</summary>
|
|
35
|
+
|
|
36
|
+
- [Install and connect](#install-and-connect)
|
|
37
|
+
- [Tools](#tools)
|
|
38
|
+
- [Resources](#resources)
|
|
39
|
+
- [AI plugin package](#ai-plugin-package)
|
|
40
|
+
- [Recommended agent workflow](#recommended-agent-workflow)
|
|
41
|
+
- [Local repository usage](#local-repository-usage)
|
|
42
|
+
- [Programmatic use](#programmatic-use)
|
|
43
|
+
- [Snapshot generation](#snapshot-generation)
|
|
44
|
+
- [License](#license)
|
|
45
|
+
- [Spacing contracts](#spacing-contracts)
|
|
46
|
+
- [Further reading](#further-reading)
|
|
47
|
+
|
|
48
|
+
</details>
|
|
2
49
|
|
|
3
50
|
A [Model Context Protocol](https://modelcontextprotocol.io) server for the Lumen
|
|
4
51
|
multi-framework primitive UI system. It gives AI agents structured access to
|
|
@@ -8,40 +55,6 @@ behavior, runtime events, native platform contracts, and Lumen's generation rule
|
|
|
8
55
|
The published server ships a self-contained catalog snapshot, so consumers do
|
|
9
56
|
not need a checkout of the Lumen repository.
|
|
10
57
|
|
|
11
|
-
## Tools
|
|
12
|
-
|
|
13
|
-
| Tool | Purpose |
|
|
14
|
-
| --- | --- |
|
|
15
|
-
| `lumen_list_components` | List components with descriptions, categories, framework availability, collections, and recipe membership. Filter by `framework`, `recipe`, or natural-language `query`. |
|
|
16
|
-
| `lumen_get_component` | Get a component for `astro`, `react`, or `elements` at `summary`, `usage`, or `source` detail. Usage includes imports, styles, props or attributes, examples, accessibility, guidance, and events. |
|
|
17
|
-
| `lumen_list_native_components` | List native components and filter them by `react-native`, `swiftui`, or `compose`. |
|
|
18
|
-
| `lumen_get_native_component` | Get native installation, setup, import, API, example, accessibility guidance, and optional adapter source for one platform. |
|
|
19
|
-
| `lumen_get_recipe` | Get a recipe or component set with its purpose, components, files, categories, and framework-specific install command. |
|
|
20
|
-
| `lumen_search` | Rank natural-language matches across web and native contracts, recipes, tokens, and agent rules. Optionally filter by web framework or native platform. |
|
|
21
|
-
| `lumen_get_meta` | Return deterministic snapshot provenance, package versions, schema version, component count, and catalog hash. |
|
|
22
|
-
| `lumen_get_catalog_manifest` | Return stable web component, native component, and recipe fingerprints that clients can retain between upgrades. |
|
|
23
|
-
| `lumen_diff_catalog` | Compare a retained manifest with the current snapshot and report added, changed, removed, and unchanged entries. |
|
|
24
|
-
| `lumen_diagnose` | Verify snapshot integrity and report web framework plus native platform coverage when testing a connection. |
|
|
25
|
-
| `lumen_get_tokens` | Return semantic token names, base colors, glass tokens, and the theme attribute. |
|
|
26
|
-
| `lumen_get_rules` | Return the Lumen agent rules from `llms.txt`. |
|
|
27
|
-
|
|
28
|
-
Every tool returns both readable text and validated `structuredContent`.
|
|
29
|
-
|
|
30
|
-
## Resources
|
|
31
|
-
|
|
32
|
-
| Resource | Contents |
|
|
33
|
-
| --- | --- |
|
|
34
|
-
| `lumen://meta` | Snapshot provenance, package versions, and deterministic catalog hash. |
|
|
35
|
-
| `lumen://catalog-manifest` | Stable component and recipe fingerprints for change detection. |
|
|
36
|
-
| `lumen://diagnostics` | Snapshot integrity results and framework coverage. |
|
|
37
|
-
| `lumen://rules` | Agent rules as Markdown. |
|
|
38
|
-
| `lumen://tokens` | Structured design tokens. |
|
|
39
|
-
| `lumen://components` | Compact component catalog. |
|
|
40
|
-
| `lumen://components/{name}` | Component metadata and default Astro usage. |
|
|
41
|
-
| `lumen://native-components` | Compact native component catalog with platform availability. |
|
|
42
|
-
| `lumen://native-components/{name}` | Native component metadata and usage for an available platform. |
|
|
43
|
-
| `lumen://recipes/{name}` | Recipe metadata and install commands. |
|
|
44
|
-
|
|
45
58
|
## Install and connect
|
|
46
59
|
|
|
47
60
|
The stdio command for any MCP client is:
|
|
@@ -151,27 +164,65 @@ The process listens over HTTP. Public hosting must terminate TLS, configure the
|
|
|
151
164
|
and add authentication when the deployed data or operating model requires it. The public Lumen
|
|
152
165
|
catalog does not require user authentication.
|
|
153
166
|
|
|
167
|
+
## Tools
|
|
168
|
+
|
|
169
|
+
| Tool | Purpose |
|
|
170
|
+
| --- | --- |
|
|
171
|
+
| `lumen_list_components` | List components with descriptions, categories, framework availability, collections, and recipe membership. Filter by `framework`, `recipe`, or natural-language `query`. |
|
|
172
|
+
| `lumen_get_component` | Get a component for `astro`, `react`, or `elements` at `summary`, `usage`, or `source` detail. Usage includes imports, styles, props or attributes, examples, keyboard interactions, guidance, and events. |
|
|
173
|
+
| `lumen_list_native_components` | List native components and filter them by `react-native`, `swiftui`, or `compose`. |
|
|
174
|
+
| `lumen_get_native_component` | Get native installation, setup, import, API, example, accessibility guidance, and optional adapter source for one platform. |
|
|
175
|
+
| `lumen_get_recipe` | Get a recipe or component set with its purpose, components, files, categories, and framework-specific install command. |
|
|
176
|
+
| `lumen_search` | Rank natural-language matches across web contracts, recipes, tokens, and agent rules. Supply `platform` to search native contracts; optionally filter web results by `framework` and matches by `kind`. |
|
|
177
|
+
| `lumen_get_meta` | Return deterministic snapshot provenance, package versions, schema version, component count, and catalog hash. |
|
|
178
|
+
| `lumen_get_catalog_manifest` | Return stable web component, native component, and recipe fingerprints that clients can retain between upgrades. |
|
|
179
|
+
| `lumen_diff_catalog` | Compare a retained manifest with the current snapshot and report added, changed, removed, and unchanged entries. |
|
|
180
|
+
| `lumen_diagnose` | Verify snapshot integrity and report web framework plus native platform coverage when testing a connection. |
|
|
181
|
+
| `lumen_get_tokens` | Return canonical spacing dimensions and role aliases, semantic colors, glass tokens, and the theme attribute. |
|
|
182
|
+
| `lumen_check_compatibility` | Compare resolved installed Lumen versions with the catalog; report mismatches without upgrading. |
|
|
183
|
+
| `lumen_get_migration` | Read the v4 migration contract and package-specific review guidance without changing files. |
|
|
184
|
+
| `lumen_get_rules` | Return the Lumen agent rules from `llms.txt`. |
|
|
185
|
+
|
|
186
|
+
Every tool returns both readable text and validated `structuredContent`.
|
|
187
|
+
|
|
188
|
+
## Resources
|
|
189
|
+
|
|
190
|
+
| Guide | What you will find |
|
|
191
|
+
| --- | --- |
|
|
192
|
+
| Resource | Contents |
|
|
193
|
+
| --- | --- |
|
|
194
|
+
| `lumen://meta` | Snapshot provenance, package versions, and deterministic catalog hash. |
|
|
195
|
+
| `lumen://catalog-manifest` | Stable component and recipe fingerprints for change detection. |
|
|
196
|
+
| `lumen://diagnostics` | Snapshot integrity results and framework coverage. |
|
|
197
|
+
| `lumen://rules` | Agent rules as Markdown. |
|
|
198
|
+
| `lumen://tokens` | Structured design tokens. |
|
|
199
|
+
| `lumen://components` | Compact component catalog. |
|
|
200
|
+
| `lumen://components/{name}` | Component metadata and default Astro usage. |
|
|
201
|
+
| `lumen://native-components` | Compact native component catalog with platform availability. |
|
|
202
|
+
| `lumen://native-components/{name}` | Native component metadata and usage for an available platform. |
|
|
203
|
+
| `lumen://recipes/{name}` | Recipe metadata and install commands. |
|
|
204
|
+
|
|
154
205
|
## AI plugin package
|
|
155
206
|
|
|
156
207
|
Install [Lumen UI from the Plugins Directory](https://chatgpt.com/plugins/plugin_asdk_app_6a8f6c526c5481918eb8a48806fa112b)
|
|
157
208
|
in ChatGPT or Codex, then mention **@Lumen UI** in a request. The published plugin uses the hosted,
|
|
158
209
|
read-only catalog and requires no separate Lumen account, API key, or local MCP configuration.
|
|
159
210
|
|
|
160
|
-
The repository includes the plugin package in [`plugins/lumen-ui`](
|
|
211
|
+
The repository includes the plugin package in [`plugins/lumen-ui`](https://github.com/santi020k/lumen/tree/main/plugins/lumen-ui).
|
|
161
212
|
It combines the portable `lumen-ui` skill with this MCP server for Codex, ChatGPT, and Claude Code.
|
|
162
213
|
The public OpenAI Plugins Directory version uses a hosted Streamable HTTP endpoint; see the
|
|
163
|
-
[publication record and checklist](
|
|
214
|
+
[publication record and checklist](https://github.com/santi020k/lumen/blob/main/docs/openai-plugin-submission.md) for deployment requirements, listing
|
|
164
215
|
copy, annotation justifications, and reviewer test cases.
|
|
165
216
|
|
|
166
217
|
Claude Code uses the package's stdio configuration and the repository marketplace in
|
|
167
|
-
[`.claude-plugin/marketplace.json`](
|
|
168
|
-
[Claude Code plugin guide](
|
|
218
|
+
[`.claude-plugin/marketplace.json`](https://github.com/santi020k/lumen/blob/main/.claude-plugin/marketplace.json). See the
|
|
219
|
+
[Claude Code plugin guide](https://github.com/santi020k/lumen/blob/main/docs/claude-code-plugin.md) for installation and validation.
|
|
169
220
|
|
|
170
221
|
## Recommended agent workflow
|
|
171
222
|
|
|
172
223
|
1. Read `lumen://meta` and call `lumen_diagnose` to identify and verify the bundled snapshot.
|
|
173
|
-
2. Read `lumen://rules`.
|
|
174
|
-
3. Call `lumen_search` with the requested use case
|
|
224
|
+
2. Call `lumen_check_compatibility` with exact installed versions (not manifest ranges). Use matching installed types and README when any version differs. Read `lumen://rules`.
|
|
225
|
+
3. Call `lumen_search` with the requested use case, target framework or platform, `limit: 5`, and a focused `kind` when appropriate. Widen discovery only when needed.
|
|
175
226
|
4. For web, call `lumen_get_component`; for native, call `lumen_get_native_component` with `detail: "usage"`.
|
|
176
227
|
5. Follow the returned framework behavior section: mount Astro `UIPrimitives` once, use the named React hook/controller, or register custom elements once.
|
|
177
228
|
6. Inspect a related recipe with `lumen_get_recipe` when the UI needs multiple primitives.
|
|
@@ -283,6 +334,17 @@ import { createLumenServer } from '@santi020k/lumen-mcp'
|
|
|
283
334
|
const server = createLumenServer()
|
|
284
335
|
```
|
|
285
336
|
|
|
337
|
+
Lumen 4 uses the stable MCP TypeScript SDK v2. The embedded server is an
|
|
338
|
+
`McpServer` from `@modelcontextprotocol/server`; use v2 transports from that
|
|
339
|
+
package (or `@modelcontextprotocol/server/stdio`) when connecting it. Rebuild
|
|
340
|
+
programmatic integrations that previously imported SDK objects from
|
|
341
|
+
`@modelcontextprotocol/sdk`, following the
|
|
342
|
+
[official SDK migration guide](https://ts.sdk.modelcontextprotocol.io/v2/migration/upgrade-to-v2).
|
|
343
|
+
Existing CLI commands, the stateless HTTP endpoint, argument schemas, and resource URIs remain
|
|
344
|
+
available. Version checks and migration discovery are additive tools; component and recipe results
|
|
345
|
+
now expose concrete nested output schemas. Existing MCP clients can keep using the
|
|
346
|
+
`2025-11-25` protocol handshake.
|
|
347
|
+
|
|
286
348
|
## Snapshot generation
|
|
287
349
|
|
|
288
350
|
`scripts/generate-data.mjs` builds `data/lumen-data.json` from:
|
|
@@ -303,12 +365,33 @@ alongside Lumen framework packages, and the package smoke test installs the
|
|
|
303
365
|
packed artifact into a temporary consumer project before making a real stdio
|
|
304
366
|
handshake.
|
|
305
367
|
|
|
306
|
-
The evaluation gate
|
|
368
|
+
The deterministic evaluation gate runs English and Spanish natural-language search benchmarks,
|
|
307
369
|
calls every available component/framework contract through MCP, parses all
|
|
308
370
|
Astro and custom-element examples, and type-checks every React example against
|
|
309
371
|
the built React package. A generated example that is syntactically valid but
|
|
310
372
|
uses an unsupported React prop therefore fails before release.
|
|
311
373
|
|
|
374
|
+
Actual Codex and Claude fixture runs are an opt-in authenticated benchmark, separate from deterministic
|
|
375
|
+
CI. See [v4 AI verification](https://github.com/santi020k/lumen/blob/main/docs/lumen-4-ai.md) for commands, evidence, and limitations.
|
|
376
|
+
|
|
312
377
|
## License
|
|
313
378
|
|
|
314
379
|
MIT © Santiago Molina
|
|
380
|
+
|
|
381
|
+
## Spacing contracts
|
|
382
|
+
|
|
383
|
+
`lumen_get_tokens` returns `spacing` (canonical numeric pixel dimensions) and `spacingRoles`
|
|
384
|
+
(aliases such as `related: "sm"`, `group: "lg"`, `section: "2xl"`, `inset: "xl"`). CSS uses rem.
|
|
385
|
+
The readable result explains ownership and CSS variables; `lumen_search` also finds spacing roles.
|
|
386
|
+
Snapshot schema 8 includes these fields and complete framework recipe examples. Read component contracts for supported gap and density
|
|
387
|
+
props; the inset token is for padding and is not a Stack/Grid gap prop.
|
|
388
|
+
|
|
389
|
+
## Further reading
|
|
390
|
+
|
|
391
|
+
| [AI usage examples](https://github.com/santi020k/lumen/blob/main/docs/ai-usage.md) | Setup and composition contracts for coding agents. |
|
|
392
|
+
| [Portable agent skill](https://github.com/santi020k/lumen/blob/main/skills/lumen-ui/SKILL.md) | Portable agent skill guidance and examples. |
|
|
393
|
+
| [Contributing](https://github.com/santi020k/lumen/blob/main/CONTRIBUTING.md) | Setup, checks, and contribution workflow. |
|
|
394
|
+
| [Release history](https://github.com/santi020k/lumen/releases) | Published releases and version notes. |
|
|
395
|
+
|
|
396
|
+
Part of [Lumen UI](https://lumen.santi020k.com), created by [Santiago Molina](https://santi020k.com).
|
|
397
|
+
Licensed under [MIT](https://github.com/santi020k/lumen/blob/main/LICENSE); third-party artwork retains its own notices.
|