@rlx-ui/mcp 0.0.1 → 0.0.3
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/dist/cli.js +620 -63
- package/dist/data/registry.json +1353 -0
- package/dist/package.json +27 -0
- package/package.json +8 -1
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,270 @@
|
|
|
1
|
-
import { McpServer as
|
|
2
|
-
import { StdioServerTransport as
|
|
3
|
-
import { z as
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { McpServer as x } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { StdioServerTransport as C } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
|
+
import { z as a } from "zod";
|
|
4
|
+
import { readFileSync as T } from "fs";
|
|
5
|
+
import { fileURLToPath as L } from "url";
|
|
6
|
+
import { join as m, dirname as R } from "path";
|
|
7
|
+
const S = L(import.meta.url), f = R(S);
|
|
8
|
+
let u = null;
|
|
9
|
+
function l() {
|
|
10
|
+
if (u)
|
|
11
|
+
return u;
|
|
12
|
+
try {
|
|
13
|
+
const o = [
|
|
14
|
+
m(f, "data/registry.json"),
|
|
15
|
+
// From dist/ to dist/data/ (copied during build)
|
|
16
|
+
m(f, "../src/data/registry.json"),
|
|
17
|
+
// From dist/ to src/data/ (development)
|
|
18
|
+
m(f, "../data/registry.json"),
|
|
19
|
+
// Fallback
|
|
20
|
+
m(process.cwd(), "src/data/registry.json"),
|
|
21
|
+
// From package root (published)
|
|
22
|
+
m(process.cwd(), "libs/rlx-ui/mcp/src/data/registry.json")
|
|
23
|
+
// Development
|
|
24
|
+
];
|
|
25
|
+
let s = null;
|
|
26
|
+
for (const n of o)
|
|
27
|
+
try {
|
|
28
|
+
s = T(n, "utf-8");
|
|
29
|
+
break;
|
|
30
|
+
} catch {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
if (!s)
|
|
34
|
+
throw new Error("Could not find registry.json in any expected location");
|
|
35
|
+
return u = JSON.parse(s), u;
|
|
36
|
+
} catch (o) {
|
|
37
|
+
return console.error("Warning: Could not load component registry:", o), u = {
|
|
38
|
+
widgets: [],
|
|
39
|
+
components: [],
|
|
40
|
+
animates: [],
|
|
41
|
+
hooks: [],
|
|
42
|
+
utils: [],
|
|
43
|
+
extractedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
44
|
+
}, u;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function j() {
|
|
48
|
+
return l().widgets;
|
|
49
|
+
}
|
|
50
|
+
function I() {
|
|
51
|
+
return l().components;
|
|
52
|
+
}
|
|
53
|
+
function U() {
|
|
54
|
+
return l().animates;
|
|
55
|
+
}
|
|
56
|
+
function v() {
|
|
57
|
+
return l().hooks;
|
|
58
|
+
}
|
|
59
|
+
function _() {
|
|
60
|
+
return l().utils;
|
|
61
|
+
}
|
|
62
|
+
function d(o, s) {
|
|
63
|
+
const n = l();
|
|
64
|
+
if (s === "widget" || !s) {
|
|
65
|
+
const e = n.widgets.find((t) => t.slug === o);
|
|
66
|
+
if (e) return e;
|
|
67
|
+
}
|
|
68
|
+
if (s === "component" || !s) {
|
|
69
|
+
const e = n.components.find((t) => t.slug === o);
|
|
70
|
+
if (e) return e;
|
|
71
|
+
}
|
|
72
|
+
if (s === "animate" || !s) {
|
|
73
|
+
const e = n.animates.find((t) => t.slug === o);
|
|
74
|
+
if (e) return e;
|
|
75
|
+
}
|
|
76
|
+
if (s === "hook" || !s) {
|
|
77
|
+
const e = n.hooks.find((t) => t.slug === o);
|
|
78
|
+
if (e) return e;
|
|
79
|
+
}
|
|
80
|
+
if (s === "util" || !s) {
|
|
81
|
+
const e = n.utils.find((t) => t.slug === o);
|
|
82
|
+
if (e) return e;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function O(o) {
|
|
86
|
+
const s = l(), n = [
|
|
87
|
+
...s.widgets,
|
|
88
|
+
...s.components,
|
|
89
|
+
...s.animates,
|
|
90
|
+
...s.hooks,
|
|
91
|
+
...s.utils
|
|
92
|
+
], e = o.toLowerCase();
|
|
93
|
+
return n.filter(
|
|
94
|
+
(t) => t.name.toLowerCase().includes(e) || t.slug.toLowerCase().includes(e)
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
function h() {
|
|
98
|
+
return j();
|
|
99
|
+
}
|
|
100
|
+
function y() {
|
|
101
|
+
return I();
|
|
102
|
+
}
|
|
103
|
+
function b() {
|
|
104
|
+
return U();
|
|
105
|
+
}
|
|
106
|
+
function k() {
|
|
107
|
+
return v();
|
|
108
|
+
}
|
|
109
|
+
function w() {
|
|
110
|
+
return _();
|
|
111
|
+
}
|
|
112
|
+
function X(o) {
|
|
113
|
+
return O(o);
|
|
114
|
+
}
|
|
115
|
+
function F(o, s) {
|
|
116
|
+
return d(o, s) || null;
|
|
117
|
+
}
|
|
118
|
+
function N(o, s) {
|
|
119
|
+
const n = d(o, s);
|
|
120
|
+
if (!n)
|
|
121
|
+
return { found: !1 };
|
|
122
|
+
let e, t;
|
|
123
|
+
if (n.sourceCode && typeof n.sourceCode == "string") {
|
|
124
|
+
const r = n.sourceCode;
|
|
125
|
+
if (n.sourceFiles && Object.keys(n.sourceFiles).length > 0) {
|
|
126
|
+
const g = Object.keys(n.sourceFiles).join(", ");
|
|
127
|
+
t = `This component has ${Object.keys(n.sourceFiles).length} related file(s): ${g}. Use get_component_source to get the complete codebase.`;
|
|
128
|
+
}
|
|
129
|
+
const i = r.match(
|
|
130
|
+
/(?:export\s+)?(?:interface|type)\s+(\w+Props?)\s*[=:]\s*\{[\s\S]*?\}/g
|
|
131
|
+
);
|
|
132
|
+
i && i.length > 0 ? e = i[0] : r.trim().startsWith("export") ? t = "Source code contains only export statements. Props definition may be in component file." : (e = r.substring(0, 1e3), t = "Full source code provided. Props interface may be defined in the component file.");
|
|
133
|
+
} else
|
|
134
|
+
t = "Source code not available in registry.";
|
|
135
|
+
return {
|
|
136
|
+
found: !0,
|
|
137
|
+
component: n,
|
|
138
|
+
props: e,
|
|
139
|
+
note: t
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
function $(o, s, n) {
|
|
143
|
+
var r;
|
|
144
|
+
const e = d(o, s);
|
|
145
|
+
if (!e)
|
|
146
|
+
return { found: !1 };
|
|
147
|
+
const t = [];
|
|
148
|
+
if (e.demos && e.demos.forEach((i) => {
|
|
149
|
+
t.push({ name: i.name });
|
|
150
|
+
}), n) {
|
|
151
|
+
const i = (r = e.demos) == null ? void 0 : r.find((g) => g.name === n);
|
|
152
|
+
return i && i.code ? {
|
|
153
|
+
found: !0,
|
|
154
|
+
component: e,
|
|
155
|
+
example: {
|
|
156
|
+
name: i.name,
|
|
157
|
+
code: i.code
|
|
158
|
+
},
|
|
159
|
+
availableDemos: t
|
|
160
|
+
} : {
|
|
161
|
+
found: !0,
|
|
162
|
+
component: e,
|
|
163
|
+
availableDemos: t
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
if (e.demos && e.demos.length > 0) {
|
|
167
|
+
const i = e.demos[0];
|
|
168
|
+
if (i.code)
|
|
169
|
+
return {
|
|
170
|
+
found: !0,
|
|
171
|
+
component: e,
|
|
172
|
+
example: {
|
|
173
|
+
name: i.name,
|
|
174
|
+
code: i.code
|
|
175
|
+
},
|
|
176
|
+
availableDemos: t
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
found: !0,
|
|
181
|
+
component: e,
|
|
182
|
+
availableDemos: t
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
function P(o, s, n = "pnpm") {
|
|
186
|
+
const e = d(o, s);
|
|
187
|
+
if (!e)
|
|
188
|
+
return { found: !1 };
|
|
189
|
+
let t;
|
|
190
|
+
switch (e.category) {
|
|
191
|
+
case "widget":
|
|
192
|
+
t = `@rlx-widgets/${e.slug}`;
|
|
193
|
+
break;
|
|
194
|
+
case "component":
|
|
195
|
+
t = `@rlx-components/${e.slug}`;
|
|
196
|
+
break;
|
|
197
|
+
case "hook":
|
|
198
|
+
t = `@rlx-hooks/${e.slug}`;
|
|
199
|
+
break;
|
|
200
|
+
case "util":
|
|
201
|
+
t = `@rlx-utils/${e.slug}`;
|
|
202
|
+
break;
|
|
203
|
+
case "animate":
|
|
204
|
+
t = `@rlx-animates/${e.slug}`;
|
|
205
|
+
break;
|
|
206
|
+
default:
|
|
207
|
+
return { found: !1 };
|
|
208
|
+
}
|
|
209
|
+
let r;
|
|
210
|
+
switch (n) {
|
|
211
|
+
case "npm":
|
|
212
|
+
r = `npm install ${t}`;
|
|
213
|
+
break;
|
|
214
|
+
case "pnpm":
|
|
215
|
+
r = `pnpm add ${t}`;
|
|
216
|
+
break;
|
|
217
|
+
case "yarn":
|
|
218
|
+
r = `yarn add ${t}`;
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
r = `pnpm add ${t}`;
|
|
222
|
+
}
|
|
223
|
+
return {
|
|
224
|
+
found: !0,
|
|
225
|
+
command: r,
|
|
226
|
+
packageName: t,
|
|
227
|
+
category: e.category
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
function J(o, s) {
|
|
231
|
+
const n = d(o, s);
|
|
232
|
+
return n ? n.sourceCode && typeof n.sourceCode == "string" ? {
|
|
233
|
+
found: !0,
|
|
234
|
+
component: n,
|
|
235
|
+
sourceCode: n.sourceCode,
|
|
236
|
+
sourceFiles: n.sourceFiles || {}
|
|
237
|
+
} : {
|
|
238
|
+
found: !0,
|
|
239
|
+
component: n,
|
|
240
|
+
sourceFiles: n.sourceFiles || {}
|
|
241
|
+
} : { found: !1 };
|
|
242
|
+
}
|
|
243
|
+
function c(o) {
|
|
244
|
+
return {
|
|
245
|
+
content: [
|
|
246
|
+
{
|
|
247
|
+
type: "text",
|
|
248
|
+
text: JSON.stringify(o, null, 2)
|
|
249
|
+
}
|
|
250
|
+
]
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
function M(o, s, n) {
|
|
254
|
+
return c({
|
|
255
|
+
error: o,
|
|
256
|
+
...s && { slug: s },
|
|
257
|
+
...n && { category: n }
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
function p(o, s) {
|
|
261
|
+
return M("Component not found", o, s);
|
|
262
|
+
}
|
|
263
|
+
async function G() {
|
|
264
|
+
const o = new x(
|
|
6
265
|
{
|
|
7
266
|
name: "@rlx-ui/mcp",
|
|
8
|
-
version: "0.0.
|
|
267
|
+
version: "0.0.3"
|
|
9
268
|
},
|
|
10
269
|
{
|
|
11
270
|
capabilities: {
|
|
@@ -14,73 +273,371 @@ async function s() {
|
|
|
14
273
|
}
|
|
15
274
|
}
|
|
16
275
|
);
|
|
17
|
-
|
|
18
|
-
"
|
|
276
|
+
o.registerTool(
|
|
277
|
+
"list_widgets",
|
|
278
|
+
{
|
|
279
|
+
description: "List all available widgets in the RLX UI library"
|
|
280
|
+
},
|
|
281
|
+
async () => {
|
|
282
|
+
const n = h();
|
|
283
|
+
return c({
|
|
284
|
+
count: n.length,
|
|
285
|
+
widgets: n.map((e) => {
|
|
286
|
+
var t;
|
|
287
|
+
return {
|
|
288
|
+
name: e.name,
|
|
289
|
+
slug: e.slug,
|
|
290
|
+
demosCount: ((t = e.demos) == null ? void 0 : t.length) ?? 0
|
|
291
|
+
};
|
|
292
|
+
})
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
), o.registerTool(
|
|
296
|
+
"list_components",
|
|
297
|
+
{
|
|
298
|
+
description: "List all available components in the RLX UI library"
|
|
299
|
+
},
|
|
300
|
+
async () => {
|
|
301
|
+
const n = y();
|
|
302
|
+
return c({
|
|
303
|
+
count: n.length,
|
|
304
|
+
components: n.map((e) => {
|
|
305
|
+
var t;
|
|
306
|
+
return {
|
|
307
|
+
name: e.name,
|
|
308
|
+
slug: e.slug,
|
|
309
|
+
demosCount: ((t = e.demos) == null ? void 0 : t.length) ?? 0
|
|
310
|
+
};
|
|
311
|
+
})
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
), o.registerTool(
|
|
315
|
+
"list_animates",
|
|
316
|
+
{
|
|
317
|
+
description: "List all available animations in the RLX UI library"
|
|
318
|
+
},
|
|
319
|
+
async () => {
|
|
320
|
+
const n = b();
|
|
321
|
+
return c({
|
|
322
|
+
count: n.length,
|
|
323
|
+
animates: n.map((e) => {
|
|
324
|
+
var t;
|
|
325
|
+
return {
|
|
326
|
+
name: e.name,
|
|
327
|
+
slug: e.slug,
|
|
328
|
+
demosCount: ((t = e.demos) == null ? void 0 : t.length) ?? 0
|
|
329
|
+
};
|
|
330
|
+
})
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
), o.registerTool(
|
|
334
|
+
"list_hooks",
|
|
335
|
+
{
|
|
336
|
+
description: "List all available React hooks in the RLX UI library"
|
|
337
|
+
},
|
|
338
|
+
async () => {
|
|
339
|
+
const n = k();
|
|
340
|
+
return c({
|
|
341
|
+
count: n.length,
|
|
342
|
+
hooks: n.map((e) => {
|
|
343
|
+
var t;
|
|
344
|
+
return {
|
|
345
|
+
name: e.name,
|
|
346
|
+
slug: e.slug,
|
|
347
|
+
demosCount: ((t = e.demos) == null ? void 0 : t.length) ?? 0
|
|
348
|
+
};
|
|
349
|
+
})
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
), o.registerTool(
|
|
353
|
+
"list_utils",
|
|
354
|
+
{
|
|
355
|
+
description: "List all available utility functions in the RLX UI library"
|
|
356
|
+
},
|
|
357
|
+
async () => {
|
|
358
|
+
const n = w();
|
|
359
|
+
return c({
|
|
360
|
+
count: n.length,
|
|
361
|
+
utils: n.map((e) => {
|
|
362
|
+
var t;
|
|
363
|
+
return {
|
|
364
|
+
name: e.name,
|
|
365
|
+
slug: e.slug,
|
|
366
|
+
demosCount: ((t = e.demos) == null ? void 0 : t.length) ?? 0
|
|
367
|
+
};
|
|
368
|
+
})
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
), o.registerTool(
|
|
372
|
+
"search_component",
|
|
373
|
+
{
|
|
374
|
+
description: "Search for components, widgets, hooks, utils, or animates by name or slug",
|
|
375
|
+
inputSchema: {
|
|
376
|
+
query: a.string().describe("Search query to find components")
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
async (n) => {
|
|
380
|
+
const e = X(n.query);
|
|
381
|
+
return c({
|
|
382
|
+
query: n.query,
|
|
383
|
+
count: e.length,
|
|
384
|
+
results: e.map((t) => ({
|
|
385
|
+
name: t.name,
|
|
386
|
+
slug: t.slug,
|
|
387
|
+
category: t.category
|
|
388
|
+
}))
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
), o.registerTool(
|
|
392
|
+
"get_component_info",
|
|
393
|
+
{
|
|
394
|
+
description: "Get detailed information about a specific component, widget, hook, util, or animate",
|
|
395
|
+
inputSchema: {
|
|
396
|
+
slug: a.string().describe("The slug/name of the component (e.g., 'button', 'use-copy-to-clipboard')"),
|
|
397
|
+
category: a.enum(["widget", "component", "hook", "util", "animate"]).optional().describe("Optional category to narrow the search")
|
|
398
|
+
}
|
|
399
|
+
},
|
|
400
|
+
async (n) => {
|
|
401
|
+
var t, r;
|
|
402
|
+
const e = F(n.slug, n.category);
|
|
403
|
+
return e ? c({
|
|
404
|
+
name: e.name,
|
|
405
|
+
slug: e.slug,
|
|
406
|
+
category: e.category,
|
|
407
|
+
hasSourceCode: !!e.sourceCode && typeof e.sourceCode == "string",
|
|
408
|
+
demosCount: ((t = e.demos) == null ? void 0 : t.length) ?? 0,
|
|
409
|
+
demos: (r = e.demos) == null ? void 0 : r.map((i) => ({
|
|
410
|
+
name: i.name,
|
|
411
|
+
hasCode: !!i.code
|
|
412
|
+
}))
|
|
413
|
+
}) : p(n.slug, n.category);
|
|
414
|
+
}
|
|
415
|
+
), o.registerTool(
|
|
416
|
+
"get_component_props",
|
|
417
|
+
{
|
|
418
|
+
description: "Get TypeScript props/interface definition for a component",
|
|
419
|
+
inputSchema: {
|
|
420
|
+
slug: a.string().describe("The slug/name of the component"),
|
|
421
|
+
category: a.enum(["widget", "component", "hook", "util", "animate"]).optional().describe("Optional category to narrow the search")
|
|
422
|
+
}
|
|
423
|
+
},
|
|
424
|
+
async (n) => {
|
|
425
|
+
var t, r, i;
|
|
426
|
+
const e = N(n.slug, n.category);
|
|
427
|
+
return e.found ? c({
|
|
428
|
+
component: {
|
|
429
|
+
name: (t = e.component) == null ? void 0 : t.name,
|
|
430
|
+
slug: (r = e.component) == null ? void 0 : r.slug,
|
|
431
|
+
category: (i = e.component) == null ? void 0 : i.category
|
|
432
|
+
},
|
|
433
|
+
props: e.props,
|
|
434
|
+
note: e.note
|
|
435
|
+
}) : p(n.slug, n.category);
|
|
436
|
+
}
|
|
437
|
+
), o.registerTool(
|
|
438
|
+
"get_component_example",
|
|
439
|
+
{
|
|
440
|
+
description: "Get code examples (demos) for a component",
|
|
441
|
+
inputSchema: {
|
|
442
|
+
slug: a.string().describe("The slug/name of the component"),
|
|
443
|
+
category: a.enum(["widget", "component", "hook", "util", "animate"]).optional().describe("Optional category to narrow the search"),
|
|
444
|
+
exampleName: a.string().optional().describe("Optional specific example/variant name. If not provided, returns the first available example.")
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
async (n) => {
|
|
448
|
+
var t, r, i;
|
|
449
|
+
const e = $(n.slug, n.category, n.exampleName);
|
|
450
|
+
return e.found ? c({
|
|
451
|
+
component: {
|
|
452
|
+
name: (t = e.component) == null ? void 0 : t.name,
|
|
453
|
+
slug: (r = e.component) == null ? void 0 : r.slug,
|
|
454
|
+
category: (i = e.component) == null ? void 0 : i.category
|
|
455
|
+
},
|
|
456
|
+
example: e.example,
|
|
457
|
+
availableDemos: e.availableDemos
|
|
458
|
+
}) : p(n.slug, n.category);
|
|
459
|
+
}
|
|
460
|
+
), o.registerTool(
|
|
461
|
+
"get_component_source",
|
|
462
|
+
{
|
|
463
|
+
description: "Get the complete source code for a component, including main file and all related files (utils, types, etc.)",
|
|
464
|
+
inputSchema: {
|
|
465
|
+
slug: a.string().describe("The slug/name of the component"),
|
|
466
|
+
category: a.enum(["widget", "component", "hook", "util", "animate"]).optional().describe("Optional category to narrow the search")
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
async (n) => {
|
|
470
|
+
var t, r, i;
|
|
471
|
+
const e = J(n.slug, n.category);
|
|
472
|
+
return e.found ? c({
|
|
473
|
+
component: {
|
|
474
|
+
name: (t = e.component) == null ? void 0 : t.name,
|
|
475
|
+
slug: (r = e.component) == null ? void 0 : r.slug,
|
|
476
|
+
category: (i = e.component) == null ? void 0 : i.category
|
|
477
|
+
},
|
|
478
|
+
sourceCode: e.sourceCode,
|
|
479
|
+
sourceFiles: e.sourceFiles,
|
|
480
|
+
note: e.sourceFiles && Object.keys(e.sourceFiles).length > 0 ? `This component has ${Object.keys(e.sourceFiles).length} related file(s). The main file is in sourceCode, and related files (utils, types, etc.) are in sourceFiles with relative paths as keys.` : "This component has no related files."
|
|
481
|
+
}) : p(n.slug, n.category);
|
|
482
|
+
}
|
|
483
|
+
), o.registerTool(
|
|
484
|
+
"get_installation_command",
|
|
19
485
|
{
|
|
20
|
-
description: "
|
|
486
|
+
description: "Get npm/pnpm/yarn installation command for a component",
|
|
21
487
|
inputSchema: {
|
|
22
|
-
|
|
488
|
+
slug: a.string().describe("The slug/name of the component"),
|
|
489
|
+
category: a.enum(["widget", "component", "hook", "util", "animate"]).optional().describe("Optional category to narrow the search"),
|
|
490
|
+
packageManager: a.enum(["npm", "pnpm", "yarn"]).optional().default("pnpm").describe("Package manager to use (default: pnpm)")
|
|
23
491
|
}
|
|
24
492
|
},
|
|
25
|
-
async (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
493
|
+
async (n) => {
|
|
494
|
+
const e = P(
|
|
495
|
+
n.slug,
|
|
496
|
+
n.category,
|
|
497
|
+
n.packageManager || "pnpm"
|
|
498
|
+
);
|
|
499
|
+
return e.found ? c({
|
|
500
|
+
command: e.command,
|
|
501
|
+
packageName: e.packageName,
|
|
502
|
+
category: e.category,
|
|
503
|
+
packageManager: n.packageManager || "pnpm"
|
|
504
|
+
}) : p(n.slug, n.category);
|
|
505
|
+
}
|
|
506
|
+
), o.registerResource(
|
|
507
|
+
"RLX UI Widgets",
|
|
508
|
+
"rlx-ui://widgets",
|
|
509
|
+
{
|
|
510
|
+
description: "List of all widgets in the RLX UI library",
|
|
511
|
+
mimeType: "application/json"
|
|
512
|
+
},
|
|
513
|
+
async () => {
|
|
514
|
+
const n = h();
|
|
515
|
+
return {
|
|
516
|
+
contents: [
|
|
517
|
+
{
|
|
518
|
+
uri: "rlx-ui://widgets",
|
|
519
|
+
mimeType: "application/json",
|
|
520
|
+
text: JSON.stringify(n, null, 2)
|
|
521
|
+
}
|
|
522
|
+
]
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
), o.registerResource(
|
|
526
|
+
"RLX UI Components",
|
|
527
|
+
"rlx-ui://components",
|
|
528
|
+
{
|
|
529
|
+
description: "List of all components in the RLX UI library",
|
|
530
|
+
mimeType: "application/json"
|
|
531
|
+
},
|
|
532
|
+
async () => {
|
|
533
|
+
const n = y();
|
|
534
|
+
return {
|
|
535
|
+
contents: [
|
|
536
|
+
{
|
|
537
|
+
uri: "rlx-ui://components",
|
|
538
|
+
mimeType: "application/json",
|
|
539
|
+
text: JSON.stringify(n, null, 2)
|
|
540
|
+
}
|
|
541
|
+
]
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
), o.registerResource(
|
|
545
|
+
"RLX UI Animates",
|
|
546
|
+
"rlx-ui://animates",
|
|
547
|
+
{
|
|
548
|
+
description: "List of all animations in the RLX UI library",
|
|
549
|
+
mimeType: "application/json"
|
|
550
|
+
},
|
|
551
|
+
async () => {
|
|
552
|
+
const n = b();
|
|
553
|
+
return {
|
|
554
|
+
contents: [
|
|
555
|
+
{
|
|
556
|
+
uri: "rlx-ui://animates",
|
|
557
|
+
mimeType: "application/json",
|
|
558
|
+
text: JSON.stringify(n, null, 2)
|
|
559
|
+
}
|
|
560
|
+
]
|
|
561
|
+
};
|
|
562
|
+
}
|
|
563
|
+
), o.registerResource(
|
|
564
|
+
"RLX UI Hooks",
|
|
565
|
+
"rlx-ui://hooks",
|
|
566
|
+
{
|
|
567
|
+
description: "List of all React hooks in the RLX UI library",
|
|
568
|
+
mimeType: "application/json"
|
|
569
|
+
},
|
|
570
|
+
async () => {
|
|
571
|
+
const n = k();
|
|
572
|
+
return {
|
|
573
|
+
contents: [
|
|
574
|
+
{
|
|
575
|
+
uri: "rlx-ui://hooks",
|
|
576
|
+
mimeType: "application/json",
|
|
577
|
+
text: JSON.stringify(n, null, 2)
|
|
578
|
+
}
|
|
579
|
+
]
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
), o.registerResource(
|
|
583
|
+
"RLX UI Utils",
|
|
584
|
+
"rlx-ui://utils",
|
|
585
|
+
{
|
|
586
|
+
description: "List of all utility functions in the RLX UI library",
|
|
587
|
+
mimeType: "application/json"
|
|
588
|
+
},
|
|
589
|
+
async () => {
|
|
590
|
+
const n = w();
|
|
591
|
+
return {
|
|
592
|
+
contents: [
|
|
593
|
+
{
|
|
594
|
+
uri: "rlx-ui://utils",
|
|
595
|
+
mimeType: "application/json",
|
|
596
|
+
text: JSON.stringify(n, null, 2)
|
|
597
|
+
}
|
|
598
|
+
]
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
), o.registerResource(
|
|
56
602
|
"RLX UI Information",
|
|
57
603
|
"rlx-ui://info",
|
|
58
604
|
{
|
|
59
605
|
description: "General information about RLX UI",
|
|
60
606
|
mimeType: "application/json"
|
|
61
607
|
},
|
|
62
|
-
async () =>
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
608
|
+
async () => {
|
|
609
|
+
const n = h(), e = y(), t = b(), r = k(), i = w();
|
|
610
|
+
return {
|
|
611
|
+
contents: [
|
|
612
|
+
{
|
|
613
|
+
uri: "rlx-ui://info",
|
|
614
|
+
mimeType: "application/json",
|
|
615
|
+
text: JSON.stringify(
|
|
616
|
+
{
|
|
617
|
+
name: "RLX UI",
|
|
618
|
+
description: "A comprehensive UI component library",
|
|
619
|
+
version: "0.0.3",
|
|
620
|
+
mcpServer: "@rlx-ui/mcp",
|
|
621
|
+
stats: {
|
|
622
|
+
widgets: n.length,
|
|
623
|
+
components: e.length,
|
|
624
|
+
animates: t.length,
|
|
625
|
+
hooks: r.length,
|
|
626
|
+
utils: i.length,
|
|
627
|
+
total: n.length + e.length + t.length + r.length + i.length
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
null,
|
|
631
|
+
2
|
|
632
|
+
)
|
|
633
|
+
}
|
|
634
|
+
]
|
|
635
|
+
};
|
|
636
|
+
}
|
|
80
637
|
);
|
|
81
|
-
const
|
|
82
|
-
await
|
|
638
|
+
const s = new C();
|
|
639
|
+
await o.connect(s), console.error("RLX UI MCP Server running on stdio");
|
|
83
640
|
}
|
|
84
|
-
|
|
85
|
-
console.error("Fatal error in main():",
|
|
641
|
+
G().catch((o) => {
|
|
642
|
+
console.error("Fatal error in main():", o), process.exit(1);
|
|
86
643
|
});
|