@idealyst/mcp-server 1.0.84

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.
Files changed (211) hide show
  1. package/README.md +202 -0
  2. package/dist/data/cli-commands.d.ts +2 -0
  3. package/dist/data/cli-commands.d.ts.map +1 -0
  4. package/dist/data/cli-commands.js +100 -0
  5. package/dist/data/cli-commands.js.map +1 -0
  6. package/dist/data/components/Accordion.d.ts +15 -0
  7. package/dist/data/components/Accordion.d.ts.map +1 -0
  8. package/dist/data/components/Accordion.js +112 -0
  9. package/dist/data/components/Accordion.js.map +1 -0
  10. package/dist/data/components/ActivityIndicator.d.ts +15 -0
  11. package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
  12. package/dist/data/components/ActivityIndicator.js +82 -0
  13. package/dist/data/components/ActivityIndicator.js.map +1 -0
  14. package/dist/data/components/Alert.d.ts +15 -0
  15. package/dist/data/components/Alert.d.ts.map +1 -0
  16. package/dist/data/components/Alert.js +132 -0
  17. package/dist/data/components/Alert.js.map +1 -0
  18. package/dist/data/components/Avatar.d.ts +15 -0
  19. package/dist/data/components/Avatar.d.ts.map +1 -0
  20. package/dist/data/components/Avatar.js +93 -0
  21. package/dist/data/components/Avatar.js.map +1 -0
  22. package/dist/data/components/Badge.d.ts +15 -0
  23. package/dist/data/components/Badge.d.ts.map +1 -0
  24. package/dist/data/components/Badge.js +64 -0
  25. package/dist/data/components/Badge.js.map +1 -0
  26. package/dist/data/components/Breadcrumb.d.ts +15 -0
  27. package/dist/data/components/Breadcrumb.d.ts.map +1 -0
  28. package/dist/data/components/Breadcrumb.js +96 -0
  29. package/dist/data/components/Breadcrumb.js.map +1 -0
  30. package/dist/data/components/Button.d.ts +15 -0
  31. package/dist/data/components/Button.d.ts.map +1 -0
  32. package/dist/data/components/Button.js +87 -0
  33. package/dist/data/components/Button.js.map +1 -0
  34. package/dist/data/components/Card.d.ts +15 -0
  35. package/dist/data/components/Card.d.ts.map +1 -0
  36. package/dist/data/components/Card.js +67 -0
  37. package/dist/data/components/Card.js.map +1 -0
  38. package/dist/data/components/Checkbox.d.ts +15 -0
  39. package/dist/data/components/Checkbox.d.ts.map +1 -0
  40. package/dist/data/components/Checkbox.js +118 -0
  41. package/dist/data/components/Checkbox.js.map +1 -0
  42. package/dist/data/components/Chip.d.ts +15 -0
  43. package/dist/data/components/Chip.d.ts.map +1 -0
  44. package/dist/data/components/Chip.js +76 -0
  45. package/dist/data/components/Chip.js.map +1 -0
  46. package/dist/data/components/Dialog.d.ts +15 -0
  47. package/dist/data/components/Dialog.d.ts.map +1 -0
  48. package/dist/data/components/Dialog.js +137 -0
  49. package/dist/data/components/Dialog.js.map +1 -0
  50. package/dist/data/components/Divider.d.ts +15 -0
  51. package/dist/data/components/Divider.d.ts.map +1 -0
  52. package/dist/data/components/Divider.js +71 -0
  53. package/dist/data/components/Divider.js.map +1 -0
  54. package/dist/data/components/Icon.d.ts +15 -0
  55. package/dist/data/components/Icon.d.ts.map +1 -0
  56. package/dist/data/components/Icon.js +70 -0
  57. package/dist/data/components/Icon.js.map +1 -0
  58. package/dist/data/components/Image.d.ts +15 -0
  59. package/dist/data/components/Image.d.ts.map +1 -0
  60. package/dist/data/components/Image.js +122 -0
  61. package/dist/data/components/Image.js.map +1 -0
  62. package/dist/data/components/Input.d.ts +15 -0
  63. package/dist/data/components/Input.d.ts.map +1 -0
  64. package/dist/data/components/Input.js +109 -0
  65. package/dist/data/components/Input.js.map +1 -0
  66. package/dist/data/components/List.d.ts +15 -0
  67. package/dist/data/components/List.d.ts.map +1 -0
  68. package/dist/data/components/List.js +113 -0
  69. package/dist/data/components/List.js.map +1 -0
  70. package/dist/data/components/Menu.d.ts +15 -0
  71. package/dist/data/components/Menu.d.ts.map +1 -0
  72. package/dist/data/components/Menu.js +132 -0
  73. package/dist/data/components/Menu.js.map +1 -0
  74. package/dist/data/components/Popover.d.ts +15 -0
  75. package/dist/data/components/Popover.d.ts.map +1 -0
  76. package/dist/data/components/Popover.js +159 -0
  77. package/dist/data/components/Popover.js.map +1 -0
  78. package/dist/data/components/Pressable.d.ts +15 -0
  79. package/dist/data/components/Pressable.d.ts.map +1 -0
  80. package/dist/data/components/Pressable.js +125 -0
  81. package/dist/data/components/Pressable.js.map +1 -0
  82. package/dist/data/components/Progress.d.ts +15 -0
  83. package/dist/data/components/Progress.d.ts.map +1 -0
  84. package/dist/data/components/Progress.js +95 -0
  85. package/dist/data/components/Progress.js.map +1 -0
  86. package/dist/data/components/RadioButton.d.ts +15 -0
  87. package/dist/data/components/RadioButton.d.ts.map +1 -0
  88. package/dist/data/components/RadioButton.js +140 -0
  89. package/dist/data/components/RadioButton.js.map +1 -0
  90. package/dist/data/components/SVGImage.d.ts +15 -0
  91. package/dist/data/components/SVGImage.d.ts.map +1 -0
  92. package/dist/data/components/SVGImage.js +112 -0
  93. package/dist/data/components/SVGImage.js.map +1 -0
  94. package/dist/data/components/Screen.d.ts +15 -0
  95. package/dist/data/components/Screen.d.ts.map +1 -0
  96. package/dist/data/components/Screen.js +99 -0
  97. package/dist/data/components/Screen.js.map +1 -0
  98. package/dist/data/components/Select.d.ts +15 -0
  99. package/dist/data/components/Select.d.ts.map +1 -0
  100. package/dist/data/components/Select.js +146 -0
  101. package/dist/data/components/Select.js.map +1 -0
  102. package/dist/data/components/Skeleton.d.ts +15 -0
  103. package/dist/data/components/Skeleton.d.ts.map +1 -0
  104. package/dist/data/components/Skeleton.js +110 -0
  105. package/dist/data/components/Skeleton.js.map +1 -0
  106. package/dist/data/components/Slider.d.ts +15 -0
  107. package/dist/data/components/Slider.d.ts.map +1 -0
  108. package/dist/data/components/Slider.js +129 -0
  109. package/dist/data/components/Slider.js.map +1 -0
  110. package/dist/data/components/Switch.d.ts +15 -0
  111. package/dist/data/components/Switch.d.ts.map +1 -0
  112. package/dist/data/components/Switch.js +127 -0
  113. package/dist/data/components/Switch.js.map +1 -0
  114. package/dist/data/components/TabBar.d.ts +15 -0
  115. package/dist/data/components/TabBar.d.ts.map +1 -0
  116. package/dist/data/components/TabBar.js +145 -0
  117. package/dist/data/components/TabBar.js.map +1 -0
  118. package/dist/data/components/Table.d.ts +15 -0
  119. package/dist/data/components/Table.d.ts.map +1 -0
  120. package/dist/data/components/Table.js +151 -0
  121. package/dist/data/components/Table.js.map +1 -0
  122. package/dist/data/components/Tabs.d.ts +15 -0
  123. package/dist/data/components/Tabs.d.ts.map +1 -0
  124. package/dist/data/components/Tabs.js +150 -0
  125. package/dist/data/components/Tabs.js.map +1 -0
  126. package/dist/data/components/Text.d.ts +15 -0
  127. package/dist/data/components/Text.d.ts.map +1 -0
  128. package/dist/data/components/Text.js +85 -0
  129. package/dist/data/components/Text.js.map +1 -0
  130. package/dist/data/components/TextArea.d.ts +15 -0
  131. package/dist/data/components/TextArea.d.ts.map +1 -0
  132. package/dist/data/components/TextArea.js +155 -0
  133. package/dist/data/components/TextArea.js.map +1 -0
  134. package/dist/data/components/Tooltip.d.ts +15 -0
  135. package/dist/data/components/Tooltip.d.ts.map +1 -0
  136. package/dist/data/components/Tooltip.js +105 -0
  137. package/dist/data/components/Tooltip.js.map +1 -0
  138. package/dist/data/components/Video.d.ts +15 -0
  139. package/dist/data/components/Video.d.ts.map +1 -0
  140. package/dist/data/components/Video.js +168 -0
  141. package/dist/data/components/Video.js.map +1 -0
  142. package/dist/data/components/View.d.ts +15 -0
  143. package/dist/data/components/View.d.ts.map +1 -0
  144. package/dist/data/components/View.js +126 -0
  145. package/dist/data/components/View.js.map +1 -0
  146. package/dist/data/components/index.d.ts +37 -0
  147. package/dist/data/components/index.d.ts.map +1 -0
  148. package/dist/data/components/index.js +110 -0
  149. package/dist/data/components/index.js.map +1 -0
  150. package/dist/data/framework-guides.d.ts +2 -0
  151. package/dist/data/framework-guides.d.ts.map +1 -0
  152. package/dist/data/framework-guides.js +589 -0
  153. package/dist/data/framework-guides.js.map +1 -0
  154. package/dist/data/icon-guide.d.ts +2 -0
  155. package/dist/data/icon-guide.d.ts.map +1 -0
  156. package/dist/data/icon-guide.js +285 -0
  157. package/dist/data/icon-guide.js.map +1 -0
  158. package/dist/data/icons.json +7452 -0
  159. package/dist/data/navigation-guides.d.ts +2 -0
  160. package/dist/data/navigation-guides.d.ts.map +1 -0
  161. package/dist/data/navigation-guides.js +1196 -0
  162. package/dist/data/navigation-guides.js.map +1 -0
  163. package/dist/index.d.ts +3 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js +422 -0
  166. package/dist/index.js.map +1 -0
  167. package/package.json +34 -0
  168. package/src/data/cli-commands.ts +103 -0
  169. package/src/data/components/Accordion.ts +106 -0
  170. package/src/data/components/ActivityIndicator.ts +82 -0
  171. package/src/data/components/Alert.ts +132 -0
  172. package/src/data/components/Avatar.ts +93 -0
  173. package/src/data/components/Badge.ts +63 -0
  174. package/src/data/components/Breadcrumb.ts +94 -0
  175. package/src/data/components/Button.ts +86 -0
  176. package/src/data/components/Card.ts +67 -0
  177. package/src/data/components/Checkbox.ts +117 -0
  178. package/src/data/components/Chip.ts +93 -0
  179. package/src/data/components/Dialog.ts +136 -0
  180. package/src/data/components/Divider.ts +70 -0
  181. package/src/data/components/Icon.ts +70 -0
  182. package/src/data/components/Image.ts +121 -0
  183. package/src/data/components/Input.ts +150 -0
  184. package/src/data/components/List.ts +103 -0
  185. package/src/data/components/Menu.ts +125 -0
  186. package/src/data/components/Popover.ts +159 -0
  187. package/src/data/components/Pressable.ts +123 -0
  188. package/src/data/components/Progress.ts +95 -0
  189. package/src/data/components/RadioButton.ts +130 -0
  190. package/src/data/components/SVGImage.ts +114 -0
  191. package/src/data/components/Screen.ts +103 -0
  192. package/src/data/components/Select.ts +140 -0
  193. package/src/data/components/Skeleton.ts +102 -0
  194. package/src/data/components/Slider.ts +150 -0
  195. package/src/data/components/Switch.ts +127 -0
  196. package/src/data/components/TabBar.ts +142 -0
  197. package/src/data/components/Table.ts +153 -0
  198. package/src/data/components/Tabs.ts +152 -0
  199. package/src/data/components/Text.ts +85 -0
  200. package/src/data/components/TextArea.ts +155 -0
  201. package/src/data/components/Tooltip.ts +105 -0
  202. package/src/data/components/Video.ts +168 -0
  203. package/src/data/components/View.ts +126 -0
  204. package/src/data/components/index.ts +109 -0
  205. package/src/data/framework-guides.ts +593 -0
  206. package/src/data/icon-guide.ts +284 -0
  207. package/src/data/icons.json +7452 -0
  208. package/src/data/navigation-guides.ts +1199 -0
  209. package/src/index.ts +473 -0
  210. package/test-client.js +86 -0
  211. package/tsconfig.json +20 -0
