@idealyst/mcp-server 1.0.93 → 1.0.94

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 (182) hide show
  1. package/dist/data/cli-commands.d.ts +2 -0
  2. package/dist/data/cli-commands.d.ts.map +1 -0
  3. package/dist/data/cli-commands.js +100 -0
  4. package/dist/data/cli-commands.js.map +1 -0
  5. package/dist/data/components/Accordion.d.ts +15 -0
  6. package/dist/data/components/Accordion.d.ts.map +1 -0
  7. package/{src/data/components/Accordion.ts → dist/data/components/Accordion.js} +26 -28
  8. package/dist/data/components/Accordion.js.map +1 -0
  9. package/dist/data/components/ActivityIndicator.d.ts +15 -0
  10. package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
  11. package/{src/data/components/ActivityIndicator.ts → dist/data/components/ActivityIndicator.js} +26 -28
  12. package/dist/data/components/ActivityIndicator.js.map +1 -0
  13. package/dist/data/components/Alert.d.ts +15 -0
  14. package/dist/data/components/Alert.d.ts.map +1 -0
  15. package/{src/data/components/Alert.ts → dist/data/components/Alert.js} +28 -30
  16. package/dist/data/components/Alert.js.map +1 -0
  17. package/dist/data/components/Avatar.d.ts +15 -0
  18. package/dist/data/components/Avatar.d.ts.map +1 -0
  19. package/{src/data/components/Avatar.ts → dist/data/components/Avatar.js} +26 -28
  20. package/dist/data/components/Avatar.js.map +1 -0
  21. package/dist/data/components/Badge.d.ts +15 -0
  22. package/dist/data/components/Badge.d.ts.map +1 -0
  23. package/{src/data/components/Badge.ts → dist/data/components/Badge.js} +16 -15
  24. package/dist/data/components/Badge.js.map +1 -0
  25. package/dist/data/components/Breadcrumb.d.ts +15 -0
  26. package/dist/data/components/Breadcrumb.d.ts.map +1 -0
  27. package/{src/data/components/Breadcrumb.ts → dist/data/components/Breadcrumb.js} +27 -29
  28. package/dist/data/components/Breadcrumb.js.map +1 -0
  29. package/dist/data/components/Button.d.ts +15 -0
  30. package/dist/data/components/Button.d.ts.map +1 -0
  31. package/{src/data/components/Button.ts → dist/data/components/Button.js} +18 -17
  32. package/dist/data/components/Button.js.map +1 -0
  33. package/dist/data/components/Card.d.ts +15 -0
  34. package/dist/data/components/Card.d.ts.map +1 -0
  35. package/{src/data/components/Card.ts → dist/data/components/Card.js} +16 -15
  36. package/dist/data/components/Card.js.map +1 -0
  37. package/dist/data/components/Checkbox.d.ts +15 -0
  38. package/dist/data/components/Checkbox.d.ts.map +1 -0
  39. package/{src/data/components/Checkbox.ts → dist/data/components/Checkbox.js} +27 -29
  40. package/dist/data/components/Checkbox.js.map +1 -0
  41. package/dist/data/components/Chip.d.ts +15 -0
  42. package/dist/data/components/Chip.d.ts.map +1 -0
  43. package/{src/data/components/Chip.ts → dist/data/components/Chip.js} +19 -18
  44. package/dist/data/components/Chip.js.map +1 -0
  45. package/dist/data/components/Dialog.d.ts +15 -0
  46. package/dist/data/components/Dialog.d.ts.map +1 -0
  47. package/{src/data/components/Dialog.ts → dist/data/components/Dialog.js} +18 -17
  48. package/dist/data/components/Dialog.js.map +1 -0
  49. package/dist/data/components/Divider.d.ts +15 -0
  50. package/dist/data/components/Divider.d.ts.map +1 -0
  51. package/{src/data/components/Divider.ts → dist/data/components/Divider.js} +26 -28
  52. package/dist/data/components/Divider.js.map +1 -0
  53. package/dist/data/components/Icon.d.ts +15 -0
  54. package/dist/data/components/Icon.d.ts.map +1 -0
  55. package/{src/data/components/Icon.ts → dist/data/components/Icon.js} +26 -28
  56. package/dist/data/components/Icon.js.map +1 -0
  57. package/dist/data/components/Image.d.ts +15 -0
  58. package/dist/data/components/Image.d.ts.map +1 -0
  59. package/{src/data/components/Image.ts → dist/data/components/Image.js} +29 -31
  60. package/dist/data/components/Image.js.map +1 -0
  61. package/dist/data/components/Input.d.ts +15 -0
  62. package/dist/data/components/Input.d.ts.map +1 -0
  63. package/{src/data/components/Input.ts → dist/data/components/Input.js} +20 -19
  64. package/dist/data/components/Input.js.map +1 -0
  65. package/dist/data/components/List.d.ts +15 -0
  66. package/dist/data/components/List.d.ts.map +1 -0
  67. package/{src/data/components/List.ts → dist/data/components/List.js} +18 -17
  68. package/dist/data/components/List.js.map +1 -0
  69. package/dist/data/components/Menu.d.ts +15 -0
  70. package/dist/data/components/Menu.d.ts.map +1 -0
  71. package/{src/data/components/Menu.ts → dist/data/components/Menu.js} +27 -29
  72. package/dist/data/components/Menu.js.map +1 -0
  73. package/dist/data/components/Popover.d.ts +15 -0
  74. package/dist/data/components/Popover.d.ts.map +1 -0
  75. package/{src/data/components/Popover.ts → dist/data/components/Popover.js} +28 -30
  76. package/dist/data/components/Popover.js.map +1 -0
  77. package/dist/data/components/Pressable.d.ts +15 -0
  78. package/dist/data/components/Pressable.d.ts.map +1 -0
  79. package/{src/data/components/Pressable.ts → dist/data/components/Pressable.js} +27 -29
  80. package/dist/data/components/Pressable.js.map +1 -0
  81. package/dist/data/components/Progress.d.ts +15 -0
  82. package/dist/data/components/Progress.d.ts.map +1 -0
  83. package/{src/data/components/Progress.ts → dist/data/components/Progress.js} +27 -29
  84. package/dist/data/components/Progress.js.map +1 -0
  85. package/dist/data/components/RadioButton.d.ts +15 -0
  86. package/dist/data/components/RadioButton.d.ts.map +1 -0
  87. package/{src/data/components/RadioButton.ts → dist/data/components/RadioButton.js} +28 -30
  88. package/dist/data/components/RadioButton.js.map +1 -0
  89. package/dist/data/components/SVGImage.d.ts +15 -0
  90. package/dist/data/components/SVGImage.d.ts.map +1 -0
  91. package/{src/data/components/SVGImage.ts → dist/data/components/SVGImage.js} +27 -29
  92. package/dist/data/components/SVGImage.js.map +1 -0
  93. package/dist/data/components/Screen.d.ts +15 -0
  94. package/dist/data/components/Screen.d.ts.map +1 -0
  95. package/{src/data/components/Screen.ts → dist/data/components/Screen.js} +27 -29
  96. package/dist/data/components/Screen.js.map +1 -0
  97. package/dist/data/components/Select.d.ts +15 -0
  98. package/dist/data/components/Select.d.ts.map +1 -0
  99. package/{src/data/components/Select.ts → dist/data/components/Select.js} +30 -32
  100. package/dist/data/components/Select.js.map +1 -0
  101. package/dist/data/components/Skeleton.d.ts +15 -0
  102. package/dist/data/components/Skeleton.d.ts.map +1 -0
  103. package/{src/data/components/Skeleton.ts → dist/data/components/Skeleton.js} +27 -29
  104. package/dist/data/components/Skeleton.js.map +1 -0
  105. package/dist/data/components/Slider.d.ts +15 -0
  106. package/dist/data/components/Slider.d.ts.map +1 -0
  107. package/{src/data/components/Slider.ts → dist/data/components/Slider.js} +31 -33
  108. package/dist/data/components/Slider.js.map +1 -0
  109. package/dist/data/components/Switch.d.ts +15 -0
  110. package/dist/data/components/Switch.d.ts.map +1 -0
  111. package/{src/data/components/Switch.ts → dist/data/components/Switch.js} +28 -30
  112. package/dist/data/components/Switch.js.map +1 -0
  113. package/dist/data/components/TabBar.d.ts +15 -0
  114. package/dist/data/components/TabBar.d.ts.map +1 -0
  115. package/{src/data/components/TabBar.ts → dist/data/components/TabBar.js} +27 -29
  116. package/dist/data/components/TabBar.js.map +1 -0
  117. package/dist/data/components/Table.d.ts +15 -0
  118. package/dist/data/components/Table.d.ts.map +1 -0
  119. package/{src/data/components/Table.ts → dist/data/components/Table.js} +29 -31
  120. package/dist/data/components/Table.js.map +1 -0
  121. package/dist/data/components/Tabs.d.ts +15 -0
  122. package/dist/data/components/Tabs.d.ts.map +1 -0
  123. package/{src/data/components/Tabs.ts → dist/data/components/Tabs.js} +28 -30
  124. package/dist/data/components/Tabs.js.map +1 -0
  125. package/dist/data/components/Text.d.ts +15 -0
  126. package/dist/data/components/Text.d.ts.map +1 -0
  127. package/{src/data/components/Text.ts → dist/data/components/Text.js} +27 -29
  128. package/dist/data/components/Text.js.map +1 -0
  129. package/dist/data/components/TextArea.d.ts +15 -0
  130. package/dist/data/components/TextArea.d.ts.map +1 -0
  131. package/{src/data/components/TextArea.ts → dist/data/components/TextArea.js} +31 -33
  132. package/dist/data/components/TextArea.js.map +1 -0
  133. package/dist/data/components/Tooltip.d.ts +15 -0
  134. package/dist/data/components/Tooltip.d.ts.map +1 -0
  135. package/{src/data/components/Tooltip.ts → dist/data/components/Tooltip.js} +28 -30
  136. package/dist/data/components/Tooltip.js.map +1 -0
  137. package/dist/data/components/Video.d.ts +15 -0
  138. package/dist/data/components/Video.d.ts.map +1 -0
  139. package/{src/data/components/Video.ts → dist/data/components/Video.js} +31 -33
  140. package/dist/data/components/Video.js.map +1 -0
  141. package/dist/data/components/View.d.ts +15 -0
  142. package/dist/data/components/View.d.ts.map +1 -0
  143. package/{src/data/components/View.ts → dist/data/components/View.js} +28 -30
  144. package/dist/data/components/View.js.map +1 -0
  145. package/dist/data/components/index.d.ts +37 -0
  146. package/dist/data/components/index.d.ts.map +1 -0
  147. package/{src/data/components/index.ts → dist/data/components/index.js} +37 -38
  148. package/dist/data/components/index.js.map +1 -0
  149. package/dist/data/framework-guides.d.ts +2 -0
  150. package/dist/data/framework-guides.d.ts.map +1 -0
  151. package/{src/data/framework-guides.ts → dist/data/framework-guides.js} +8 -12
  152. package/dist/data/framework-guides.js.map +1 -0
  153. package/dist/data/icon-guide.d.ts +2 -0
  154. package/dist/data/icon-guide.d.ts.map +1 -0
  155. package/{src/data/icon-guide.ts → dist/data/icon-guide.js} +1 -0
  156. package/dist/data/icon-guide.js.map +1 -0
  157. package/dist/data/icons.json +7452 -0
  158. package/dist/data/navigation-guides.d.ts +2 -0
  159. package/dist/data/navigation-guides.d.ts.map +1 -0
  160. package/{src/data/navigation-guides.ts → dist/data/navigation-guides.js} +7 -10
  161. package/dist/data/navigation-guides.js.map +1 -0
  162. package/dist/generated/types.json +2556 -0
  163. package/dist/index.d.ts +3 -0
  164. package/dist/index.d.ts.map +1 -0
  165. package/dist/index.js.map +1 -0
  166. package/dist/tools/get-types.d.ts +26 -0
  167. package/dist/tools/get-types.d.ts.map +1 -0
  168. package/dist/tools/get-types.js +123 -0
  169. package/dist/tools/get-types.js.map +1 -0
  170. package/package.json +7 -2
  171. package/ARCHITECTURE.md +0 -313
  172. package/TYPE-SYSTEM.md +0 -397
  173. package/scripts/extract-types.ts +0 -71
  174. package/scripts/type-extractor.ts +0 -286
  175. package/scripts/validate-examples.ts +0 -142
  176. package/src/data/cli-commands.ts +0 -103
  177. package/src/data/icons.json +0 -7452
  178. package/src/index.ts +0 -653
  179. package/src/tools/get-types.ts +0 -169
  180. package/test-client.js +0 -86
  181. package/tsconfig.examples.json +0 -14
  182. package/tsconfig.json +0 -20
