@neuctra/ui-mcp 0.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 ADDED
@@ -0,0 +1,71 @@
1
+ # @neuctra/ui-mcp
2
+
3
+ An MCP (Model Context Protocol) server that gives AI coding assistants ground-truth
4
+ knowledge of the [`@neuctra/ui`](../neuctra-ui-package) component library — real prop
5
+ names, types, defaults, and usage examples straight from source, plus the semantic
6
+ theming rules — so generated code doesn't guess or hallucinate.
7
+
8
+ ## Tools
9
+
10
+ - **`list_components`** — list all components, optionally filtered by category
11
+ (`layout`, `typography`, `form`, `actions`, `data-display`, `feedback`, `overlay`,
12
+ `navigation`).
13
+ - **`get_component`** — full spec for one component: every prop (type, required,
14
+ default, description) plus a real usage example scraped from the docs site.
15
+ - **`search_components`** — keyword search across name/category/description/prop names.
16
+ - **`get_theme`** — the semantic color token system (`bg-primary`, `text-foreground`, ...)
17
+ and the rule set for using it instead of hardcoded Tailwind colors, so generated UI
18
+ respects the consumer's light/dark theme.
19
+
20
+ ## Data source
21
+
22
+ `data/components.json` is a synced copy of
23
+ [`neuctra-ui-package/registry/components.json`](../neuctra-ui-package/registry/components.json),
24
+ which is generated from the TypeScript source via `npm run registry:generate` in that
25
+ package (parses prop interfaces + JSDoc with `ts-morph`, plus scrapes one usage example
26
+ per component from the docs site). Run `npm run sync-registry` here after regenerating it
27
+ there. `data/theme.json` is hand-curated from the CLI's CSS template
28
+ (`neuctra-ui-cli/lib/update-css.js`) and updated manually if the token set changes.
29
+
30
+ ## Local development
31
+
32
+ ```bash
33
+ npm install
34
+ npm run sync-registry # pulls the latest registry.json from neuctra-ui-package
35
+ npm start # runs the server on stdio
36
+ ```
37
+
38
+ ## Using with Claude Code / Claude Desktop
39
+
40
+ Add to your MCP config (`.mcp.json` for a project, or Claude Desktop's config file):
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "neuctra-ui": {
46
+ "command": "npx",
47
+ "args": ["-y", "@neuctra/ui-mcp"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ Or, for local development against this repo:
54
+
55
+ ```json
56
+ {
57
+ "mcpServers": {
58
+ "neuctra-ui": {
59
+ "command": "node",
60
+ "args": ["/absolute/path/to/neuctra-ui-mcp/bin/cli.mjs"]
61
+ }
62
+ }
63
+ }
64
+ ```
65
+
66
+ ## Publishing
67
+
68
+ ```bash
69
+ npm run sync-registry # or rely on prepublishOnly, which does this automatically
70
+ npm publish --access public
71
+ ```
package/bin/cli.mjs ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
+ import { createServer } from "../src/server.mjs";
4
+
5
+ const server = createServer();
6
+ const transport = new StdioServerTransport();
7
+ await server.connect(transport);