@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 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 (defines 5 MCP tools over that data)
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). Served by `get_seo_guide`; the logic behind `generate_page_seo` and
80
- `audit_page_seo` lives in `src/seo.mjs`.
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 5 tool definitions below, and adds them to the AI's available
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. **`get_design_rules`** — call this first, before picking any component. It returns
111
- the styling rules, the anti-AI-look rules, and the 63-section product/UX guide. This
112
- shapes *what* to build (hierarchy, when a group actually needs `Card`, when `Modal`
113
- vs `Drawer`, etc.) before you start reaching for components.
114
- 2. **`get_theme`** — call alongside step 1, not instead of it. Tokens without the design
115
- rules just tell you which colors exist, not how to use them well.
116
- 3. **`list_components`** (filtered by category) or **`search_components`** (keyword) —
117
- confirm which real components exist for what you need. This matters specifically
118
- because the design guide can describe a *pattern* (e.g. a sidebar nav item) without
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
- ## 5. The eight tools, in detail
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
- ### `list_components`
135
+ ---
143
136
 
144
- Lists every exported component, optionally filtered to one category. Cheap and compact
145
- (no props) — meant for browsing, not for writing code against.
137
+ ## 5. The six tools, in detail
146
138
 
147
- **Input:** `{ category?: "layout" | "typography" | "form" | "actions" | "data-display" | "feedback" | "overlay" | "navigation" }`
139
+ ### `neuctra-ui-page-builder`
148
140
 
149
- **Example call → response:**
150
- ```jsonc
151
- // list_components({ category: "form" })
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
- ### `get_component`
146
+ **Input:** `{ request: string, pageType?: "auto" | layout id, framework?: "auto" | framework id, preferences?: { visualDirection?, density?, primaryAction?, platform?, audience? } }`
161
147
 
162
- The main tool. Full spec for exactly one component — every prop's name, TypeScript
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
- "name": "Button",
175
- "category": "actions",
176
- "description": "The Button component is a flexible, highly customizable UI primitive...",
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
- If the name doesn't match, it doesn't just fail — it returns an error result with
189
- substring-matched suggestions (e.g. asking for `"Inpu"` suggests `"Input"`), so the AI
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
- ### `search_components`
159
+ ### `get-neuctra-ui-component`
193
160
 
194
- For when the AI knows what it needs but not the exact name — "date picker", "loading
195
- state", "icon button". Matches against name, category, description, and prop names.
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
- **Example:**
198
- ```jsonc
199
- // search_components({ query: "date" })
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
- ### `get_theme`
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 `get_theme`, an AI would happily write `className="bg-blue-500"`, ignoring the
213
- consumer's actual theme. `get_theme` does **not** carry the design/anti-AI-look rules —
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
- Call this before generating any UI — see the recommended workflow above.
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
- ### `get_seo_guide`
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
- ### `audit_page_seo`
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
- Rule-based check of one page. The easiest input is the page's built HTML (`html`, from
318
- view-source or the `out/` / `dist/` folder): title, description, canonical, headings,
319
- og:image, JSON-LD types, alt text and word count are extracted from it. Explicit fields
320
- override the extracted ones, and checks without input are skipped. It catches doubled or
321
- missing brand suffixes (with `brandName`), duplicate schema nodes, JSON-LD that doesn't
322
- parse, and pages that render client-only (no H1 in the HTML). Returns a 0–100 score and a sorted
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 # defines the 8 tools and their handlers
424
- │ └── seo.mjs # pure builders behind generate_page_seo / audit_page_seo
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
- │ └── seoGuide.json # hand-curated SEO / AEO / GEO playbook
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
 
@@ -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.9",
5
- "generatedAt": "2026-09-27T15:08:02.263Z",
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."