@neuctra/ui-mcp 0.4.3 → 0.4.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 +73 -135
- package/data/components.json +4 -4
- package/data/layouts.json +790 -0
- package/data/seoGuide.json +100 -6
- package/data/theme.json +1 -1
- package/package.json +1 -1
- package/src/load-data.mjs +20 -0
- package/src/seo.mjs +3 -3
- package/src/server.mjs +19 -325
- package/src/tools/get-design-rules/index.mjs +42 -0
- package/src/tools/get-neuctra-ui-component/index.mjs +160 -0
- package/src/tools/neuctra-ui-page-builder/index.mjs +157 -0
- package/src/tools/neuctra-ui-seo-setup/index.mjs +62 -0
- package/src/tools/neuctra-ui-setup/index.mjs +114 -0
- package/src/tools/neuctra-ui-setup/register.mjs +28 -0
- package/src/tools/neuctra-ui-theme-setup/index.mjs +17 -0
package/README.md
CHANGED
|
@@ -47,7 +47,9 @@ neuctra-ui-mcp/data/components.json (this package's local copy)
|
|
|
47
47
|
│
|
|
48
48
|
│ read once at server startup
|
|
49
49
|
▼
|
|
50
|
-
neuctra-ui-mcp/src/server.mjs (
|
|
50
|
+
neuctra-ui-mcp/src/server.mjs (loads data and composes tool modules)
|
|
51
|
+
│
|
|
52
|
+
└── neuctra-ui-mcp/src/tools/*/ (one folder per MCP tool)
|
|
51
53
|
│
|
|
52
54
|
│ spoken over stdio (stdin/stdout), JSON-RPC under the hood
|
|
53
55
|
▼
|
|
@@ -76,8 +78,10 @@ Three independently-regenerable files feed the server:
|
|
|
76
78
|
engine and generative engine optimisation, schema weaving, FAQs, the per-page meta
|
|
77
79
|
checklist, where metadata goes in each framework plus Next.js metadata gotchas, page
|
|
78
80
|
templates for tool/category/home pages, site-wide essentials, ads readiness, off-page
|
|
79
|
-
and monitoring, and a launch checklist).
|
|
80
|
-
|
|
81
|
+
and monitoring, and a launch checklist). The `neuctra-ui-seo-setup` tool returns the
|
|
82
|
+
complete rules plus framework-specific implementation steps.
|
|
83
|
+
- **`data/layouts.json`** — editable page-layout recipes consumed by
|
|
84
|
+
`neuctra-ui-page-builder`. Add a recipe there to support a new page type.
|
|
81
85
|
|
|
82
86
|
---
|
|
83
87
|
|
|
@@ -95,7 +99,7 @@ The host starts your server as a subprocess and talks to it over **stdio** — y
|
|
|
95
99
|
server's stdout carries JSON-RPC messages, not human-readable logs (that's why
|
|
96
100
|
`bin/cli.mjs` prints nothing except protocol traffic; use `console.error`, never
|
|
97
101
|
`console.log`, if you ever add debug output). On connect, the client asks "what tools do
|
|
98
|
-
you have?", gets back the
|
|
102
|
+
you have?", gets back the tool definitions below, and adds them to the AI's available
|
|
99
103
|
actions — the same way the tools listed in *this* conversation's system prompt work.
|
|
100
104
|
From then on, the AI decides on its own when a tool call would help, calls it, and reads
|
|
101
105
|
the result back into its context before continuing.
|
|
@@ -104,113 +108,76 @@ the result back into its context before continuing.
|
|
|
104
108
|
|
|
105
109
|
## 4. Recommended workflow
|
|
106
110
|
|
|
111
|
+
For project initialization, call **`neuctra-ui-setup`** first with `action: "analyze"`.
|
|
112
|
+
It detects Next.js, Vite React, Remix, and React Router, then guides a separate setup
|
|
113
|
+
call. Setup can run the Neuctra UI CLI and install `lucide-react`, or return manual
|
|
114
|
+
instructions. Existing supported projects are kept in place; clearing a populated
|
|
115
|
+
directory requires explicit confirmation. An unspecified framework defaults to Next.js
|
|
116
|
+
App Router with JavaScript, Tailwind, and static export.
|
|
117
|
+
|
|
107
118
|
The tools are designed to be called in roughly this order when generating UI, not
|
|
108
119
|
grabbed ad hoc:
|
|
109
120
|
|
|
110
|
-
1. **`
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
there being a dedicated component for it — don't assume one exists, confirm here.
|
|
120
|
-
4. **`get_component`** — full spec for every component before writing code against it.
|
|
121
|
-
Do this every time you touch a component you haven't already pulled specs for in the
|
|
122
|
-
current conversation, not just once at the start. Never guess prop names from memory.
|
|
123
|
-
5. **Write the UI**, applying the design rules, the tokens, and the exact props from
|
|
124
|
-
step 4.
|
|
125
|
-
6. **Self-check** against the "Final UI Quality Checklist" section (§49, found by
|
|
126
|
-
its `number` field in `productDesignGuide.sections` — not by array index) and
|
|
127
|
-
`antiAiLookRules` from `get_design_rules` before considering the UI
|
|
128
|
-
done — reread them, don't just rely on having read them once at the start.
|
|
129
|
-
|
|
130
|
-
7. **For public pages**, call **`get_seo_guide`** once, then **`generate_page_seo`** for
|
|
131
|
-
each page (meta, OpenGraph and a woven JSON-LD graph in the project's framework) and
|
|
132
|
-
**`audit_page_seo`** to check the finished page.
|
|
133
|
-
|
|
134
|
-
Steps 1–2 only need to happen once per session/task, not once per component — refetching
|
|
135
|
-
`get_theme`/`get_design_rules` for every single component would be wasteful. Step 4 is
|
|
136
|
-
the one that repeats for every new component.
|
|
137
|
-
|
|
138
|
-
---
|
|
121
|
+
1. **`neuctra-ui-page-builder`** — describe the page and its goal. It infers the page type,
|
|
122
|
+
selects a recipe from `data/layouts.json`, and combines matching component specs,
|
|
123
|
+
design rules, and framework-specific SEO guidance.
|
|
124
|
+
2. Resolve any high-impact preferences the builder flags, then implement the returned
|
|
125
|
+
page outline using the exact Neuctra UI imports and props it supplies.
|
|
126
|
+
3. **Self-check** against the returned responsive, accessibility, and visual rules.
|
|
127
|
+
4. For detailed component discovery outside a page plan, use **`get-neuctra-ui-component`**.
|
|
128
|
+
5. For design or SEO reference material, use **`get_design_rules`**,
|
|
129
|
+
**`neuctra-ui-theme-setup`**, or **`neuctra-ui-seo-setup`** as needed.
|
|
139
130
|
|
|
140
|
-
|
|
131
|
+
Call `get_design_rules` for broad design reviews or unresolved edge cases, and `neuctra-ui-theme-setup`
|
|
132
|
+
when the complete token/setup reference is needed. The full guide remains the source of
|
|
133
|
+
truth; `neuctra-ui-page-builder` selects relevant sections for each request.
|
|
141
134
|
|
|
142
|
-
|
|
135
|
+
---
|
|
143
136
|
|
|
144
|
-
|
|
145
|
-
(no props) — meant for browsing, not for writing code against.
|
|
137
|
+
## 5. The six tools, in detail
|
|
146
138
|
|
|
147
|
-
|
|
139
|
+
### `neuctra-ui-page-builder`
|
|
148
140
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
{ "name": "Calendar", "category": "form", "description": "", "propCount": 9 },
|
|
154
|
-
{ "name": "Checkbox", "category": "form", "description": "A flexible checkbox component...", "propCount": 29 },
|
|
155
|
-
{ "name": "DatePicker", "category": "form", "description": "", "propCount": 15 }
|
|
156
|
-
// ...
|
|
157
|
-
]
|
|
158
|
-
```
|
|
141
|
+
Analyzes the request, infers a page type, and selects its layout recipe from
|
|
142
|
+
`data/layouts.json`. It combines the layout outline with matching full component specs,
|
|
143
|
+
relevant Neuctra UI design rules, and SEO rules/implementation steps for the selected
|
|
144
|
+
framework. Recipes can be edited or added to `layouts.json` without changing tool code.
|
|
159
145
|
|
|
160
|
-
|
|
146
|
+
**Input:** `{ request: string, pageType?: "auto" | layout id, framework?: "auto" | framework id, preferences?: { visualDirection?, density?, primaryAction?, platform?, audience? } }`
|
|
161
147
|
|
|
162
|
-
|
|
163
|
-
type, whether it's required, its default value, its JSDoc description if it has one,
|
|
164
|
-
and a real usage snippet. The AI is instructed (via the tool's own description) to call
|
|
165
|
-
this before writing code against any component it hasn't already used in the
|
|
166
|
-
conversation.
|
|
167
|
-
|
|
168
|
-
**Input:** `{ name: string }` — exact component name, e.g. `"Input"`, `"CardHeader"`.
|
|
169
|
-
|
|
170
|
-
**Example call → response** (trimmed):
|
|
171
|
-
```jsonc
|
|
172
|
-
// get_component({ name: "Button" })
|
|
148
|
+
```json
|
|
173
149
|
{
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"props": [
|
|
178
|
-
{ "name": "children", "type": "React.ReactNode", "required": false, "default": null,
|
|
179
|
-
"description": "Optional so icon-only buttons are possible — pair with `aria-label`." },
|
|
180
|
-
{ "name": "loading", "type": "boolean", "required": false, "default": "false", "description": "" },
|
|
181
|
-
{ "name": "variant", "type": "\"default\" | \"outline\" | \"ghost\" | \"secondary\" | \"destructive\" | \"success\" | \"warning\" | \"info\"", "required": false, "default": null, "description": "" }
|
|
182
|
-
// ...
|
|
183
|
-
],
|
|
184
|
-
"example": "import { Button } from '@neuctra/ui';\n\nfunction BasicExample() {\n return (\n <Button onClick={() => console.log('Button clicked')}>\n Click Me\n </Button>\n );\n}"
|
|
150
|
+
"request": "Build an online image compressor with upload, preview, and download steps.",
|
|
151
|
+
"pageType": "auto",
|
|
152
|
+
"framework": "auto"
|
|
185
153
|
}
|
|
186
154
|
```
|
|
187
155
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
can self-correct instead of giving up.
|
|
156
|
+
The result includes page classification and evidence, the chosen section outline,
|
|
157
|
+
component imports/props/examples, relevant design rules, and public-page SEO guidance.
|
|
191
158
|
|
|
192
|
-
### `
|
|
159
|
+
### `get-neuctra-ui-component`
|
|
193
160
|
|
|
194
|
-
|
|
195
|
-
|
|
161
|
+
One component discovery and retrieval tool for the prebuilt `@neuctra/ui` library. Give
|
|
162
|
+
it a natural-language need such as `"responsive container for a page layout"`,
|
|
163
|
+
`"input fields for a signup form"`, `"product image carousel"`, or `"confirmation drawer"`.
|
|
164
|
+
It ranks matching components and returns each exact package import, full prop spec, and
|
|
165
|
+
documented example. Use `componentName` for an exact component, `category` to narrow or
|
|
166
|
+
browse, and `limit` to control how many full specs are returned.
|
|
196
167
|
|
|
197
|
-
**
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
{ "name": "Calendar", ... },
|
|
202
|
-
{ "name": "DatePicker", ... },
|
|
203
|
-
{ "name": "TagInput", ... } // matched because it has an "updatedAt"-style prop, etc.
|
|
204
|
-
]
|
|
168
|
+
**Input:** `{ request?: string, componentName?: string, category?: ComponentCategory, limit?: number }`
|
|
169
|
+
|
|
170
|
+
```json
|
|
171
|
+
{ "request": "responsive carousel for product images", "limit": 3 }
|
|
205
172
|
```
|
|
206
173
|
|
|
207
|
-
### `
|
|
174
|
+
### `neuctra-ui-theme-setup`
|
|
208
175
|
|
|
209
176
|
Returns the semantic color token system: the token list itself, a **setup** block
|
|
210
177
|
pointing the AI at the `@neuctra/ui-cli` `init` command instead of hand-writing token CSS
|
|
211
178
|
or a theme context, and a **toastNote** explaining the standalone `toast()` import.
|
|
212
|
-
Without `
|
|
213
|
-
consumer's actual theme. `
|
|
179
|
+
Without `neuctra-ui-theme-setup`, an AI would happily write `className="bg-blue-500"`, ignoring the
|
|
180
|
+
consumer's actual theme. `neuctra-ui-theme-setup` does **not** carry the design/anti-AI-look rules —
|
|
214
181
|
see `get_design_rules` below for those; call both together, not one instead of the other.
|
|
215
182
|
|
|
216
183
|
**Response shape:**
|
|
@@ -247,7 +214,8 @@ per-component usage guidance (when to reach for `Card` vs plain whitespace, `Mod
|
|
|
247
214
|
`Drawer`, `Table` vs `List`, etc.), spacing/color/border/radius/shadow conventions,
|
|
248
215
|
responsive design, accessibility, interaction design, and a final UI quality checklist.
|
|
249
216
|
|
|
250
|
-
|
|
217
|
+
Use this for full-guide reviews and edge cases. For routine generation, use
|
|
218
|
+
`neuctra-ui-page-builder` to retrieve the layout-specific rules and context.
|
|
251
219
|
|
|
252
220
|
**Response shape (trimmed):**
|
|
253
221
|
```jsonc
|
|
@@ -276,51 +244,20 @@ Call this before generating any UI — see the recommended workflow above.
|
|
|
276
244
|
}
|
|
277
245
|
```
|
|
278
246
|
|
|
279
|
-
### `
|
|
280
|
-
|
|
281
|
-
Returns the SEO / AEO / GEO playbook from `data/seoGuide.json`: the whole guide, or one
|
|
282
|
-
topic via `topic` (`technical`, `performance`, `on-page`, `keywords-intent`, `eeat`,
|
|
283
|
-
`aeo`, `geo`, `schema`, `faq`, `meta-checklist`, `frameworks`, `page-templates`,
|
|
284
|
-
`site-wide`, `ads-readiness`, `off-page-monitoring`, `launch-checklist`).
|
|
285
|
-
|
|
286
|
-
```json
|
|
287
|
-
{ "topic": "geo" }
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
### `generate_page_seo`
|
|
291
|
-
|
|
292
|
-
Deterministic generator (no LLM, never invents facts) for everything one page needs:
|
|
293
|
-
a meta title (60 chars max) and description (155 max), canonical, robots, OpenGraph
|
|
294
|
-
and Twitter tags, and one JSON-LD `@graph` weaving Organization, WebSite, WebPage,
|
|
295
|
-
BreadcrumbList, the page-type node (TechArticle, BlogPosting, SoftwareApplication for
|
|
296
|
-
tool and product pages, Product with offers), HowTo (from the visible `steps`), ItemList
|
|
297
|
-
(from a category's `items`) and FAQPage together by stable `@id`s (the same scheme as
|
|
298
|
-
`neuctra-ui-docs-v2/lib/seo/schemas`). Returns a ready-to-paste snippet for
|
|
299
|
-
`nextjs-app`, `nextjs-pages`, `react-vite`, `react-router`, `astro`, `tanstack-start`,
|
|
300
|
-
`gatsby` or `html`, plus warnings and AEO/GEO follow-ups.
|
|
301
|
-
|
|
302
|
-
```json
|
|
303
|
-
{
|
|
304
|
-
"framework": "nextjs-app",
|
|
305
|
-
"pageType": "docs",
|
|
306
|
-
"siteName": "Neuctra UI",
|
|
307
|
-
"siteUrl": "https://ui.neuctra.com",
|
|
308
|
-
"path": "/docs/card",
|
|
309
|
-
"primaryKeyword": "react card component",
|
|
310
|
-
"description": "Composable React card component with header, body and footer sections...",
|
|
311
|
-
"faqs": [{ "question": "Does Card support dark mode?", "answer": "Yes. ..." }]
|
|
312
|
-
}
|
|
313
|
-
```
|
|
247
|
+
### `neuctra-ui-seo-setup`
|
|
314
248
|
|
|
315
|
-
|
|
249
|
+
Returns the complete SEO/AEO/GEO rules and practical implementation steps from
|
|
250
|
+
`data/seoGuide.json`. The JSON contains two main portions: `seoRules` (the full rules
|
|
251
|
+
covering technical SEO, keywords, titles, descriptions, headings, content, JSON-LD,
|
|
252
|
+
FAQs, performance, trust, and launch checks) and `implementationSteps` (ordered shared
|
|
253
|
+
steps plus framework-specific instructions).
|
|
316
254
|
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
list of `fail` / `warn` / `pass` items, each with the exact fix.
|
|
255
|
+
Pass `framework` as `auto`, `nextjs-app`, `nextjs-pages`, `react-vite`, `react-router`,
|
|
256
|
+
`remix`, or another supported framework. With `auto`, inspect project files and select
|
|
257
|
+
steps that match the detected router and rendering mode. You can pass `projectContext`
|
|
258
|
+
with relevant project configuration when helpful. The tool returns the complete rules
|
|
259
|
+
alongside the applicable framework instructions; it does not emit a one-off metadata
|
|
260
|
+
snippet or accept a page audit payload.
|
|
324
261
|
|
|
325
262
|
---
|
|
326
263
|
|
|
@@ -420,15 +357,16 @@ neuctra-ui-mcp/
|
|
|
420
357
|
├── bin/
|
|
421
358
|
│ └── cli.mjs # entry point: connects the server to a stdio transport
|
|
422
359
|
├── src/
|
|
423
|
-
│ ├── server.mjs #
|
|
424
|
-
│ └── seo.mjs # pure builders
|
|
360
|
+
│ ├── server.mjs # registers the MCP tool modules
|
|
361
|
+
│ └── seo.mjs # pure SEO builders used by neuctra-ui-seo-setup
|
|
425
362
|
├── scripts/
|
|
426
363
|
│ └── sync-registry.mjs # copies registry/components.json from neuctra-ui-package
|
|
427
364
|
├── data/
|
|
428
365
|
│ ├── components.json # synced (generated) — don't edit by hand
|
|
429
366
|
│ ├── theme.json # hand-curated token + styling/anti-AI-look rules
|
|
430
367
|
│ ├── aiDesignRules.json # hand-curated 63-section product/UX design guide
|
|
431
|
-
│
|
|
368
|
+
│ ├── seoGuide.json # SEO / AEO / GEO rules and implementation steps
|
|
369
|
+
│ └── layouts.json # editable page layout recipes
|
|
432
370
|
└── package.json
|
|
433
371
|
```
|
|
434
372
|
|
package/data/components.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema#",
|
|
3
3
|
"package": "@neuctra/ui",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "1.0.14",
|
|
5
|
+
"generatedAt": "2026-10-07T06:01:15.313Z",
|
|
6
6
|
"componentCount": 79,
|
|
7
7
|
"components": [
|
|
8
8
|
{
|
|
@@ -3111,7 +3111,7 @@
|
|
|
3111
3111
|
},
|
|
3112
3112
|
{
|
|
3113
3113
|
"name": "size",
|
|
3114
|
-
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
3114
|
+
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
|
|
3115
3115
|
"required": false,
|
|
3116
3116
|
"default": null,
|
|
3117
3117
|
"description": "Size variant controlling padding, font size and icon sizing."
|
|
@@ -5315,7 +5315,7 @@
|
|
|
5315
5315
|
},
|
|
5316
5316
|
{
|
|
5317
5317
|
"name": "size",
|
|
5318
|
-
"type": "\"sm\" | \"md\" | \"lg\"",
|
|
5318
|
+
"type": "\"xs\" | \"sm\" | \"md\" | \"lg\"",
|
|
5319
5319
|
"required": false,
|
|
5320
5320
|
"default": null,
|
|
5321
5321
|
"description": "Size variant controlling trigger/item padding and icon sizing."
|