@idealyst/mcp-server 1.0.92 → 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.
- package/dist/data/cli-commands.d.ts +2 -0
- package/dist/data/cli-commands.d.ts.map +1 -0
- package/dist/data/cli-commands.js +100 -0
- package/dist/data/cli-commands.js.map +1 -0
- package/dist/data/components/Accordion.d.ts +15 -0
- package/dist/data/components/Accordion.d.ts.map +1 -0
- package/{src/data/components/Accordion.ts → dist/data/components/Accordion.js} +26 -28
- package/dist/data/components/Accordion.js.map +1 -0
- package/dist/data/components/ActivityIndicator.d.ts +15 -0
- package/dist/data/components/ActivityIndicator.d.ts.map +1 -0
- package/{src/data/components/ActivityIndicator.ts → dist/data/components/ActivityIndicator.js} +26 -28
- package/dist/data/components/ActivityIndicator.js.map +1 -0
- package/dist/data/components/Alert.d.ts +15 -0
- package/dist/data/components/Alert.d.ts.map +1 -0
- package/{src/data/components/Alert.ts → dist/data/components/Alert.js} +28 -30
- package/dist/data/components/Alert.js.map +1 -0
- package/dist/data/components/Avatar.d.ts +15 -0
- package/dist/data/components/Avatar.d.ts.map +1 -0
- package/{src/data/components/Avatar.ts → dist/data/components/Avatar.js} +26 -28
- package/dist/data/components/Avatar.js.map +1 -0
- package/dist/data/components/Badge.d.ts +15 -0
- package/dist/data/components/Badge.d.ts.map +1 -0
- package/{src/data/components/Badge.ts → dist/data/components/Badge.js} +16 -15
- package/dist/data/components/Badge.js.map +1 -0
- package/dist/data/components/Breadcrumb.d.ts +15 -0
- package/dist/data/components/Breadcrumb.d.ts.map +1 -0
- package/{src/data/components/Breadcrumb.ts → dist/data/components/Breadcrumb.js} +27 -29
- package/dist/data/components/Breadcrumb.js.map +1 -0
- package/dist/data/components/Button.d.ts +15 -0
- package/dist/data/components/Button.d.ts.map +1 -0
- package/{src/data/components/Button.ts → dist/data/components/Button.js} +18 -17
- package/dist/data/components/Button.js.map +1 -0
- package/dist/data/components/Card.d.ts +15 -0
- package/dist/data/components/Card.d.ts.map +1 -0
- package/{src/data/components/Card.ts → dist/data/components/Card.js} +16 -15
- package/dist/data/components/Card.js.map +1 -0
- package/dist/data/components/Checkbox.d.ts +15 -0
- package/dist/data/components/Checkbox.d.ts.map +1 -0
- package/{src/data/components/Checkbox.ts → dist/data/components/Checkbox.js} +27 -29
- package/dist/data/components/Checkbox.js.map +1 -0
- package/dist/data/components/Chip.d.ts +15 -0
- package/dist/data/components/Chip.d.ts.map +1 -0
- package/{src/data/components/Chip.ts → dist/data/components/Chip.js} +19 -18
- package/dist/data/components/Chip.js.map +1 -0
- package/dist/data/components/Dialog.d.ts +15 -0
- package/dist/data/components/Dialog.d.ts.map +1 -0
- package/{src/data/components/Dialog.ts → dist/data/components/Dialog.js} +18 -17
- package/dist/data/components/Dialog.js.map +1 -0
- package/dist/data/components/Divider.d.ts +15 -0
- package/dist/data/components/Divider.d.ts.map +1 -0
- package/{src/data/components/Divider.ts → dist/data/components/Divider.js} +26 -28
- package/dist/data/components/Divider.js.map +1 -0
- package/dist/data/components/Icon.d.ts +15 -0
- package/dist/data/components/Icon.d.ts.map +1 -0
- package/{src/data/components/Icon.ts → dist/data/components/Icon.js} +26 -28
- package/dist/data/components/Icon.js.map +1 -0
- package/dist/data/components/Image.d.ts +15 -0
- package/dist/data/components/Image.d.ts.map +1 -0
- package/{src/data/components/Image.ts → dist/data/components/Image.js} +29 -31
- package/dist/data/components/Image.js.map +1 -0
- package/dist/data/components/Input.d.ts +15 -0
- package/dist/data/components/Input.d.ts.map +1 -0
- package/{src/data/components/Input.ts → dist/data/components/Input.js} +20 -19
- package/dist/data/components/Input.js.map +1 -0
- package/dist/data/components/List.d.ts +15 -0
- package/dist/data/components/List.d.ts.map +1 -0
- package/{src/data/components/List.ts → dist/data/components/List.js} +18 -17
- package/dist/data/components/List.js.map +1 -0
- package/dist/data/components/Menu.d.ts +15 -0
- package/dist/data/components/Menu.d.ts.map +1 -0
- package/{src/data/components/Menu.ts → dist/data/components/Menu.js} +27 -29
- package/dist/data/components/Menu.js.map +1 -0
- package/dist/data/components/Popover.d.ts +15 -0
- package/dist/data/components/Popover.d.ts.map +1 -0
- package/{src/data/components/Popover.ts → dist/data/components/Popover.js} +28 -30
- package/dist/data/components/Popover.js.map +1 -0
- package/dist/data/components/Pressable.d.ts +15 -0
- package/dist/data/components/Pressable.d.ts.map +1 -0
- package/{src/data/components/Pressable.ts → dist/data/components/Pressable.js} +27 -29
- package/dist/data/components/Pressable.js.map +1 -0
- package/dist/data/components/Progress.d.ts +15 -0
- package/dist/data/components/Progress.d.ts.map +1 -0
- package/{src/data/components/Progress.ts → dist/data/components/Progress.js} +27 -29
- package/dist/data/components/Progress.js.map +1 -0
- package/dist/data/components/RadioButton.d.ts +15 -0
- package/dist/data/components/RadioButton.d.ts.map +1 -0
- package/{src/data/components/RadioButton.ts → dist/data/components/RadioButton.js} +28 -30
- package/dist/data/components/RadioButton.js.map +1 -0
- package/dist/data/components/SVGImage.d.ts +15 -0
- package/dist/data/components/SVGImage.d.ts.map +1 -0
- package/{src/data/components/SVGImage.ts → dist/data/components/SVGImage.js} +27 -29
- package/dist/data/components/SVGImage.js.map +1 -0
- package/dist/data/components/Screen.d.ts +15 -0
- package/dist/data/components/Screen.d.ts.map +1 -0
- package/{src/data/components/Screen.ts → dist/data/components/Screen.js} +27 -29
- package/dist/data/components/Screen.js.map +1 -0
- package/dist/data/components/Select.d.ts +15 -0
- package/dist/data/components/Select.d.ts.map +1 -0
- package/{src/data/components/Select.ts → dist/data/components/Select.js} +30 -32
- package/dist/data/components/Select.js.map +1 -0
- package/dist/data/components/Skeleton.d.ts +15 -0
- package/dist/data/components/Skeleton.d.ts.map +1 -0
- package/{src/data/components/Skeleton.ts → dist/data/components/Skeleton.js} +27 -29
- package/dist/data/components/Skeleton.js.map +1 -0
- package/dist/data/components/Slider.d.ts +15 -0
- package/dist/data/components/Slider.d.ts.map +1 -0
- package/{src/data/components/Slider.ts → dist/data/components/Slider.js} +31 -33
- package/dist/data/components/Slider.js.map +1 -0
- package/dist/data/components/Switch.d.ts +15 -0
- package/dist/data/components/Switch.d.ts.map +1 -0
- package/{src/data/components/Switch.ts → dist/data/components/Switch.js} +28 -30
- package/dist/data/components/Switch.js.map +1 -0
- package/dist/data/components/TabBar.d.ts +15 -0
- package/dist/data/components/TabBar.d.ts.map +1 -0
- package/{src/data/components/TabBar.ts → dist/data/components/TabBar.js} +27 -29
- package/dist/data/components/TabBar.js.map +1 -0
- package/dist/data/components/Table.d.ts +15 -0
- package/dist/data/components/Table.d.ts.map +1 -0
- package/{src/data/components/Table.ts → dist/data/components/Table.js} +29 -31
- package/dist/data/components/Table.js.map +1 -0
- package/dist/data/components/Tabs.d.ts +15 -0
- package/dist/data/components/Tabs.d.ts.map +1 -0
- package/{src/data/components/Tabs.ts → dist/data/components/Tabs.js} +28 -30
- package/dist/data/components/Tabs.js.map +1 -0
- package/dist/data/components/Text.d.ts +15 -0
- package/dist/data/components/Text.d.ts.map +1 -0
- package/{src/data/components/Text.ts → dist/data/components/Text.js} +27 -29
- package/dist/data/components/Text.js.map +1 -0
- package/dist/data/components/TextArea.d.ts +15 -0
- package/dist/data/components/TextArea.d.ts.map +1 -0
- package/{src/data/components/TextArea.ts → dist/data/components/TextArea.js} +31 -33
- package/dist/data/components/TextArea.js.map +1 -0
- package/dist/data/components/Tooltip.d.ts +15 -0
- package/dist/data/components/Tooltip.d.ts.map +1 -0
- package/{src/data/components/Tooltip.ts → dist/data/components/Tooltip.js} +28 -30
- package/dist/data/components/Tooltip.js.map +1 -0
- package/dist/data/components/Video.d.ts +15 -0
- package/dist/data/components/Video.d.ts.map +1 -0
- package/{src/data/components/Video.ts → dist/data/components/Video.js} +31 -33
- package/dist/data/components/Video.js.map +1 -0
- package/dist/data/components/View.d.ts +15 -0
- package/dist/data/components/View.d.ts.map +1 -0
- package/{src/data/components/View.ts → dist/data/components/View.js} +28 -30
- package/dist/data/components/View.js.map +1 -0
- package/dist/data/components/index.d.ts +37 -0
- package/dist/data/components/index.d.ts.map +1 -0
- package/{src/data/components/index.ts → dist/data/components/index.js} +37 -38
- package/dist/data/components/index.js.map +1 -0
- package/dist/data/framework-guides.d.ts +2 -0
- package/dist/data/framework-guides.d.ts.map +1 -0
- package/{src/data/framework-guides.ts → dist/data/framework-guides.js} +307 -8
- package/dist/data/framework-guides.js.map +1 -0
- package/dist/data/icon-guide.d.ts +2 -0
- package/dist/data/icon-guide.d.ts.map +1 -0
- package/{src/data/icon-guide.ts → dist/data/icon-guide.js} +1 -0
- package/dist/data/icon-guide.js.map +1 -0
- package/dist/data/icons.json +7452 -0
- package/dist/data/navigation-guides.d.ts +2 -0
- package/dist/data/navigation-guides.d.ts.map +1 -0
- package/{src/data/navigation-guides.ts → dist/data/navigation-guides.js} +7 -10
- package/dist/data/navigation-guides.js.map +1 -0
- package/dist/generated/types.json +2556 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -0
- package/dist/tools/get-types.d.ts +26 -0
- package/dist/tools/get-types.d.ts.map +1 -0
- package/dist/tools/get-types.js +123 -0
- package/dist/tools/get-types.js.map +1 -0
- package/package.json +10 -5
- package/ARCHITECTURE.md +0 -313
- package/TYPE-SYSTEM.md +0 -397
- package/scripts/extract-types.ts +0 -71
- package/scripts/type-extractor.ts +0 -286
- package/scripts/validate-examples.ts +0 -142
- package/src/data/cli-commands.ts +0 -103
- package/src/data/icons.json +0 -7452
- package/src/index.ts +0 -653
- package/src/tools/get-types.ts +0 -169
- package/test-client.js +0 -86
- package/tsconfig.examples.json +0 -14
- package/tsconfig.json +0 -20
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import iconsData from "./data/icons.json" with { type: "json" };
|
|
|
11
11
|
import { getComponentTypes, getThemeTypes, getNavigationTypes, getAvailableComponents, getComponentExamples, } from "./tools/get-types.js";
|
|
12
12
|
const server = new Server({
|
|
13
13
|
name: "@idealyst/mcp-server",
|
|
14
|
-
version: "1.0.
|
|
14
|
+
version: "1.0.92",
|
|
15
15
|
}, {
|
|
16
16
|
capabilities: {
|
|
17
17
|
tools: {},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,SAAS,MAAM,mBAAmB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EACL,iBAAiB,EACjB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,QAAQ;CAClB,EACD;IACE,YAAY,EAAE;QACZ,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,EAAE;KACd;CACF,CACF,CAAC;AAEF,2BAA2B;AAC3B,MAAM,CAAC,iBAAiB,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;IAC1D,OAAO;QAC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UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;AACxD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get Types Tool
|
|
3
|
+
*
|
|
4
|
+
* Returns TypeScript type definitions for Idealyst components, theme, and navigation.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get component types by name
|
|
8
|
+
*/
|
|
9
|
+
export declare function getComponentTypes(componentName: string, format?: 'typescript' | 'json' | 'both'): any;
|
|
10
|
+
/**
|
|
11
|
+
* Get theme types
|
|
12
|
+
*/
|
|
13
|
+
export declare function getThemeTypes(format?: 'typescript' | 'json' | 'both'): any;
|
|
14
|
+
/**
|
|
15
|
+
* Get navigation types
|
|
16
|
+
*/
|
|
17
|
+
export declare function getNavigationTypes(format?: 'typescript' | 'json' | 'both'): any;
|
|
18
|
+
/**
|
|
19
|
+
* Get list of all available components
|
|
20
|
+
*/
|
|
21
|
+
export declare function getAvailableComponents(): string[];
|
|
22
|
+
/**
|
|
23
|
+
* Get examples for a component
|
|
24
|
+
*/
|
|
25
|
+
export declare function getComponentExamples(componentName: string): string | null;
|
|
26
|
+
//# sourceMappingURL=get-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-types.d.ts","sourceRoot":"","sources":["../../src/tools/get-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAyCH;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,GAAE,YAAY,GAAG,MAAM,GAAG,MAAe,OA2BvG;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,GAAE,YAAY,GAAG,MAAM,GAAG,MAAe,OAmB5E;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,GAAE,YAAY,GAAG,MAAM,GAAG,MAAe,OAmBjF;AAuBD;;GAEG;AACH,wBAAgB,sBAAsB,aAGrC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWzE"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get Types Tool
|
|
3
|
+
*
|
|
4
|
+
* Returns TypeScript type definitions for Idealyst components, theme, and navigation.
|
|
5
|
+
*/
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import { fileURLToPath } from 'url';
|
|
9
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
+
const __dirname = path.dirname(__filename);
|
|
11
|
+
let cachedTypes = null;
|
|
12
|
+
/**
|
|
13
|
+
* Load extracted types from JSON file
|
|
14
|
+
*/
|
|
15
|
+
function loadTypes() {
|
|
16
|
+
if (cachedTypes) {
|
|
17
|
+
return cachedTypes;
|
|
18
|
+
}
|
|
19
|
+
const typesPath = path.join(__dirname, '../generated/types.json');
|
|
20
|
+
if (!fs.existsSync(typesPath)) {
|
|
21
|
+
throw new Error('Types file not found. Please run "yarn extract-types" to generate type definitions.');
|
|
22
|
+
}
|
|
23
|
+
const content = fs.readFileSync(typesPath, 'utf-8');
|
|
24
|
+
cachedTypes = JSON.parse(content);
|
|
25
|
+
return cachedTypes;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get component types by name
|
|
29
|
+
*/
|
|
30
|
+
export function getComponentTypes(componentName, format = 'both') {
|
|
31
|
+
const types = loadTypes();
|
|
32
|
+
const component = types.components[componentName];
|
|
33
|
+
if (!component) {
|
|
34
|
+
throw new Error(`Component "${componentName}" not found. Available components: ${Object.keys(types.components).join(', ')}`);
|
|
35
|
+
}
|
|
36
|
+
const result = {
|
|
37
|
+
component: componentName,
|
|
38
|
+
};
|
|
39
|
+
if (format === 'typescript' || format === 'both') {
|
|
40
|
+
result.typescript = formatTypeScriptOutput(component);
|
|
41
|
+
}
|
|
42
|
+
if (format === 'json' || format === 'both') {
|
|
43
|
+
result.schema = {
|
|
44
|
+
propsInterface: component.propsInterface,
|
|
45
|
+
props: component.props,
|
|
46
|
+
relatedTypes: component.relatedTypes,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get theme types
|
|
53
|
+
*/
|
|
54
|
+
export function getThemeTypes(format = 'both') {
|
|
55
|
+
const types = loadTypes();
|
|
56
|
+
const result = {
|
|
57
|
+
name: 'Theme Types',
|
|
58
|
+
};
|
|
59
|
+
if (format === 'typescript' || format === 'both') {
|
|
60
|
+
const tsOutput = Object.entries(types.theme)
|
|
61
|
+
.map(([name, info]) => info.definition)
|
|
62
|
+
.join('\n\n');
|
|
63
|
+
result.typescript = tsOutput;
|
|
64
|
+
}
|
|
65
|
+
if (format === 'json' || format === 'both') {
|
|
66
|
+
result.schema = types.theme;
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Get navigation types
|
|
72
|
+
*/
|
|
73
|
+
export function getNavigationTypes(format = 'both') {
|
|
74
|
+
const types = loadTypes();
|
|
75
|
+
const result = {
|
|
76
|
+
name: 'Navigation Types',
|
|
77
|
+
};
|
|
78
|
+
if (format === 'typescript' || format === 'both') {
|
|
79
|
+
const tsOutput = Object.entries(types.navigation)
|
|
80
|
+
.map(([name, definition]) => definition)
|
|
81
|
+
.join('\n\n');
|
|
82
|
+
result.typescript = tsOutput;
|
|
83
|
+
}
|
|
84
|
+
if (format === 'json' || format === 'both') {
|
|
85
|
+
result.schema = types.navigation;
|
|
86
|
+
}
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Format TypeScript output for better readability
|
|
91
|
+
*/
|
|
92
|
+
function formatTypeScriptOutput(component) {
|
|
93
|
+
const sections = [];
|
|
94
|
+
// Main props interface
|
|
95
|
+
sections.push(`// ${component.propsInterface}`);
|
|
96
|
+
sections.push(component.typeDefinition);
|
|
97
|
+
// Related types
|
|
98
|
+
if (Object.keys(component.relatedTypes).length > 0) {
|
|
99
|
+
sections.push('\n// Related Types');
|
|
100
|
+
for (const [name, definition] of Object.entries(component.relatedTypes)) {
|
|
101
|
+
sections.push(definition);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return sections.join('\n\n');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Get list of all available components
|
|
108
|
+
*/
|
|
109
|
+
export function getAvailableComponents() {
|
|
110
|
+
const types = loadTypes();
|
|
111
|
+
return Object.keys(types.components);
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get examples for a component
|
|
115
|
+
*/
|
|
116
|
+
export function getComponentExamples(componentName) {
|
|
117
|
+
const examplesPath = path.join(__dirname, `../../examples/components/${componentName}.examples.tsx`);
|
|
118
|
+
if (!fs.existsSync(examplesPath)) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return fs.readFileSync(examplesPath, 'utf-8');
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=get-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-types.js","sourceRoot":"","sources":["../../src/tools/get-types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AAEpC,M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I,CAC5B,SAAS,EACT,6BAA6B,aAAa,eAAe,CAC1D,CAAC;IAEF,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.94",
|
|
4
4
|
"description": "MCP server providing documentation and examples for the Idealyst framework",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"idealyst-mcp": "./dist/index.js"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/**/*",
|
|
12
|
+
"examples/**/*",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
10
15
|
"scripts": {
|
|
11
16
|
"extract-types": "tsx scripts/extract-types.ts",
|
|
12
17
|
"validate-examples": "tsx scripts/validate-examples.ts",
|
|
@@ -29,9 +34,9 @@
|
|
|
29
34
|
"author": "Idealyst",
|
|
30
35
|
"license": "MIT",
|
|
31
36
|
"dependencies": {
|
|
32
|
-
"@idealyst/components": "^1.0.
|
|
33
|
-
"@idealyst/navigation": "^1.0.
|
|
34
|
-
"@idealyst/theme": "^1.0.
|
|
37
|
+
"@idealyst/components": "^1.0.93",
|
|
38
|
+
"@idealyst/navigation": "^1.0.93",
|
|
39
|
+
"@idealyst/theme": "^1.0.93",
|
|
35
40
|
"@modelcontextprotocol/sdk": "^1.0.4"
|
|
36
41
|
},
|
|
37
42
|
"devDependencies": {
|
|
@@ -44,4 +49,4 @@
|
|
|
44
49
|
"tsx": "^4.7.0",
|
|
45
50
|
"typescript": "^5.0.0"
|
|
46
51
|
}
|
|
47
|
-
}
|
|
52
|
+
}
|
package/ARCHITECTURE.md
DELETED
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
# MCP Server Type-Driven Architecture
|
|
2
|
-
|
|
3
|
-
## Problem Statement
|
|
4
|
-
|
|
5
|
-
The MCP server documentation is manually maintained and has drifted from the actual TypeScript type definitions in `@idealyst/components` and `@idealyst/theme`. This causes:
|
|
6
|
-
- Incorrect prop names and values in documentation
|
|
7
|
-
- TypeScript compilation errors when using documented examples
|
|
8
|
-
- High maintenance burden to keep docs in sync
|
|
9
|
-
- Loss of developer trust
|
|
10
|
-
|
|
11
|
-
## Solution: Type-Driven Documentation System
|
|
12
|
-
|
|
13
|
-
### Architecture Overview
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
┌─────────────────────────────────────────────────────────┐
|
|
17
|
-
│ @idealyst/components & @idealyst/theme (Source of Truth)│
|
|
18
|
-
│ - Button/types.ts │
|
|
19
|
-
│ - Card/types.ts │
|
|
20
|
-
│ - theme/size.ts (Size type) │
|
|
21
|
-
│ - theme/intent.ts (Intent type) │
|
|
22
|
-
└────────────────┬────────────────────────────────────────┘
|
|
23
|
-
│
|
|
24
|
-
▼
|
|
25
|
-
┌─────────────────────────────────────────────────────────┐
|
|
26
|
-
│ Build-Time Type Extraction (packages/mcp-server/build) │
|
|
27
|
-
│ - extract-types.ts │
|
|
28
|
-
│ • Uses TypeScript Compiler API │
|
|
29
|
-
│ • Parses all component types.ts files │
|
|
30
|
-
│ • Extracts Size, Intent, Color from theme │
|
|
31
|
-
│ • Generates JSON schema │
|
|
32
|
-
│ - validate-examples.ts │
|
|
33
|
-
│ • Validates all examples against extracted types │
|
|
34
|
-
│ • Fails build if examples have type errors │
|
|
35
|
-
└────────────────┬────────────────────────────────────────┘
|
|
36
|
-
│
|
|
37
|
-
▼
|
|
38
|
-
┌─────────────────────────────────────────────────────────┐
|
|
39
|
-
│ Generated Type Definitions (auto-generated) │
|
|
40
|
-
│ - src/generated/types.json │
|
|
41
|
-
│ { │
|
|
42
|
-
│ "Button": { │
|
|
43
|
-
│ "props": { │
|
|
44
|
-
│ "type": { "type": "ButtonType", "values": [...]}│
|
|
45
|
-
│ "size": { "type": "Size", "values": ["xs",...] │
|
|
46
|
-
│ "leftIcon": { "type": "IconName | ReactNode" } │
|
|
47
|
-
│ } │
|
|
48
|
-
│ } │
|
|
49
|
-
│ } │
|
|
50
|
-
└────────────────┬────────────────────────────────────────┘
|
|
51
|
-
│
|
|
52
|
-
▼
|
|
53
|
-
┌─────────────────────────────────────────────────────────┐
|
|
54
|
-
│ MCP Server Runtime │
|
|
55
|
-
│ - New Tool: get_component_types(componentName) │
|
|
56
|
-
│ Returns: Raw TypeScript interface + extracted JSON │
|
|
57
|
-
│ │
|
|
58
|
-
│ - Enhanced Tool: get_component_docs(componentName) │
|
|
59
|
-
│ Generates docs from types.json + manual content │
|
|
60
|
-
│ │
|
|
61
|
-
│ - Validated Examples │
|
|
62
|
-
│ All examples are TypeScript-validated at build time │
|
|
63
|
-
└─────────────────────────────────────────────────────────┘
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Implementation Phases
|
|
67
|
-
|
|
68
|
-
#### Phase 1: Add Type Extraction System
|
|
69
|
-
**Files to Create:**
|
|
70
|
-
- `packages/mcp-server/scripts/extract-types.ts`
|
|
71
|
-
- `packages/mcp-server/scripts/validate-examples.ts`
|
|
72
|
-
- `packages/mcp-server/scripts/type-extractor.ts` (utility)
|
|
73
|
-
|
|
74
|
-
**What It Does:**
|
|
75
|
-
- Reads TypeScript type files from components/theme packages
|
|
76
|
-
- Extracts prop definitions, enums, types
|
|
77
|
-
- Generates `src/generated/types.json`
|
|
78
|
-
- Runs as part of MCP server build process
|
|
79
|
-
|
|
80
|
-
#### Phase 2: Add Type Export Tool
|
|
81
|
-
**File to Modify:**
|
|
82
|
-
- `packages/mcp-server/src/index.ts`
|
|
83
|
-
|
|
84
|
-
**New Tool:**
|
|
85
|
-
```typescript
|
|
86
|
-
{
|
|
87
|
-
name: "get_component_types",
|
|
88
|
-
description: "Get TypeScript type definitions for a component",
|
|
89
|
-
inputSchema: {
|
|
90
|
-
type: "object",
|
|
91
|
-
properties: {
|
|
92
|
-
component: { type: "string" },
|
|
93
|
-
format: {
|
|
94
|
-
type: "string",
|
|
95
|
-
enum: ["typescript", "json", "both"],
|
|
96
|
-
description: "typescript=raw .d.ts, json=parsed schema, both=combined"
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
**Returns:**
|
|
104
|
-
```typescript
|
|
105
|
-
{
|
|
106
|
-
component: "Button",
|
|
107
|
-
typescript: `export interface ButtonProps {
|
|
108
|
-
type?: 'contained' | 'outlined' | 'text';
|
|
109
|
-
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
110
|
-
// ...
|
|
111
|
-
}`,
|
|
112
|
-
schema: {
|
|
113
|
-
props: {
|
|
114
|
-
type: { type: "ButtonType", values: ["contained", "outlined", "text"] },
|
|
115
|
-
size: { type: "Size", values: ["xs", "sm", "md", "lg", "xl"] }
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
#### Phase 3: Refactor Documentation Generation
|
|
122
|
-
**Files to Modify:**
|
|
123
|
-
- `packages/mcp-server/src/data/components/*.ts`
|
|
124
|
-
|
|
125
|
-
**New Structure:**
|
|
126
|
-
```typescript
|
|
127
|
-
// Button.ts
|
|
128
|
-
import buttonTypes from '../../generated/types.json';
|
|
129
|
-
|
|
130
|
-
export const Button = {
|
|
131
|
-
category: "form",
|
|
132
|
-
description: "Interactive button component...",
|
|
133
|
-
|
|
134
|
-
// Props are now auto-generated from types.json
|
|
135
|
-
// Manual override only for additional context
|
|
136
|
-
propsOverride: {
|
|
137
|
-
leftIcon: "Icon to display on the left. Supports icon names (e.g., 'check') or custom React elements"
|
|
138
|
-
},
|
|
139
|
-
|
|
140
|
-
// Types come from extracted schema
|
|
141
|
-
types: buttonTypes.Button,
|
|
142
|
-
|
|
143
|
-
features: [...],
|
|
144
|
-
bestPractices: [...],
|
|
145
|
-
|
|
146
|
-
examples: {
|
|
147
|
-
basic: `...`,
|
|
148
|
-
// Examples are validated at build time
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
#### Phase 4: Add Validation Testing
|
|
154
|
-
**Files to Create:**
|
|
155
|
-
- `packages/mcp-server/tests/type-accuracy.test.ts`
|
|
156
|
-
- `packages/mcp-server/tests/example-validation.test.ts`
|
|
157
|
-
|
|
158
|
-
**Tests:**
|
|
159
|
-
1. Verify extracted types match source files
|
|
160
|
-
2. Validate all examples compile with TypeScript
|
|
161
|
-
3. Check that documentation prop names exist in types
|
|
162
|
-
4. Ensure enum values in docs match type definitions
|
|
163
|
-
|
|
164
|
-
### Developer Experience Improvements
|
|
165
|
-
|
|
166
|
-
#### For Component Library Developers
|
|
167
|
-
- Change types in `@idealyst/components` → Types auto-update in MCP docs
|
|
168
|
-
- Build fails if examples become invalid
|
|
169
|
-
- No manual documentation sync required
|
|
170
|
-
|
|
171
|
-
#### For AI Assistants (Claude, etc.)
|
|
172
|
-
- Can request raw TypeScript types: `get_component_types("Button", "typescript")`
|
|
173
|
-
- Can get both human docs + machine-readable schema
|
|
174
|
-
- Examples are guaranteed to be type-correct
|
|
175
|
-
|
|
176
|
-
#### For End Users
|
|
177
|
-
- Generated code works on first try
|
|
178
|
-
- No more "property doesn't exist" errors
|
|
179
|
-
- Documentation always matches reality
|
|
180
|
-
|
|
181
|
-
### Migration Strategy
|
|
182
|
-
|
|
183
|
-
#### Step 1: Extract Types (Non-Breaking)
|
|
184
|
-
Add type extraction as opt-in feature, keep current docs working
|
|
185
|
-
|
|
186
|
-
#### Step 2: Validate Examples (Breaking if invalid)
|
|
187
|
-
Add example validation, fix any broken examples
|
|
188
|
-
|
|
189
|
-
#### Step 3: Generate Props Docs (Enhancement)
|
|
190
|
-
Auto-generate prop documentation from types, merge with manual overrides
|
|
191
|
-
|
|
192
|
-
#### Step 4: Add Type Export Tool (New Feature)
|
|
193
|
-
Add new MCP tool for direct type access
|
|
194
|
-
|
|
195
|
-
### File Structure
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
packages/mcp-server/
|
|
199
|
-
├── scripts/
|
|
200
|
-
│ ├── extract-types.ts # Main extraction script
|
|
201
|
-
│ ├── validate-examples.ts # Example validation
|
|
202
|
-
│ └── type-extractor.ts # Shared utilities
|
|
203
|
-
├── src/
|
|
204
|
-
│ ├── generated/
|
|
205
|
-
│ │ ├── types.json # Auto-generated type schemas
|
|
206
|
-
│ │ └── types.d.ts # TypeScript definitions
|
|
207
|
-
│ ├── data/
|
|
208
|
-
│ │ └── components/
|
|
209
|
-
│ │ ├── Button.ts # Now references types.json
|
|
210
|
-
│ │ └── ...
|
|
211
|
-
│ ├── tools/
|
|
212
|
-
│ │ ├── get-types.ts # New type export tool
|
|
213
|
-
│ │ └── ...
|
|
214
|
-
│ └── index.ts
|
|
215
|
-
├── tests/
|
|
216
|
-
│ ├── type-accuracy.test.ts # Validation tests
|
|
217
|
-
│ └── example-validation.test.ts
|
|
218
|
-
└── package.json # Add build scripts
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
### Required Dependencies
|
|
222
|
-
|
|
223
|
-
```json
|
|
224
|
-
{
|
|
225
|
-
"devDependencies": {
|
|
226
|
-
"typescript": "^5.0.0",
|
|
227
|
-
"ts-morph": "^21.0.0", // TypeScript Compiler API wrapper
|
|
228
|
-
"@types/node": "^20.0.0"
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Build Process
|
|
234
|
-
|
|
235
|
-
```json
|
|
236
|
-
{
|
|
237
|
-
"scripts": {
|
|
238
|
-
"extract-types": "tsx scripts/extract-types.ts",
|
|
239
|
-
"validate-examples": "tsx scripts/validate-examples.ts",
|
|
240
|
-
"prebuild": "yarn extract-types && yarn validate-examples",
|
|
241
|
-
"build": "tsc && chmod +x dist/index.js"
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
### CI/CD Integration
|
|
247
|
-
|
|
248
|
-
```yaml
|
|
249
|
-
# .github/workflows/validate-mcp.yml
|
|
250
|
-
name: Validate MCP Documentation
|
|
251
|
-
|
|
252
|
-
on: [push, pull_request]
|
|
253
|
-
|
|
254
|
-
jobs:
|
|
255
|
-
validate:
|
|
256
|
-
runs-on: ubuntu-latest
|
|
257
|
-
steps:
|
|
258
|
-
- uses: actions/checkout@v3
|
|
259
|
-
- name: Install dependencies
|
|
260
|
-
run: yarn install
|
|
261
|
-
- name: Extract types
|
|
262
|
-
run: yarn extract-types
|
|
263
|
-
- name: Validate examples
|
|
264
|
-
run: yarn validate-examples
|
|
265
|
-
- name: Build
|
|
266
|
-
run: yarn build
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
## Benefits
|
|
270
|
-
|
|
271
|
-
### Accuracy
|
|
272
|
-
✅ Types are always correct (single source of truth)
|
|
273
|
-
✅ Examples are validated at build time
|
|
274
|
-
✅ No manual synchronization needed
|
|
275
|
-
|
|
276
|
-
### Developer Experience
|
|
277
|
-
✅ AI assistants can access raw TypeScript types
|
|
278
|
-
✅ Documentation is always up-to-date
|
|
279
|
-
✅ Type-correct code generation
|
|
280
|
-
|
|
281
|
-
### Maintenance
|
|
282
|
-
✅ Reduced manual work
|
|
283
|
-
✅ Automated validation prevents drift
|
|
284
|
-
✅ Clear error messages when examples break
|
|
285
|
-
|
|
286
|
-
### Scalability
|
|
287
|
-
✅ Adding new components is easier
|
|
288
|
-
✅ Type changes propagate automatically
|
|
289
|
-
✅ Multi-package support (components, navigation, theme)
|
|
290
|
-
|
|
291
|
-
## Next Steps
|
|
292
|
-
|
|
293
|
-
1. **Immediate**: Fix current documentation issues manually
|
|
294
|
-
2. **Short-term**: Implement type extraction system (Phase 1)
|
|
295
|
-
3. **Medium-term**: Add validation and type export tool (Phases 2-3)
|
|
296
|
-
4. **Long-term**: Full migration to auto-generated docs (Phase 4)
|
|
297
|
-
|
|
298
|
-
## Questions & Considerations
|
|
299
|
-
|
|
300
|
-
### Q: What about documentation that isn't in types?
|
|
301
|
-
A: Keep manual content for features, best practices, and examples. Auto-generate only the prop definitions.
|
|
302
|
-
|
|
303
|
-
### Q: How do we handle custom types that aren't exported?
|
|
304
|
-
A: Type extractor can be configured to follow type references and extract related types.
|
|
305
|
-
|
|
306
|
-
### Q: What about web vs native differences?
|
|
307
|
-
A: Extract from both `.web.tsx` and `.native.tsx` type files, mark platform-specific props.
|
|
308
|
-
|
|
309
|
-
### Q: Performance impact of type extraction?
|
|
310
|
-
A: Runs at build time only, not at runtime. No performance impact on MCP server.
|
|
311
|
-
|
|
312
|
-
### Q: What if TypeScript types are too complex to display?
|
|
313
|
-
A: Provide both raw TypeScript (for AI/tools) and simplified JSON schema (for humans).
|