@ncds/ui-admin-mcp 1.0.0-alpha.2 → 1.0.0-alpha.4
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.
|
@@ -38,7 +38,8 @@ You are an agent that builds UI using NCUA (NCDS UI Admin) design system compone
|
|
|
38
38
|
|
|
39
39
|
### Step 3: HTML Generation
|
|
40
40
|
|
|
41
|
-
-
|
|
41
|
+
- When building a page with multiple components, use **render_to_html_batch** to render them all in one call (max 30). This is much more efficient than calling render_to_html repeatedly.
|
|
42
|
+
- For a single component, use **render_to_html**.
|
|
42
43
|
- Use the returned html as-is. Do NOT modify class names, structure, or attributes.
|
|
43
44
|
|
|
44
45
|
### Step 4: CDN Inclusion
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
"You MUST generate component HTML using the render_to_html tool. Never write HTML/CSS manually.",
|
|
4
4
|
"Use the HTML returned by render_to_html as-is. Do NOT modify class names, structure, or attributes.",
|
|
5
5
|
"Use search_component to find the right component by Korean/English keywords before building any UI.",
|
|
6
|
-
"Use list_components to browse available components by category and choose the appropriate one."
|
|
6
|
+
"Use list_components to browse available components by category and choose the appropriate one.",
|
|
7
|
+
"When building a page with multiple components, use render_to_html_batch to render them all in one call instead of calling render_to_html repeatedly."
|
|
7
8
|
],
|
|
8
9
|
"componentSelection": [
|
|
9
10
|
"For password fields, you MUST use password-input. The input component is for plain text only.",
|
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
"render_to_html": {
|
|
25
25
|
"description": "Generate exact HTML for an NCUA component with given props. Returns html, appliedProps, defaultsUsed, js, cdn."
|
|
26
26
|
},
|
|
27
|
+
"render_to_html_batch": {
|
|
28
|
+
"description": "Render multiple NCUA components in a single call (max 30). Pass an array of {name, props} objects. Returns an array of render results. Use this instead of calling render_to_html repeatedly when building a page."
|
|
29
|
+
},
|
|
27
30
|
"get_design_tokens": {
|
|
28
31
|
"description": "Get available design tokens (CSS variables) for colors, typography, spacing, and shadows. Use when building custom areas to pick real tokens instead of guessing."
|
|
29
32
|
}
|
|
@@ -37,6 +40,7 @@
|
|
|
37
40
|
{ "tool": "get_component_props", "description": "Get component props spec" },
|
|
38
41
|
{ "tool": "validate_html", "description": "Validate HTML BEM classes + design system compliance score + auto-fix" },
|
|
39
42
|
{ "tool": "render_to_html", "description": "Props-based dynamic HTML rendering" },
|
|
43
|
+
{ "tool": "render_to_html_batch", "description": "Batch render multiple components in one call (max 30)" },
|
|
40
44
|
{ "tool": "get_design_tokens", "description": "Design token (CSS variable) lookup by category" }
|
|
41
45
|
]
|
|
42
46
|
}
|
package/bin/server.js
CHANGED
|
@@ -23,6 +23,7 @@ const ping_js_1 = require("./tools/ping.js");
|
|
|
23
23
|
const listIcons_js_1 = require("./tools/listIcons.js");
|
|
24
24
|
const searchIcon_js_1 = require("./tools/searchIcon.js");
|
|
25
25
|
const renderToHtml_js_1 = require("./tools/renderToHtml.js");
|
|
26
|
+
const response_js_1 = require("./utils/response.js");
|
|
26
27
|
const getDesignTokens_js_1 = require("./tools/getDesignTokens.js");
|
|
27
28
|
const version_js_1 = require("./version.js");
|
|
28
29
|
const domEnvironment_js_1 = require("./utils/domEnvironment.js");
|
|
@@ -145,6 +146,34 @@ const main = async () => {
|
|
|
145
146
|
name,
|
|
146
147
|
props: props,
|
|
147
148
|
}));
|
|
149
|
+
server.registerTool('render_to_html_batch', {
|
|
150
|
+
description: descriptions['render_to_html_batch'],
|
|
151
|
+
inputSchema: {
|
|
152
|
+
components: zod_1.z
|
|
153
|
+
.array(zod_1.z.object({
|
|
154
|
+
name: zod_1.z.string().min(1).describe('Component name'),
|
|
155
|
+
props: zod_1.z.record(zod_1.z.string(), zod_1.z.unknown()).optional().describe('Component props'),
|
|
156
|
+
}))
|
|
157
|
+
.min(1)
|
|
158
|
+
.max(30)
|
|
159
|
+
.describe('Array of components to render (max 30)'),
|
|
160
|
+
},
|
|
161
|
+
}, ({ components }) => {
|
|
162
|
+
const results = components.map(({ name, props }) => (0, renderToHtml_js_1.renderToHtml)({
|
|
163
|
+
componentMap,
|
|
164
|
+
bundle,
|
|
165
|
+
cdnMeta,
|
|
166
|
+
iconMeta,
|
|
167
|
+
reactRuntime,
|
|
168
|
+
name,
|
|
169
|
+
props: props,
|
|
170
|
+
}));
|
|
171
|
+
const parsed = results.map((r) => {
|
|
172
|
+
const text = r.content[0].text;
|
|
173
|
+
return r.isError ? { error: JSON.parse(text) } : JSON.parse(text);
|
|
174
|
+
});
|
|
175
|
+
return (0, response_js_1.successResponse)(parsed);
|
|
176
|
+
});
|
|
148
177
|
server.registerTool('get_design_tokens', {
|
|
149
178
|
description: descriptions['get_design_tokens'],
|
|
150
179
|
inputSchema: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncds/ui-admin-mcp",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.4",
|
|
4
4
|
"description": "NCDS UI Admin MCP 서버 — AI 에이전트가 NCUA 컴포넌트를 조회하고 HTML을 검증할 수 있는 MCP 서버",
|
|
5
5
|
"bin": {
|
|
6
6
|
"ncua-mcp": "./bin/server.mjs"
|
|
@@ -41,28 +41,12 @@
|
|
|
41
41
|
"node-html-parser": "^7.1.0",
|
|
42
42
|
"react": "^18.2.0",
|
|
43
43
|
"react-dom": "^18.2.0",
|
|
44
|
-
"zod": "^4.3.6"
|
|
45
|
-
},
|
|
46
|
-
"peerDependencies": {
|
|
44
|
+
"zod": "^4.3.6",
|
|
47
45
|
"flatpickr": ">=4.6.0",
|
|
48
46
|
"lodash-es": ">=4.17.0",
|
|
49
47
|
"moment": ">=2.30.0",
|
|
50
48
|
"swiper": ">=11.0.0"
|
|
51
49
|
},
|
|
52
|
-
"peerDependenciesMeta": {
|
|
53
|
-
"flatpickr": {
|
|
54
|
-
"optional": true
|
|
55
|
-
},
|
|
56
|
-
"lodash-es": {
|
|
57
|
-
"optional": true
|
|
58
|
-
},
|
|
59
|
-
"moment": {
|
|
60
|
-
"optional": true
|
|
61
|
-
},
|
|
62
|
-
"swiper": {
|
|
63
|
-
"optional": true
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
50
|
"devDependencies": {
|
|
67
51
|
"@types/node": "^25.5.0",
|
|
68
52
|
"@types/react": "^18.3.20",
|