@idealyst/mcp-server 1.0.86 → 1.0.88
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/ARCHITECTURE.md +313 -0
- package/README.md +292 -104
- package/TYPE-SYSTEM.md +397 -0
- package/dist/index.js +170 -1
- package/examples/components/Accordion.examples.tsx +147 -0
- package/examples/components/ActivityIndicator.examples.tsx +350 -0
- package/examples/components/Alert.examples.tsx +335 -0
- package/examples/components/Avatar.examples.tsx +188 -0
- package/examples/components/Badge.examples.tsx +242 -0
- package/examples/components/Breadcrumb.examples.tsx +303 -0
- package/examples/components/Button.examples.tsx +113 -0
- package/examples/components/Card.examples.tsx +131 -0
- package/examples/components/Checkbox.examples.tsx +195 -0
- package/examples/components/Chip.examples.tsx +87 -0
- package/examples/components/Dialog.examples.tsx +344 -0
- package/examples/components/Divider.examples.tsx +258 -0
- package/examples/components/Icon.examples.tsx +202 -0
- package/examples/components/Input.examples.tsx +205 -0
- package/examples/components/Menu.examples.tsx +321 -0
- package/examples/components/Popover.examples.tsx +439 -0
- package/examples/components/Progress.examples.tsx +340 -0
- package/examples/components/RadioButton.examples.tsx +443 -0
- package/examples/components/Screen.examples.tsx +347 -0
- package/examples/components/Select.examples.tsx +279 -0
- package/examples/components/Skeleton.examples.tsx +278 -0
- package/examples/components/Slider.examples.tsx +249 -0
- package/examples/components/Switch.examples.tsx +94 -0
- package/examples/components/TabBar.examples.tsx +356 -0
- package/examples/components/Text.examples.tsx +177 -0
- package/examples/components/TextArea.examples.tsx +203 -0
- package/examples/components/Tooltip.examples.tsx +318 -0
- package/examples/components/View.examples.tsx +307 -0
- package/package.json +15 -2
- package/scripts/extract-types.ts +71 -0
- package/scripts/type-extractor.ts +286 -0
- package/scripts/validate-examples.ts +142 -0
- package/src/data/components/Icon.ts +1 -1
- package/src/data/components/index.ts +2 -0
- package/src/index.ts +181 -1
- package/src/tools/get-types.ts +169 -0
- package/tsconfig.examples.json +14 -0
- package/dist/data/cli-commands.d.ts +0 -2
- package/dist/data/cli-commands.d.ts.map +0 -1
- package/dist/data/cli-commands.js +0 -100
- package/dist/data/cli-commands.js.map +0 -1
- package/dist/data/components/Accordion.d.ts +0 -15
- package/dist/data/components/Accordion.d.ts.map +0 -1
- package/dist/data/components/Accordion.js +0 -112
- package/dist/data/components/Accordion.js.map +0 -1
- package/dist/data/components/ActivityIndicator.d.ts +0 -15
- package/dist/data/components/ActivityIndicator.d.ts.map +0 -1
- package/dist/data/components/ActivityIndicator.js +0 -82
- package/dist/data/components/ActivityIndicator.js.map +0 -1
- package/dist/data/components/Alert.d.ts +0 -15
- package/dist/data/components/Alert.d.ts.map +0 -1
- package/dist/data/components/Alert.js +0 -132
- package/dist/data/components/Alert.js.map +0 -1
- package/dist/data/components/Avatar.d.ts +0 -15
- package/dist/data/components/Avatar.d.ts.map +0 -1
- package/dist/data/components/Avatar.js +0 -93
- package/dist/data/components/Avatar.js.map +0 -1
- package/dist/data/components/Badge.d.ts +0 -15
- package/dist/data/components/Badge.d.ts.map +0 -1
- package/dist/data/components/Badge.js +0 -64
- package/dist/data/components/Badge.js.map +0 -1
- package/dist/data/components/Breadcrumb.d.ts +0 -15
- package/dist/data/components/Breadcrumb.d.ts.map +0 -1
- package/dist/data/components/Breadcrumb.js +0 -96
- package/dist/data/components/Breadcrumb.js.map +0 -1
- package/dist/data/components/Button.d.ts +0 -15
- package/dist/data/components/Button.d.ts.map +0 -1
- package/dist/data/components/Button.js +0 -87
- package/dist/data/components/Button.js.map +0 -1
- package/dist/data/components/Card.d.ts +0 -15
- package/dist/data/components/Card.d.ts.map +0 -1
- package/dist/data/components/Card.js +0 -67
- package/dist/data/components/Card.js.map +0 -1
- package/dist/data/components/Checkbox.d.ts +0 -15
- package/dist/data/components/Checkbox.d.ts.map +0 -1
- package/dist/data/components/Checkbox.js +0 -118
- package/dist/data/components/Checkbox.js.map +0 -1
- package/dist/data/components/Chip.d.ts +0 -15
- package/dist/data/components/Chip.d.ts.map +0 -1
- package/dist/data/components/Chip.js +0 -76
- package/dist/data/components/Chip.js.map +0 -1
- package/dist/data/components/Dialog.d.ts +0 -15
- package/dist/data/components/Dialog.d.ts.map +0 -1
- package/dist/data/components/Dialog.js +0 -137
- package/dist/data/components/Dialog.js.map +0 -1
- package/dist/data/components/Divider.d.ts +0 -15
- package/dist/data/components/Divider.d.ts.map +0 -1
- package/dist/data/components/Divider.js +0 -71
- package/dist/data/components/Divider.js.map +0 -1
- package/dist/data/components/Icon.d.ts +0 -15
- package/dist/data/components/Icon.d.ts.map +0 -1
- package/dist/data/components/Icon.js +0 -70
- package/dist/data/components/Icon.js.map +0 -1
- package/dist/data/components/Image.d.ts +0 -15
- package/dist/data/components/Image.d.ts.map +0 -1
- package/dist/data/components/Image.js +0 -122
- package/dist/data/components/Image.js.map +0 -1
- package/dist/data/components/Input.d.ts +0 -15
- package/dist/data/components/Input.d.ts.map +0 -1
- package/dist/data/components/Input.js +0 -109
- package/dist/data/components/Input.js.map +0 -1
- package/dist/data/components/List.d.ts +0 -15
- package/dist/data/components/List.d.ts.map +0 -1
- package/dist/data/components/List.js +0 -113
- package/dist/data/components/List.js.map +0 -1
- package/dist/data/components/Menu.d.ts +0 -15
- package/dist/data/components/Menu.d.ts.map +0 -1
- package/dist/data/components/Menu.js +0 -132
- package/dist/data/components/Menu.js.map +0 -1
- package/dist/data/components/Popover.d.ts +0 -15
- package/dist/data/components/Popover.d.ts.map +0 -1
- package/dist/data/components/Popover.js +0 -159
- package/dist/data/components/Popover.js.map +0 -1
- package/dist/data/components/Pressable.d.ts +0 -15
- package/dist/data/components/Pressable.d.ts.map +0 -1
- package/dist/data/components/Pressable.js +0 -125
- package/dist/data/components/Pressable.js.map +0 -1
- package/dist/data/components/Progress.d.ts +0 -15
- package/dist/data/components/Progress.d.ts.map +0 -1
- package/dist/data/components/Progress.js +0 -95
- package/dist/data/components/Progress.js.map +0 -1
- package/dist/data/components/RadioButton.d.ts +0 -15
- package/dist/data/components/RadioButton.d.ts.map +0 -1
- package/dist/data/components/RadioButton.js +0 -140
- package/dist/data/components/RadioButton.js.map +0 -1
- package/dist/data/components/SVGImage.d.ts +0 -15
- package/dist/data/components/SVGImage.d.ts.map +0 -1
- package/dist/data/components/SVGImage.js +0 -112
- package/dist/data/components/SVGImage.js.map +0 -1
- package/dist/data/components/Screen.d.ts +0 -15
- package/dist/data/components/Screen.d.ts.map +0 -1
- package/dist/data/components/Screen.js +0 -99
- package/dist/data/components/Screen.js.map +0 -1
- package/dist/data/components/Select.d.ts +0 -15
- package/dist/data/components/Select.d.ts.map +0 -1
- package/dist/data/components/Select.js +0 -146
- package/dist/data/components/Select.js.map +0 -1
- package/dist/data/components/Skeleton.d.ts +0 -15
- package/dist/data/components/Skeleton.d.ts.map +0 -1
- package/dist/data/components/Skeleton.js +0 -110
- package/dist/data/components/Skeleton.js.map +0 -1
- package/dist/data/components/Slider.d.ts +0 -15
- package/dist/data/components/Slider.d.ts.map +0 -1
- package/dist/data/components/Slider.js +0 -129
- package/dist/data/components/Slider.js.map +0 -1
- package/dist/data/components/Switch.d.ts +0 -15
- package/dist/data/components/Switch.d.ts.map +0 -1
- package/dist/data/components/Switch.js +0 -127
- package/dist/data/components/Switch.js.map +0 -1
- package/dist/data/components/TabBar.d.ts +0 -15
- package/dist/data/components/TabBar.d.ts.map +0 -1
- package/dist/data/components/TabBar.js +0 -145
- package/dist/data/components/TabBar.js.map +0 -1
- package/dist/data/components/Table.d.ts +0 -15
- package/dist/data/components/Table.d.ts.map +0 -1
- package/dist/data/components/Table.js +0 -151
- package/dist/data/components/Table.js.map +0 -1
- package/dist/data/components/Tabs.d.ts +0 -15
- package/dist/data/components/Tabs.d.ts.map +0 -1
- package/dist/data/components/Tabs.js +0 -150
- package/dist/data/components/Tabs.js.map +0 -1
- package/dist/data/components/Text.d.ts +0 -15
- package/dist/data/components/Text.d.ts.map +0 -1
- package/dist/data/components/Text.js +0 -85
- package/dist/data/components/Text.js.map +0 -1
- package/dist/data/components/TextArea.d.ts +0 -15
- package/dist/data/components/TextArea.d.ts.map +0 -1
- package/dist/data/components/TextArea.js +0 -155
- package/dist/data/components/TextArea.js.map +0 -1
- package/dist/data/components/Tooltip.d.ts +0 -15
- package/dist/data/components/Tooltip.d.ts.map +0 -1
- package/dist/data/components/Tooltip.js +0 -105
- package/dist/data/components/Tooltip.js.map +0 -1
- package/dist/data/components/Video.d.ts +0 -15
- package/dist/data/components/Video.d.ts.map +0 -1
- package/dist/data/components/Video.js +0 -168
- package/dist/data/components/Video.js.map +0 -1
- package/dist/data/components/View.d.ts +0 -15
- package/dist/data/components/View.d.ts.map +0 -1
- package/dist/data/components/View.js +0 -126
- package/dist/data/components/View.js.map +0 -1
- package/dist/data/components/index.d.ts +0 -37
- package/dist/data/components/index.d.ts.map +0 -1
- package/dist/data/components/index.js +0 -110
- package/dist/data/components/index.js.map +0 -1
- package/dist/data/framework-guides.d.ts +0 -2
- package/dist/data/framework-guides.d.ts.map +0 -1
- package/dist/data/framework-guides.js +0 -589
- package/dist/data/framework-guides.js.map +0 -1
- package/dist/data/icon-guide.d.ts +0 -2
- package/dist/data/icon-guide.d.ts.map +0 -1
- package/dist/data/icon-guide.js +0 -285
- package/dist/data/icon-guide.js.map +0 -1
- package/dist/data/icons.json +0 -7452
- package/dist/data/navigation-guides.d.ts +0 -2
- package/dist/data/navigation-guides.d.ts.map +0 -1
- package/dist/data/navigation-guides.js +0 -1196
- package/dist/data/navigation-guides.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,33 +1,68 @@
|
|
|
1
1
|
# @idealyst/mcp-server
|
|
2
2
|
|
|
3
|
-
Model Context Protocol
|
|
3
|
+
> Model Context Protocol server for the Idealyst Framework
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Provides AI assistants like Claude Code with access to accurate, type-checked documentation and examples for Idealyst components, theme, and navigation.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Features
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
9
|
+
- 🔍 **Type-Driven Documentation**: Extract TypeScript types directly from source packages
|
|
10
|
+
- ✅ **Validated Examples**: All examples are type-checked and guaranteed to compile
|
|
11
|
+
- 🎨 **Theme Type Access**: Get Size, Intent, Color, and other theme types
|
|
12
|
+
- 🧭 **Navigation Types**: Access to routing and navigator type definitions
|
|
13
|
+
- 🔎 **Icon Search**: Search through 7,447 Material Design Icons
|
|
14
|
+
- 📚 **Component Docs**: Detailed documentation with props, usage, and best practices
|
|
13
15
|
|
|
14
16
|
## Installation
|
|
15
17
|
|
|
16
|
-
|
|
17
|
-
# From the Idealyst monorepo
|
|
18
|
-
cd packages/mcp-server
|
|
19
|
-
yarn install
|
|
20
|
-
yarn build
|
|
18
|
+
### Global Installation
|
|
21
19
|
|
|
22
|
-
|
|
20
|
+
```bash
|
|
23
21
|
npm install -g @idealyst/mcp-server
|
|
24
22
|
```
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
### Project Installation
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install --save-dev @idealyst/mcp-server
|
|
28
|
+
# or
|
|
29
|
+
yarn add -D @idealyst/mcp-server
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage with Claude Code
|
|
33
|
+
|
|
34
|
+
### Project-Level Configuration
|
|
35
|
+
|
|
36
|
+
Add to your project's `.mcp.json`:
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"idealyst": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["@idealyst/mcp-server"]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### User-Level Configuration
|
|
50
|
+
|
|
51
|
+
Add to `~/.config/claude-code/mcp_config.json`:
|
|
52
|
+
|
|
53
|
+
```json
|
|
54
|
+
{
|
|
55
|
+
"mcpServers": {
|
|
56
|
+
"idealyst": {
|
|
57
|
+
"command": "idealyst-mcp"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
```
|
|
27
62
|
|
|
28
|
-
|
|
63
|
+
### Claude Desktop Configuration
|
|
29
64
|
|
|
30
|
-
|
|
65
|
+
#### macOS/Linux
|
|
31
66
|
|
|
32
67
|
Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
33
68
|
|
|
@@ -35,16 +70,14 @@ Edit `~/Library/Application Support/Claude/claude_desktop_config.json`:
|
|
|
35
70
|
{
|
|
36
71
|
"mcpServers": {
|
|
37
72
|
"idealyst": {
|
|
38
|
-
"command": "
|
|
39
|
-
"args": [
|
|
40
|
-
"/absolute/path/to/idealyst-framework/packages/mcp-server/dist/index.js"
|
|
41
|
-
]
|
|
73
|
+
"command": "npx",
|
|
74
|
+
"args": ["@idealyst/mcp-server"]
|
|
42
75
|
}
|
|
43
76
|
}
|
|
44
77
|
}
|
|
45
78
|
```
|
|
46
79
|
|
|
47
|
-
|
|
80
|
+
#### Windows
|
|
48
81
|
|
|
49
82
|
Edit `%APPDATA%\Claude\claude_desktop_config.json`:
|
|
50
83
|
|
|
@@ -52,151 +85,306 @@ Edit `%APPDATA%\Claude\claude_desktop_config.json`:
|
|
|
52
85
|
{
|
|
53
86
|
"mcpServers": {
|
|
54
87
|
"idealyst": {
|
|
55
|
-
"command": "
|
|
56
|
-
"args": [
|
|
57
|
-
"C:\\path\\to\\idealyst-framework\\packages\\mcp-server\\dist\\index.js"
|
|
58
|
-
]
|
|
88
|
+
"command": "npx",
|
|
89
|
+
"args": ["@idealyst/mcp-server"]
|
|
59
90
|
}
|
|
60
91
|
}
|
|
61
92
|
}
|
|
62
93
|
```
|
|
63
94
|
|
|
64
|
-
After adding the configuration, restart Claude Desktop.
|
|
65
|
-
|
|
66
95
|
## Available Tools
|
|
67
96
|
|
|
68
|
-
###
|
|
97
|
+
### Component Tools
|
|
69
98
|
|
|
70
|
-
|
|
99
|
+
#### `get_component_types`
|
|
71
100
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
101
|
+
Get TypeScript type definitions for a component.
|
|
102
|
+
|
|
103
|
+
```typescript
|
|
104
|
+
{
|
|
105
|
+
component: "Button",
|
|
106
|
+
format: "both" // "typescript" | "json" | "both"
|
|
107
|
+
}
|
|
75
108
|
```
|
|
76
109
|
|
|
77
|
-
|
|
110
|
+
Returns the actual TypeScript interface and/or parsed JSON schema with prop details.
|
|
78
111
|
|
|
79
|
-
|
|
112
|
+
#### `get_component_docs`
|
|
80
113
|
|
|
81
|
-
|
|
82
|
-
- `component` (string): Component name (e.g., 'Button', 'Card', 'Input')
|
|
114
|
+
Get comprehensive documentation for a component including props, usage, features, and best practices.
|
|
83
115
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
116
|
+
```typescript
|
|
117
|
+
{
|
|
118
|
+
component: "Button"
|
|
119
|
+
}
|
|
87
120
|
```
|
|
88
121
|
|
|
89
|
-
|
|
122
|
+
#### `get_component_example`
|
|
90
123
|
|
|
91
|
-
Get
|
|
124
|
+
Get a specific example type for a component.
|
|
92
125
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
126
|
+
```typescript
|
|
127
|
+
{
|
|
128
|
+
component: "Button",
|
|
129
|
+
example_type: "basic" // "basic" | "variants" | "with-icons" | "interactive"
|
|
130
|
+
}
|
|
131
|
+
```
|
|
96
132
|
|
|
97
|
-
|
|
133
|
+
#### `get_component_examples_ts`
|
|
134
|
+
|
|
135
|
+
Get validated TypeScript examples that are guaranteed to compile.
|
|
136
|
+
|
|
137
|
+
```typescript
|
|
138
|
+
{
|
|
139
|
+
component: "Button"
|
|
140
|
+
}
|
|
98
141
|
```
|
|
99
|
-
|
|
142
|
+
|
|
143
|
+
#### `list_components`
|
|
144
|
+
|
|
145
|
+
List all available Idealyst components with descriptions.
|
|
146
|
+
|
|
147
|
+
#### `search_components`
|
|
148
|
+
|
|
149
|
+
Search for components by name, category, or feature.
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
{
|
|
153
|
+
query: "form",
|
|
154
|
+
category: "form" // optional: "layout" | "form" | "display" | "navigation" | "overlay" | "data"
|
|
155
|
+
}
|
|
100
156
|
```
|
|
101
157
|
|
|
102
|
-
###
|
|
158
|
+
### Theme Tools
|
|
103
159
|
|
|
104
|
-
|
|
160
|
+
#### `get_theme_types`
|
|
105
161
|
|
|
106
|
-
|
|
107
|
-
- `command` (optional): Specific CLI command
|
|
162
|
+
Get all theme type definitions (Size, Intent, Color, etc.).
|
|
108
163
|
|
|
109
|
-
|
|
164
|
+
```typescript
|
|
165
|
+
{
|
|
166
|
+
format: "json" // "typescript" | "json" | "both"
|
|
167
|
+
}
|
|
110
168
|
```
|
|
111
|
-
|
|
169
|
+
|
|
170
|
+
### Navigation Tools
|
|
171
|
+
|
|
172
|
+
#### `get_navigation_types`
|
|
173
|
+
|
|
174
|
+
Get navigation type definitions for routers, navigators, and screens.
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
{
|
|
178
|
+
format: "typescript" // "typescript" | "json" | "both"
|
|
179
|
+
}
|
|
112
180
|
```
|
|
113
181
|
|
|
114
|
-
###
|
|
182
|
+
### Icon Tools
|
|
115
183
|
|
|
116
|
-
|
|
184
|
+
#### `search_icons`
|
|
117
185
|
|
|
118
|
-
|
|
119
|
-
- `query` (optional): Search query
|
|
120
|
-
- `category` (optional): Filter by category ('layout', 'form', 'display', 'navigation', 'overlay', 'data')
|
|
186
|
+
Search through 7,447 Material Design Icons.
|
|
121
187
|
|
|
122
|
-
|
|
188
|
+
```typescript
|
|
189
|
+
{
|
|
190
|
+
query: "arrow",
|
|
191
|
+
limit: 20 // optional, default: 20
|
|
192
|
+
}
|
|
123
193
|
```
|
|
124
|
-
|
|
194
|
+
|
|
195
|
+
### CLI Tools
|
|
196
|
+
|
|
197
|
+
#### `get_cli_usage`
|
|
198
|
+
|
|
199
|
+
Get information about Idealyst CLI commands.
|
|
200
|
+
|
|
201
|
+
```typescript
|
|
202
|
+
{
|
|
203
|
+
command: "init" // optional, omit for all commands
|
|
204
|
+
}
|
|
125
205
|
```
|
|
126
206
|
|
|
127
|
-
##
|
|
207
|
+
## Type Extraction System
|
|
128
208
|
|
|
129
|
-
|
|
209
|
+
This MCP server uses a unique **type-driven architecture** to ensure documentation accuracy:
|
|
130
210
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
211
|
+
1. **Extract Types**: Parse TypeScript from `@idealyst/components`, `@idealyst/theme`, `@idealyst/navigation`
|
|
212
|
+
2. **Validate Examples**: Type-check all examples against extracted types
|
|
213
|
+
3. **Serve Types**: Provide both raw TypeScript and JSON schema via MCP tools
|
|
214
|
+
|
|
215
|
+
See [TYPE-SYSTEM.md](./TYPE-SYSTEM.md) for detailed documentation.
|
|
135
216
|
|
|
136
217
|
## Development
|
|
137
218
|
|
|
219
|
+
### Setup
|
|
220
|
+
|
|
138
221
|
```bash
|
|
139
222
|
# Install dependencies
|
|
140
223
|
yarn install
|
|
141
224
|
|
|
225
|
+
# Extract types from packages
|
|
226
|
+
yarn extract-types
|
|
227
|
+
|
|
228
|
+
# Validate examples
|
|
229
|
+
yarn validate-examples
|
|
230
|
+
|
|
142
231
|
# Build
|
|
143
232
|
yarn build
|
|
144
233
|
|
|
145
|
-
#
|
|
146
|
-
yarn
|
|
234
|
+
# Run locally
|
|
235
|
+
yarn start
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
### Adding Examples
|
|
147
239
|
|
|
148
|
-
|
|
149
|
-
|
|
240
|
+
Create TypeScript example files in `examples/components/`:
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
// examples/components/Button.examples.tsx
|
|
244
|
+
import React from 'react';
|
|
245
|
+
import { Button } from '@idealyst/components';
|
|
246
|
+
|
|
247
|
+
export function BasicButton() {
|
|
248
|
+
return (
|
|
249
|
+
<Button type="contained" intent="primary">
|
|
250
|
+
Save
|
|
251
|
+
</Button>
|
|
252
|
+
);
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
Then validate:
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
yarn validate-examples
|
|
150
260
|
```
|
|
151
261
|
|
|
262
|
+
### Project Structure
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
packages/mcp-server/
|
|
266
|
+
├── src/
|
|
267
|
+
│ ├── index.ts # MCP server entry point
|
|
268
|
+
│ ├── tools/ # MCP tool implementations
|
|
269
|
+
│ │ └── get-types.ts # Type extraction tools
|
|
270
|
+
│ ├── data/ # Component documentation
|
|
271
|
+
│ │ ├── components/ # Component docs
|
|
272
|
+
│ │ ├── cli-commands.ts # CLI documentation
|
|
273
|
+
│ │ └── framework-guides.ts
|
|
274
|
+
│ └── generated/ # Auto-generated (gitignored)
|
|
275
|
+
│ └── types.json # Extracted types
|
|
276
|
+
├── scripts/
|
|
277
|
+
│ ├── extract-types.ts # Type extraction script
|
|
278
|
+
│ ├── type-extractor.ts # Extraction utilities
|
|
279
|
+
│ └── validate-examples.ts # Example validation
|
|
280
|
+
├── examples/
|
|
281
|
+
│ └── components/ # Type-checked examples
|
|
282
|
+
│ ├── Button.examples.tsx
|
|
283
|
+
│ ├── Card.examples.tsx
|
|
284
|
+
│ └── ...
|
|
285
|
+
├── ARCHITECTURE.md # System architecture
|
|
286
|
+
├── TYPE-SYSTEM.md # Type system documentation
|
|
287
|
+
└── package.json
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
## Build Process
|
|
291
|
+
|
|
292
|
+
The build includes type extraction and validation:
|
|
293
|
+
|
|
294
|
+
```json
|
|
295
|
+
{
|
|
296
|
+
"scripts": {
|
|
297
|
+
"prebuild": "yarn extract-types && yarn validate-examples",
|
|
298
|
+
"build": "tsc && chmod +x dist/index.js"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
This ensures:
|
|
304
|
+
- ✅ Types are up-to-date
|
|
305
|
+
- ✅ Examples are valid
|
|
306
|
+
- ✅ Build fails if examples have type errors
|
|
307
|
+
|
|
308
|
+
## Resources
|
|
309
|
+
|
|
310
|
+
The server also provides markdown resources accessible via MCP:
|
|
311
|
+
|
|
312
|
+
- `idealyst://framework/getting-started` - Getting started guide
|
|
313
|
+
- `idealyst://framework/components-overview` - Components overview
|
|
314
|
+
- `idealyst://framework/theming` - Theming guide
|
|
315
|
+
- `idealyst://framework/cli` - CLI reference
|
|
316
|
+
- `idealyst://navigation/overview` - Navigation system overview
|
|
317
|
+
- `idealyst://navigation/route-configuration` - Route configuration
|
|
318
|
+
- `idealyst://navigation/navigator-types` - Navigator types guide
|
|
319
|
+
- `idealyst://icons/reference` - Icon reference with common icons
|
|
320
|
+
|
|
321
|
+
## Benefits
|
|
322
|
+
|
|
323
|
+
### For AI Assistants
|
|
324
|
+
- 🎯 **Accurate Types**: Get exact TypeScript interfaces from source
|
|
325
|
+
- ✅ **Validated Examples**: Examples guaranteed to compile
|
|
326
|
+
- 📊 **Multiple Formats**: TypeScript and JSON schema formats
|
|
327
|
+
- 🔄 **Always Updated**: Types extracted from actual packages
|
|
328
|
+
|
|
329
|
+
### For Developers
|
|
330
|
+
- 🚀 **Fast Development**: AI generates correct code on first try
|
|
331
|
+
- 📖 **Reliable Docs**: Documentation always matches reality
|
|
332
|
+
- 🔍 **Easy Discovery**: Search components, icons, and types
|
|
333
|
+
- 💡 **Best Practices**: Built-in guidance and examples
|
|
334
|
+
|
|
152
335
|
## Example Queries for Claude
|
|
153
336
|
|
|
154
|
-
Once the MCP server is connected
|
|
337
|
+
Once the MCP server is connected, you can ask:
|
|
155
338
|
|
|
156
339
|
- "List all Idealyst components"
|
|
157
|
-
- "
|
|
340
|
+
- "Get the TypeScript types for the Button component"
|
|
341
|
+
- "Show me validated examples for the Card component"
|
|
342
|
+
- "What are the available Size values in the theme?"
|
|
343
|
+
- "Search for arrow icons"
|
|
158
344
|
- "How do I create a new Idealyst workspace?"
|
|
159
|
-
- "What
|
|
160
|
-
- "Give me an example of using the Dialog component"
|
|
161
|
-
- "How do I customize the theme in Idealyst?"
|
|
345
|
+
- "What navigation types are available?"
|
|
162
346
|
|
|
163
|
-
##
|
|
347
|
+
## Troubleshooting
|
|
164
348
|
|
|
165
|
-
|
|
349
|
+
### "Types file not found" Error
|
|
166
350
|
|
|
167
|
-
|
|
168
|
-
|
|
351
|
+
Run type extraction:
|
|
352
|
+
```bash
|
|
353
|
+
yarn extract-types
|
|
354
|
+
```
|
|
169
355
|
|
|
170
|
-
|
|
171
|
-
- `components.ts`: Component documentation and examples
|
|
172
|
-
- `cli-commands.ts`: CLI command reference
|
|
173
|
-
- `framework-guides.ts`: Framework setup and usage guides
|
|
356
|
+
### Examples Have Type Errors
|
|
174
357
|
|
|
175
|
-
|
|
358
|
+
This means the examples don't match the current types (which is good - we caught it!):
|
|
359
|
+
```bash
|
|
360
|
+
yarn validate-examples # See errors
|
|
361
|
+
# Fix examples, then re-validate
|
|
362
|
+
```
|
|
176
363
|
|
|
177
|
-
|
|
364
|
+
### Types Are Out of Date
|
|
178
365
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
-
};
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
Then rebuild: `yarn build`
|
|
366
|
+
Re-extract after changing component packages:
|
|
367
|
+
```bash
|
|
368
|
+
yarn extract-types
|
|
369
|
+
yarn build
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
## Contributing
|
|
373
|
+
|
|
374
|
+
1. Fork the repository
|
|
375
|
+
2. Create a feature branch
|
|
376
|
+
3. Add/update examples with type validation
|
|
377
|
+
4. Run `yarn validate-examples`
|
|
378
|
+
5. Submit a pull request
|
|
379
|
+
|
|
380
|
+
See [ARCHITECTURE.md](./ARCHITECTURE.md) and [TYPE-SYSTEM.md](./TYPE-SYSTEM.md) for technical details.
|
|
199
381
|
|
|
200
382
|
## License
|
|
201
383
|
|
|
202
384
|
MIT
|
|
385
|
+
|
|
386
|
+
## Links
|
|
387
|
+
|
|
388
|
+
- [Idealyst Framework](https://github.com/IdealystIO/idealyst-framework)
|
|
389
|
+
- [Model Context Protocol](https://modelcontextprotocol.io/)
|
|
390
|
+
- [Claude Code](https://code.claude.com/)
|