package/src/index.ts ADDED
@@ -0,0 +1,473 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import {
6
+ ListToolsRequestSchema,
7
+ CallToolRequestSchema,
8
+ ListResourcesRequestSchema,
9
+ ReadResourceRequestSchema,
10
+ } from "@modelcontextprotocol/sdk/types.js";
11
+ import { components } from "./data/components/index.js";
12
+ import { cliCommands } from "./data/cli-commands.js";
13
+ import { frameworkGuides } from "./data/framework-guides.js";
14
+ import { navigationGuides } from "./data/navigation-guides.js";
15
+ import { iconGuide } from "./data/icon-guide.js";
16
+ import iconsData from "./data/icons.json" with { type: "json" };
17
+
18
+ const server = new Server(
19
+ {
20
+ name: "@idealyst/mcp-server",
21
+ version: "1.0.83",
22
+ },
23
+ {
24
+ capabilities: {
25
+ tools: {},
26
+ resources: {},
27
+ },
28
+ }
29
+ );
30
+
31
+ // List all available tools
32
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
33
+ return {
34
+ tools: [
35
+ {
36
+ name: "list_components",
37
+ description: "List all available Idealyst components with brief descriptions",
38
+ inputSchema: {
39
+ type: "object",
40
+ properties: {},
41
+ },
42
+ },
43
+ {
44
+ name: "get_component_docs",
45
+ description: "Get detailed documentation for a specific Idealyst component including props, usage, and examples",
46
+ inputSchema: {
47
+ type: "object",
48
+ properties: {
49
+ component: {
50
+ type: "string",
51
+ description: "The name of the component (e.g., 'Button', 'Card', 'Input')",
52
+ },
53
+ },
54
+ required: ["component"],
55
+ },
56
+ },
57
+ {
58
+ name: "get_component_example",
59
+ description: "Get a code example for a specific Idealyst component",
60
+ inputSchema: {
61
+ type: "object",
62
+ properties: {
63
+ component: {
64
+ type: "string",
65
+ description: "The name of the component",
66
+ },
67
+ example_type: {
68
+ type: "string",
69
+ description: "Type of example: 'basic', 'variants', 'with-icons', 'interactive'",
70
+ enum: ["basic", "variants", "with-icons", "interactive"],
71
+ },
72
+ },
73
+ required: ["component"],
74
+ },
75
+ },
76
+ {
77
+ name: "get_cli_usage",
78
+ description: "Get information about Idealyst CLI commands and usage",
79
+ inputSchema: {
80
+ type: "object",
81
+ properties: {
82
+ command: {
83
+ type: "string",
84
+ description: "Specific CLI command to get info about (optional)",
85
+ },
86
+ },
87
+ },
88
+ },
89
+ {
90
+ name: "search_components",
91
+ description: "Search for components by name, category, or feature",
92
+ inputSchema: {
93
+ type: "object",
94
+ properties: {
95
+ query: {
96
+ type: "string",
97
+ description: "Search query",
98
+ },
99
+ category: {
100
+ type: "string",
101
+ description: "Filter by category: 'layout', 'form', 'display', 'navigation', 'overlay', 'data'",
102
+ enum: ["layout", "form", "display", "navigation", "overlay", "data"],
103
+ },
104
+ },
105
+ },
106
+ },
107
+ {
108
+ name: "search_icons",
109
+ description: "Search for Material Design Icons by name or keyword. Returns matching icon names from 7,447 available icons.",
110
+ inputSchema: {
111
+ type: "object",
112
+ properties: {
113
+ query: {
114
+ type: "string",
115
+ description: "Search term to find icons (e.g., 'home', 'user', 'arrow')",
116
+ },
117
+ limit: {
118
+ type: "number",
119
+ description: "Maximum number of results to return (default: 20)",
120
+ },
121
+ },
122
+ required: ["query"],
123
+ },
124
+ },
125
+ ],
126
+ };
127
+ });
128
+
129
+ // Handle tool calls
130
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
131
+ const { name, arguments: args } = request.params;
132
+
133
+ switch (name) {
134
+ case "list_components": {
135
+ const componentList = Object.entries(components).map(([name, data]) => ({
136
+ name,
137
+ category: data.category,
138
+ description: data.description,
139
+ }));
140
+
141
+ return {
142
+ content: [
143
+ {
144
+ type: "text",
145
+ text: JSON.stringify(componentList, null, 2),
146
+ },
147
+ ],
148
+ };
149
+ }
150
+
151
+ case "get_component_docs": {
152
+ const componentName = args?.component as string;
153
+ const component = components[componentName];
154
+
155
+ if (!component) {
156
+ return {
157
+ content: [
158
+ {
159
+ type: "text",
160
+ text: `Component "${componentName}" not found. Available components: ${Object.keys(components).join(", ")}`,
161
+ },
162
+ ],
163
+ };
164
+ }
165
+
166
+ const docs = `# ${componentName}
167
+
168
+ ${component.description}
169
+
170
+ ## Category
171
+ ${component.category}
172
+
173
+ ## Props
174
+ ${component.props}
175
+
176
+ ## Usage Examples
177
+ ${component.usage}
178
+
179
+ ## Features
180
+ ${component.features.map((f: string) => `- ${f}`).join("\n")}
181
+
182
+ ## Best Practices
183
+ ${component.bestPractices.map((bp: string) => `- ${bp}`).join("\n")}
184
+ `;
185
+
186
+ return {
187
+ content: [
188
+ {
189
+ type: "text",
190
+ text: docs,
191
+ },
192
+ ],
193
+ };
194
+ }
195
+
196
+ case "get_component_example": {
197
+ const componentName = args?.component as string;
198
+ const exampleType = (args?.example_type as string) || "basic";
199
+ const component = components[componentName];
200
+
201
+ if (!component) {
202
+ return {
203
+ content: [
204
+ {
205
+ type: "text",
206
+ text: `Component "${componentName}" not found.`,
207
+ },
208
+ ],
209
+ };
210
+ }
211
+
212
+ const example = component.examples[exampleType] || component.examples.basic;
213
+
214
+ return {
215
+ content: [
216
+ {
217
+ type: "text",
218
+ text: example,
219
+ },
220
+ ],
221
+ };
222
+ }
223
+
224
+ case "get_cli_usage": {
225
+ const commandName = args?.command as string;
226
+
227
+ if (commandName) {
228
+ const command = cliCommands[commandName];
229
+ if (!command) {
230
+ return {
231
+ content: [
232
+ {
233
+ type: "text",
234
+ text: `Command "${commandName}" not found. Available commands: ${Object.keys(cliCommands).join(", ")}`,
235
+ },
236
+ ],
237
+ };
238
+ }
239
+
240
+ return {
241
+ content: [
242
+ {
243
+ type: "text",
244
+ text: `# ${commandName}
245
+
246
+ ${command.description}
247
+
248
+ ## Usage
249
+ \`\`\`bash
250
+ ${command.usage}
251
+ \`\`\`
252
+
253
+ ## Options
254
+ ${command.options.map((opt: any) => `- \`${opt.flag}\`: ${opt.description}`).join("\n")}
255
+
256
+ ## Examples
257
+ ${command.examples.map((ex: string) => `\`\`\`bash\n${ex}\n\`\`\``).join("\n\n")}
258
+ `,
259
+ },
260
+ ],
261
+ };
262
+ }
263
+
264
+ // Return all commands
265
+ const allCommands = Object.entries(cliCommands).map(([name, data]) => ({
266
+ name,
267
+ description: data.description,
268
+ usage: data.usage,
269
+ }));
270
+
271
+ return {
272
+ content: [
273
+ {
274
+ type: "text",
275
+ text: JSON.stringify(allCommands, null, 2),
276
+ },
277
+ ],
278
+ };
279
+ }
280
+
281
+ case "search_components": {
282
+ const query = (args?.query as string)?.toLowerCase() || "";
283
+ const category = args?.category as string;
284
+
285
+ let results = Object.entries(components);
286
+
287
+ if (category) {
288
+ results = results.filter(([_, data]) => data.category === category);
289
+ }
290
+
291
+ if (query) {
292
+ results = results.filter(([name, data]) =>
293
+ name.toLowerCase().includes(query) ||
294
+ data.description.toLowerCase().includes(query) ||
295
+ data.features.some((f: string) => f.toLowerCase().includes(query))
296
+ );
297
+ }
298
+
299
+ const resultList = results.map(([name, data]) => ({
300
+ name,
301
+ category: data.category,
302
+ description: data.description,
303
+ }));
304
+
305
+ return {
306
+ content: [
307
+ {
308
+ type: "text",
309
+ text: JSON.stringify(resultList, null, 2),
310
+ },
311
+ ],
312
+ };
313
+ }
314
+
315
+ case "search_icons": {
316
+ const query = (args?.query as string)?.toLowerCase() || "";
317
+ const limit = (args?.limit as number) || 20;
318
+
319
+ if (!query) {
320
+ return {
321
+ content: [
322
+ {
323
+ type: "text",
324
+ text: "Please provide a search query.",
325
+ },
326
+ ],
327
+ };
328
+ }
329
+
330
+ // Filter icons that match the query
331
+ const matchingIcons = iconsData.icons.filter((icon: string) =>
332
+ icon.toLowerCase().includes(query)
333
+ );
334
+
335
+ // Limit results
336
+ const limitedResults = matchingIcons.slice(0, limit);
337
+
338
+ const result = {
339
+ query,
340
+ total: iconsData.total,
341
+ matches: matchingIcons.length,
342
+ returned: limitedResults.length,
343
+ icons: limitedResults,
344
+ };
345
+
346
+ return {
347
+ content: [
348
+ {
349
+ type: "text",
350
+ text: JSON.stringify(result, null, 2),
351
+ },
352
+ ],
353
+ };
354
+ }
355
+
356
+ default:
357
+ return {
358
+ content: [
359
+ {
360
+ type: "text",
361
+ text: `Unknown tool: ${name}`,
362
+ },
363
+ ],
364
+ };
365
+ }
366
+ });
367
+
368
+ // List available resources
369
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
370
+ return {
371
+ resources: [
372
+ {
373
+ uri: "idealyst://framework/getting-started",
374
+ name: "Getting Started with Idealyst",
375
+ description: "Complete guide to setting up and using the Idealyst framework",
376
+ mimeType: "text/markdown",
377
+ },
378
+ {
379
+ uri: "idealyst://framework/components-overview",
380
+ name: "Components Overview",
381
+ description: "Overview of all available Idealyst components organized by category",
382
+ mimeType: "text/markdown",
383
+ },
384
+ {
385
+ uri: "idealyst://framework/theming",
386
+ name: "Theming Guide",
387
+ description: "Guide to customizing themes in Idealyst",
388
+ mimeType: "text/markdown",
389
+ },
390
+ {
391
+ uri: "idealyst://framework/cli",
392
+ name: "CLI Reference",
393
+ description: "Complete reference for the Idealyst CLI",
394
+ mimeType: "text/markdown",
395
+ },
396
+ {
397
+ uri: "idealyst://navigation/overview",
398
+ name: "Navigation System Overview",
399
+ description: "Overview of the Idealyst navigation system for cross-platform routing",
400
+ mimeType: "text/markdown",
401
+ },
402
+ {
403
+ uri: "idealyst://navigation/route-configuration",
404
+ name: "Route Configuration",
405
+ description: "Learn how to define and structure routes in Idealyst",
406
+ mimeType: "text/markdown",
407
+ },
408
+ {
409
+ uri: "idealyst://navigation/navigator-types",
410
+ name: "Navigator Types",
411
+ description: "Guide to stack, tab, drawer, and modal navigators",
412
+ mimeType: "text/markdown",
413
+ },
414
+ {
415
+ uri: "idealyst://navigation/custom-layouts",
416
+ name: "Custom Layouts (Web)",
417
+ description: "Creating custom layouts with headers and sidebars for web applications",
418
+ mimeType: "text/markdown",
419
+ },
420
+ {
421
+ uri: "idealyst://navigation/use-navigator",
422
+ name: "useNavigator Hook",
423
+ description: "Complete reference for the useNavigator hook API",
424
+ mimeType: "text/markdown",
425
+ },
426
+ {
427
+ uri: "idealyst://icons/reference",
428
+ name: "Icon Reference Guide",
429
+ description: "Complete guide to Material Design Icons with 7,447 available icons, common icons by category, and usage examples",
430
+ mimeType: "text/markdown",
431
+ },
432
+ ],
433
+ };
434
+ });
435
+
436
+ // Handle resource reads
437
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
438
+ const { uri } = request.params;
439
+
440
+ // Check framework guides first, then navigation guides, then icon guide
441
+ let guide = frameworkGuides[uri] || navigationGuides[uri];
442
+
443
+ // Handle icon reference
444
+ if (uri === "idealyst://icons/reference") {
445
+ guide = iconGuide;
446
+ }
447
+
448
+ if (!guide) {
449
+ throw new Error(`Resource not found: ${uri}`);
450
+ }
451
+
452
+ return {
453
+ contents: [
454
+ {
455
+ uri,
456
+ mimeType: "text/markdown",
457
+ text: guide,
458
+ },
459
+ ],
460
+ };
461
+ });
462
+
463
+ // Start the server
464
+ async function main() {
465
+ const transport = new StdioServerTransport();
466
+ await server.connect(transport);
467
+ console.error("Idealyst MCP Server running on stdio");
468
+ }
469
+
470
+ main().catch((error) => {
471
+ console.error("Fatal error:", error);
472
+ process.exit(1);
473
+ });
package/test-client.js ADDED
@@ -0,0 +1,86 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Simple test client to verify the MCP server is working
5
+ */
6
+
7
+ import { spawn } from 'child_process';
8
+
9
+ // Start the MCP server
10
+ const server = spawn('node', ['./dist/index.js'], {
11
+ stdio: ['pipe', 'pipe', 'pipe']
12
+ });
13
+
14
+ let responseData = '';
15
+
16
+ server.stdout.on('data', (data) => {
17
+ responseData += data.toString();
18
+
19
+ // Try to parse JSON responses
20
+ const lines = responseData.split('\n');
21
+ lines.forEach(line => {
22
+ if (line.trim() && line.includes('{')) {
23
+ try {
24
+ const json = JSON.parse(line);
25
+ console.log('Response:', JSON.stringify(json, null, 2));
26
+ } catch (e) {
27
+ // Not JSON, probably stderr message
28
+ }
29
+ }
30
+ });
31
+ });
32
+
33
+ server.stderr.on('data', (data) => {
34
+ console.error('Server:', data.toString().trim());
35
+ });
36
+
37
+ // Wait a moment for server to start
38
+ setTimeout(() => {
39
+ console.log('\nšŸ“‹ Testing list_tools...\n');
40
+
41
+ // Send a request to list tools
42
+ const request = {
43
+ jsonrpc: '2.0',
44
+ id: 1,
45
+ method: 'tools/list',
46
+ params: {}
47
+ };
48
+
49
+ server.stdin.write(JSON.stringify(request) + '\n');
50
+
51
+ // Wait for response
52
+ setTimeout(() => {
53
+ console.log('\nšŸ” Testing get_component_docs for Button...\n');
54
+
55
+ const toolRequest = {
56
+ jsonrpc: '2.0',
57
+ id: 2,
58
+ method: 'tools/call',
59
+ params: {
60
+ name: 'get_component_docs',
61
+ arguments: {
62
+ component: 'Button'
63
+ }
64
+ }
65
+ };
66
+
67
+ server.stdin.write(JSON.stringify(toolRequest) + '\n');
68
+
69
+ // Close after a moment
70
+ setTimeout(() => {
71
+ console.log('\nāœ… Test complete!\n');
72
+ server.kill();
73
+ process.exit(0);
74
+ }, 2000);
75
+ }, 2000);
76
+ }, 1000);
77
+
78
+ // Handle errors
79
+ server.on('error', (error) => {
80
+ console.error('Error:', error);
81
+ process.exit(1);
82
+ });
83
+
84
+ server.on('close', (code) => {
85
+ console.log(`Server process exited with code ${code}`);
86
+ });
package/tsconfig.json ADDED
@@ -0,0 +1,20 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "lib": ["ES2022"],
7
+ "outDir": "./dist",
8
+ "rootDir": "./src",
9
+ "strict": true,
10
+ "esModuleInterop": true,
11
+ "skipLibCheck": true,
12
+ "forceConsistentCasingInFileNames": true,
13
+ "resolveJsonModule": true,
14
+ "declaration": true,
15
+ "declarationMap": true,
16
+ "sourceMap": true
17
+ },
18
+ "include": ["src/**/*"],
19
+ "exclude": ["node_modules", "dist"]
20
+ }