package/src/index.ts DELETED
@@ -1,653 +0,0 @@
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
- import {
18
- getComponentTypes,
19
- getThemeTypes,
20
- getNavigationTypes,
21
- getAvailableComponents,
22
- getComponentExamples,
23
- } from "./tools/get-types.js";
24
-
25
- const server = new Server(
26
- {
27
- name: "@idealyst/mcp-server",
28
- version: "1.0.93",
29
- },
30
- {
31
- capabilities: {
32
- tools: {},
33
- resources: {},
34
- },
35
- }
36
- );
37
-
38
- // List all available tools
39
- server.setRequestHandler(ListToolsRequestSchema, async () => {
40
- return {
41
- tools: [
42
- {
43
- name: "list_components",
44
- description: "List all available Idealyst components with brief descriptions",
45
- inputSchema: {
46
- type: "object",
47
- properties: {},
48
- },
49
- },
50
- {
51
- name: "get_component_docs",
52
- description: "Get detailed documentation for a specific Idealyst component including props, usage, and examples",
53
- inputSchema: {
54
- type: "object",
55
- properties: {
56
- component: {
57
- type: "string",
58
- description: "The name of the component (e.g., 'Button', 'Card', 'Input')",
59
- },
60
- },
61
- required: ["component"],
62
- },
63
- },
64
- {
65
- name: "get_component_example",
66
- description: "Get a code example for a specific Idealyst component",
67
- inputSchema: {
68
- type: "object",
69
- properties: {
70
- component: {
71
- type: "string",
72
- description: "The name of the component",
73
- },
74
- example_type: {
75
- type: "string",
76
- description: "Type of example: 'basic', 'variants', 'with-icons', 'interactive'",
77
- enum: ["basic", "variants", "with-icons", "interactive"],
78
- },
79
- },
80
- required: ["component"],
81
- },
82
- },
83
- {
84
- name: "get_cli_usage",
85
- description: "Get information about Idealyst CLI commands and usage",
86
- inputSchema: {
87
- type: "object",
88
- properties: {
89
- command: {
90
- type: "string",
91
- description: "Specific CLI command to get info about (optional)",
92
- },
93
- },
94
- },
95
- },
96
- {
97
- name: "search_components",
98
- description: "Search for components by name, category, or feature",
99
- inputSchema: {
100
- type: "object",
101
- properties: {
102
- query: {
103
- type: "string",
104
- description: "Search query",
105
- },
106
- category: {
107
- type: "string",
108
- description: "Filter by category: 'layout', 'form', 'display', 'navigation', 'overlay', 'data'",
109
- enum: ["layout", "form", "display", "navigation", "overlay", "data"],
110
- },
111
- },
112
- },
113
- },
114
- {
115
- name: "search_icons",
116
- description: "Search for Material Design Icons by name or keyword. Returns matching icon names from 7,447 available icons.",
117
- inputSchema: {
118
- type: "object",
119
- properties: {
120
- query: {
121
- type: "string",
122
- description: "Search term to find icons (e.g., 'home', 'user', 'arrow')",
123
- },
124
- limit: {
125
- type: "number",
126
- description: "Maximum number of results to return (default: 20)",
127
- },
128
- },
129
- required: ["query"],
130
- },
131
- },
132
- {
133
- name: "get_component_types",
134
- description: "Get TypeScript type definitions for a specific component directly from the source. Returns the actual TypeScript interface and/or JSON schema.",
135
- inputSchema: {
136
- type: "object",
137
- properties: {
138
- component: {
139
- type: "string",
140
- description: "The name of the component (e.g., 'Button', 'Card', 'Input')",
141
- },
142
- format: {
143
- type: "string",
144
- description: "Output format: 'typescript' for raw TypeScript definitions, 'json' for parsed schema, 'both' for combined output (default: 'both')",
145
- enum: ["typescript", "json", "both"],
146
- },
147
- },
148
- required: ["component"],
149
- },
150
- },
151
- {
152
- name: "get_theme_types",
153
- description: "Get TypeScript type definitions for theme types (Size, Intent, Color, etc.) directly from @idealyst/theme",
154
- inputSchema: {
155
- type: "object",
156
- properties: {
157
- format: {
158
- type: "string",
159
- description: "Output format: 'typescript', 'json', or 'both' (default: 'both')",
160
- enum: ["typescript", "json", "both"],
161
- },
162
- },
163
- },
164
- },
165
- {
166
- name: "get_navigation_types",
167
- description: "Get TypeScript type definitions for navigation types directly from @idealyst/navigation",
168
- inputSchema: {
169
- type: "object",
170
- properties: {
171
- format: {
172
- type: "string",
173
- description: "Output format: 'typescript', 'json', or 'both' (default: 'both')",
174
- enum: ["typescript", "json", "both"],
175
- },
176
- },
177
- },
178
- },
179
- {
180
- name: "get_component_examples_ts",
181
- description: "Get validated TypeScript example code for a component. These examples are type-checked and guaranteed to compile.",
182
- inputSchema: {
183
- type: "object",
184
- properties: {
185
- component: {
186
- type: "string",
187
- description: "The name of the component (e.g., 'Button', 'Card')",
188
- },
189
- },
190
- required: ["component"],
191
- },
192
- },
193
- ],
194
- };
195
- });
196
-
197
- // Handle tool calls
198
- server.setRequestHandler(CallToolRequestSchema, async (request) => {
199
- const { name, arguments: args } = request.params;
200
-
201
- switch (name) {
202
- case "list_components": {
203
- const componentList = Object.entries(components).map(([name, data]) => ({
204
- name,
205
- category: data.category,
206
- description: data.description,
207
- }));
208
-
209
- return {
210
- content: [
211
- {
212
- type: "text",
213
- text: JSON.stringify(componentList, null, 2),
214
- },
215
- ],
216
- };
217
- }
218
-
219
- case "get_component_docs": {
220
- const componentName = args?.component as string;
221
- const component = components[componentName];
222
-
223
- if (!component) {
224
- return {
225
- content: [
226
- {
227
- type: "text",
228
- text: `Component "${componentName}" not found. Available components: ${Object.keys(components).join(", ")}`,
229
- },
230
- ],
231
- };
232
- }
233
-
234
- const docs = `# ${componentName}
235
-
236
- ${component.description}
237
-
238
- ## Category
239
- ${component.category}
240
-
241
- ## Props
242
- ${component.props}
243
-
244
- ## Usage Examples
245
- ${component.usage}
246
-
247
- ## Features
248
- ${component.features.map((f: string) => `- ${f}`).join("\n")}
249
-
250
- ## Best Practices
251
- ${component.bestPractices.map((bp: string) => `- ${bp}`).join("\n")}
252
- `;
253
-
254
- return {
255
- content: [
256
- {
257
- type: "text",
258
- text: docs,
259
- },
260
- ],
261
- };
262
- }
263
-
264
- case "get_component_example": {
265
- const componentName = args?.component as string;
266
- const exampleType = (args?.example_type as string) || "basic";
267
- const component = components[componentName];
268
-
269
- if (!component) {
270
- return {
271
- content: [
272
- {
273
- type: "text",
274
- text: `Component "${componentName}" not found.`,
275
- },
276
- ],
277
- };
278
- }
279
-
280
- const example = component.examples[exampleType] || component.examples.basic;
281
-
282
- return {
283
- content: [
284
- {
285
- type: "text",
286
- text: example,
287
- },
288
- ],
289
- };
290
- }
291
-
292
- case "get_cli_usage": {
293
- const commandName = args?.command as string;
294
-
295
- if (commandName) {
296
- const command = cliCommands[commandName];
297
- if (!command) {
298
- return {
299
- content: [
300
- {
301
- type: "text",
302
- text: `Command "${commandName}" not found. Available commands: ${Object.keys(cliCommands).join(", ")}`,
303
- },
304
- ],
305
- };
306
- }
307
-
308
- return {
309
- content: [
310
- {
311
- type: "text",
312
- text: `# ${commandName}
313
-
314
- ${command.description}
315
-
316
- ## Usage
317
- \`\`\`bash
318
- ${command.usage}
319
- \`\`\`
320
-
321
- ## Options
322
- ${command.options.map((opt: any) => `- \`${opt.flag}\`: ${opt.description}`).join("\n")}
323
-
324
- ## Examples
325
- ${command.examples.map((ex: string) => `\`\`\`bash\n${ex}\n\`\`\``).join("\n\n")}
326
- `,
327
- },
328
- ],
329
- };
330
- }
331
-
332
- // Return all commands
333
- const allCommands = Object.entries(cliCommands).map(([name, data]) => ({
334
- name,
335
- description: data.description,
336
- usage: data.usage,
337
- }));
338
-
339
- return {
340
- content: [
341
- {
342
- type: "text",
343
- text: JSON.stringify(allCommands, null, 2),
344
- },
345
- ],
346
- };
347
- }
348
-
349
- case "search_components": {
350
- const query = (args?.query as string)?.toLowerCase() || "";
351
- const category = args?.category as string;
352
-
353
- let results = Object.entries(components);
354
-
355
- if (category) {
356
- results = results.filter(([_, data]) => data.category === category);
357
- }
358
-
359
- if (query) {
360
- results = results.filter(([name, data]) =>
361
- name.toLowerCase().includes(query) ||
362
- data.description.toLowerCase().includes(query) ||
363
- data.features.some((f: string) => f.toLowerCase().includes(query))
364
- );
365
- }
366
-
367
- const resultList = results.map(([name, data]) => ({
368
- name,
369
- category: data.category,
370
- description: data.description,
371
- }));
372
-
373
- return {
374
- content: [
375
- {
376
- type: "text",
377
- text: JSON.stringify(resultList, null, 2),
378
- },
379
- ],
380
- };
381
- }
382
-
383
- case "search_icons": {
384
- const query = (args?.query as string)?.toLowerCase() || "";
385
- const limit = (args?.limit as number) || 20;
386
-
387
- if (!query) {
388
- return {
389
- content: [
390
- {
391
- type: "text",
392
- text: "Please provide a search query.",
393
- },
394
- ],
395
- };
396
- }
397
-
398
- // Filter icons that match the query
399
- const matchingIcons = iconsData.icons.filter((icon: string) =>
400
- icon.toLowerCase().includes(query)
401
- );
402
-
403
- // Limit results
404
- const limitedResults = matchingIcons.slice(0, limit);
405
-
406
- const result = {
407
- query,
408
- total: iconsData.total,
409
- matches: matchingIcons.length,
410
- returned: limitedResults.length,
411
- icons: limitedResults,
412
- };
413
-
414
- return {
415
- content: [
416
- {
417
- type: "text",
418
- text: JSON.stringify(result, null, 2),
419
- },
420
- ],
421
- };
422
- }
423
-
424
- case "get_component_types": {
425
- const componentName = args?.component as string;
426
- const format = (args?.format as 'typescript' | 'json' | 'both') || 'both';
427
-
428
- try {
429
- const result = getComponentTypes(componentName, format);
430
- return {
431
- content: [
432
- {
433
- type: "text",
434
- text: JSON.stringify(result, null, 2),
435
- },
436
- ],
437
- };
438
- } catch (error) {
439
- return {
440
- content: [
441
- {
442
- type: "text",
443
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
444
- },
445
- ],
446
- };
447
- }
448
- }
449
-
450
- case "get_theme_types": {
451
- const format = (args?.format as 'typescript' | 'json' | 'both') || 'both';
452
-
453
- try {
454
- const result = getThemeTypes(format);
455
- return {
456
- content: [
457
- {
458
- type: "text",
459
- text: JSON.stringify(result, null, 2),
460
- },
461
- ],
462
- };
463
- } catch (error) {
464
- return {
465
- content: [
466
- {
467
- type: "text",
468
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
469
- },
470
- ],
471
- };
472
- }
473
- }
474
-
475
- case "get_navigation_types": {
476
- const format = (args?.format as 'typescript' | 'json' | 'both') || 'both';
477
-
478
- try {
479
- const result = getNavigationTypes(format);
480
- return {
481
- content: [
482
- {
483
- type: "text",
484
- text: JSON.stringify(result, null, 2),
485
- },
486
- ],
487
- };
488
- } catch (error) {
489
- return {
490
- content: [
491
- {
492
- type: "text",
493
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
494
- },
495
- ],
496
- };
497
- }
498
- }
499
-
500
- case "get_component_examples_ts": {
501
- const componentName = args?.component as string;
502
-
503
- try {
504
- const examples = getComponentExamples(componentName);
505
- if (!examples) {
506
- return {
507
- content: [
508
- {
509
- type: "text",
510
- text: `No TypeScript examples found for component "${componentName}". Available components with examples: ${getAvailableComponents().join(', ')}`,
511
- },
512
- ],
513
- };
514
- }
515
-
516
- return {
517
- content: [
518
- {
519
- type: "text",
520
- text: examples,
521
- },
522
- ],
523
- };
524
- } catch (error) {
525
- return {
526
- content: [
527
- {
528
- type: "text",
529
- text: `Error: ${error instanceof Error ? error.message : 'Unknown error'}`,
530
- },
531
- ],
532
- };
533
- }
534
- }
535
-
536
- default:
537
- return {
538
- content: [
539
- {
540
- type: "text",
541
- text: `Unknown tool: ${name}`,
542
- },
543
- ],
544
- };
545
- }
546
- });
547
-
548
- // List available resources
549
- server.setRequestHandler(ListResourcesRequestSchema, async () => {
550
- return {
551
- resources: [
552
- {
553
- uri: "idealyst://framework/getting-started",
554
- name: "Getting Started with Idealyst",
555
- description: "Complete guide to setting up and using the Idealyst framework",
556
- mimeType: "text/markdown",
557
- },
558
- {
559
- uri: "idealyst://framework/components-overview",
560
- name: "Components Overview",
561
- description: "Overview of all available Idealyst components organized by category",
562
- mimeType: "text/markdown",
563
- },
564
- {
565
- uri: "idealyst://framework/theming",
566
- name: "Theming Guide",
567
- description: "Guide to customizing themes in Idealyst",
568
- mimeType: "text/markdown",
569
- },
570
- {
571
- uri: "idealyst://framework/cli",
572
- name: "CLI Reference",
573
- description: "Complete reference for the Idealyst CLI",
574
- mimeType: "text/markdown",
575
- },
576
- {
577
- uri: "idealyst://navigation/overview",
578
- name: "Navigation System Overview",
579
- description: "Overview of the Idealyst navigation system for cross-platform routing",
580
- mimeType: "text/markdown",
581
- },
582
- {
583
- uri: "idealyst://navigation/route-configuration",
584
- name: "Route Configuration",
585
- description: "Learn how to define and structure routes in Idealyst",
586
- mimeType: "text/markdown",
587
- },
588
- {
589
- uri: "idealyst://navigation/navigator-types",
590
- name: "Navigator Types",
591
- description: "Guide to stack, tab, drawer, and modal navigators",
592
- mimeType: "text/markdown",
593
- },
594
- {
595
- uri: "idealyst://navigation/custom-layouts",
596
- name: "Custom Layouts (Web)",
597
- description: "Creating custom layouts with headers and sidebars for web applications",
598
- mimeType: "text/markdown",
599
- },
600
- {
601
- uri: "idealyst://navigation/use-navigator",
602
- name: "useNavigator Hook",
603
- description: "Complete reference for the useNavigator hook API",
604
- mimeType: "text/markdown",
605
- },
606
- {
607
- uri: "idealyst://icons/reference",
608
- name: "Icon Reference Guide",
609
- description: "Complete guide to Material Design Icons with 7,447 available icons, common icons by category, and usage examples",
610
- mimeType: "text/markdown",
611
- },
612
- ],
613
- };
614
- });
615
-
616
- // Handle resource reads
617
- server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
618
- const { uri } = request.params;
619
-
620
- // Check framework guides first, then navigation guides, then icon guide
621
- let guide = frameworkGuides[uri] || navigationGuides[uri];
622
-
623
- // Handle icon reference
624
- if (uri === "idealyst://icons/reference") {
625
- guide = iconGuide;
626
- }
627
-
628
- if (!guide) {
629
- throw new Error(`Resource not found: ${uri}`);
630
- }
631
-
632
- return {
633
- contents: [
634
- {
635
- uri,
636
- mimeType: "text/markdown",
637
- text: guide,
638
- },
639
- ],
640
- };
641
- });
642
-
643
- // Start the server
644
- async function main() {
645
- const transport = new StdioServerTransport();
646
- await server.connect(transport);
647
- console.error("Idealyst MCP Server running on stdio");
648
- }
649
-
650
- main().catch((error) => {
651
- console.error("Fatal error:", error);
652
- process.exit(1);
653
- });