@maltjoy/mcp-server 0.1.1 → 0.2.0

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 (34) hide show
  1. package/README.md +110 -11
  2. package/dist/doc/VJoyAvatar/metadata.json +1 -1
  3. package/dist/doc/VJoyButton/metadata.json +1 -1
  4. package/dist/doc/VJoyCollapseItem/metadata.json +1 -1
  5. package/dist/doc/VJoyHighlight/metadata.json +1 -1
  6. package/dist/doc/VJoyIcon/metadata.json +1 -1
  7. package/dist/doc/VJoyInput/metadata.json +1 -1
  8. package/dist/doc/VJoyLink/metadata.json +1 -1
  9. package/dist/doc/VJoyListItem/metadata.json +1 -1
  10. package/dist/doc/VJoyMenu/metadata.json +11 -4
  11. package/dist/doc/VJoyMenuItem/metadata.json +2 -2
  12. package/dist/doc/VJoyProductTour/metadata.json +1 -1
  13. package/dist/doc/VJoySelectableItem/metadata.json +1 -1
  14. package/dist/doc/VJoyTag/metadata.json +10 -9
  15. package/dist/doc/VJoyTagsInput/metadata.json +1 -0
  16. package/dist/doc/VJoyTagsList/metadata.json +112 -110
  17. package/dist/doc/VJoyWalkthrough/metadata.json +1 -1
  18. package/dist/doc/VJoyWalkthroughTrigger/metadata.json +1 -1
  19. package/dist/doc/css-classes.json +12 -0
  20. package/dist/doc/design-tokens.json +150 -148
  21. package/dist/doc/index.json +2 -2
  22. package/dist/index.js +31 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/parser.d.ts +3 -3
  25. package/dist/parser.d.ts.map +1 -1
  26. package/dist/parser.js +47 -236
  27. package/dist/parser.js.map +1 -1
  28. package/dist/tools/list-css-classes.js +1 -1
  29. package/dist/tools/list-css-classes.js.map +1 -1
  30. package/dist/tools/list-design-tokens.d.ts +8 -8
  31. package/dist/tools/list-design-tokens.d.ts.map +1 -1
  32. package/dist/tools/list-design-tokens.js +1 -1
  33. package/dist/tools/list-design-tokens.js.map +1 -1
  34. package/package.json +3 -3
package/README.md CHANGED
@@ -4,18 +4,23 @@ MCP (Model Context Protocol) server for the Joy Design System. This server expos
4
4
 
5
5
  ## Features
6
6
 
7
- - 🔍 List all available Joy Vue3 components
8
- - 📚 Access component documentation (props, events, slots)
7
+ - 🔍 List all 74 available Joy Vue3 components
8
+ - 📚 Access component documentation (props, events, slots, exposed members)
9
+ - 🎨 List 132 design tokens (colors, spacing, typography, etc.)
10
+ - 💅 List 272 CSS utility classes
9
11
  - 🤖 AI-friendly interface through MCP protocol
12
+ - ✅ Automatic documentation generation on build
10
13
 
11
14
  ## Installation
12
15
 
13
16
  ```bash
14
17
  cd packages/joy-mcp-server
15
18
  pnpm install
16
- pnpm build
19
+ pnpm build # This also generates component documentation JSON files
17
20
  ```
18
21
 
22
+ > **Note:** The build process automatically generates JSON documentation for all 74 components. This is required for the server to work.
23
+
19
24
  ## Usage
20
25
 
21
26
  ### Running the Server
@@ -35,7 +40,7 @@ pnpm dev
35
40
 
36
41
  ## Available Tools
37
42
 
38
- ### `joy_list_components`
43
+ ### 1. `joy_list_components`
39
44
 
40
45
  Lists all available Joy Vue3 components from the @maltjoy/core-vue library.
41
46
 
@@ -54,7 +59,7 @@ Lists all available Joy Vue3 components from the @maltjoy/core-vue library.
54
59
  }
55
60
  ```
56
61
 
57
- ### `joy_get_component_info`
62
+ ### 2. `joy_get_component_info`
58
63
 
59
64
  Retrieves detailed information about a specific Joy Vue3 component including props, events, slots, and exposed members.
60
65
 
@@ -104,6 +109,44 @@ Retrieves detailed information about a specific Joy Vue3 component including pro
104
109
  }
105
110
  ```
106
111
 
112
+ ### 3. `joy_list_design_tokens`
113
+
114
+ Lists all available Joy design tokens (CSS custom properties) organized by domain.
115
+
116
+ **Parameters:** None
117
+
118
+ **Returns:**
119
+ ```json
120
+ {
121
+ "colors": ["--joy-color-primary-100", "..."],
122
+ "spacing": ["--joy-core-spacing-1", "..."],
123
+ "typography": ["--joy-font-size-primary-1", "..."],
124
+ "radius": ["--joy-core-radius-1", "..."],
125
+ "elevation": ["--joy-core-elevation-1", "..."],
126
+ "zIndex": ["--joy-core-z-index-modal", "..."],
127
+ "transitions": ["--joy-transition-fast", "..."],
128
+ "forms": ["--joy-form-height-medium", "..."]
129
+ }
130
+ ```
131
+
132
+ ### 4. `joy_list_css_classes`
133
+
134
+ Lists all available Joy CSS utility classes organized by domain.
135
+
136
+ **Parameters:** None
137
+
138
+ **Returns:**
139
+ ```json
140
+ {
141
+ "colors": [".joy-color-primary-100", ".joy-bgcolor-primary-100", "..."],
142
+ "spacing": [".joy-m-1", ".joy-p-2", "..."],
143
+ "typography": [".joy-font-primary-1", "..."],
144
+ "elevation": [".joy-core-elevation-1", "..."],
145
+ "radius": [".joy-core-radius-1", "..."],
146
+ "misc": [".joy-link", ".joy-link_white"]
147
+ }
148
+ ```
149
+
107
150
  ## Configuration for Claude Desktop
108
151
 
109
152
  Add this to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
@@ -143,17 +186,28 @@ Add this to your Cursor MCP settings:
143
186
  ```
144
187
  joy-mcp-server/
145
188
  ├── src/
146
- │ ├── index.ts # Main server entry point
147
- │ ├── parser.ts # Markdown documentation parser
189
+ │ ├── index.ts # Main server entry point
190
+ │ ├── parser.ts # JSON documentation parser
191
+ │ ├── json-metadata-generator.mjs # Generates component metadata
148
192
  │ └── tools/
149
- │ ├── list-components.ts # Component listing tool
150
- └── get-component-info.ts # Component info retrieval tool
193
+ │ ├── list-components.ts # Component listing tool
194
+ ├── get-component-info.ts # Component info retrieval tool
195
+ │ ├── list-design-tokens.ts # Design tokens tool
196
+ │ └── list-css-classes.ts # CSS classes tool
197
+ ├── dist/
198
+ │ └── doc/
199
+ │ ├── index.json # Index of all components
200
+ │ ├── design-tokens.json # All design tokens
201
+ │ ├── css-classes.json # All CSS classes
202
+ │ └── VJoy*/ # Component directories
203
+ │ └── metadata.json # Component metadata
151
204
  ├── package.json
152
205
  ├── tsconfig.json
153
- └── README.md
206
+ ├── README.md
207
+ └── TROUBLESHOOTING.md # Troubleshooting guide
154
208
  ```
155
209
 
156
- The server reads the generated documentation from `packages/core-vue/dist/doc/joy-all-components.md` to provide up-to-date component information.
210
+ The server reads the generated JSON documentation from `dist/doc/` which is automatically created during the build process by extracting metadata from Vue component files in `@maltjoy/core-vue`.
157
211
 
158
212
  ## Development
159
213
 
@@ -163,6 +217,51 @@ To add new tools:
163
217
  2. Define the tool schema and handler
164
218
  3. Register the tool in `src/index.ts`
165
219
 
220
+ ### Available Scripts
221
+
222
+ ```bash
223
+ # Build and generate documentation
224
+ pnpm run build
225
+
226
+ # Watch mode for development
227
+ pnpm run dev
228
+
229
+ # Generate only documentation (no compilation)
230
+ pnpm run generate:components-docs:json
231
+
232
+ # Test the server locally
233
+ pnpm run test
234
+
235
+ # Reload the server (kill MCP process)
236
+ pnpm run reload
237
+
238
+ # Start the server
239
+ pnpm start
240
+
241
+ # Run with MCP inspector for debugging
242
+ pnpm run inspector
243
+ ```
244
+
245
+ ## Troubleshooting
246
+
247
+ ### MCP server returns 0 components in Cursor
248
+
249
+ If you're getting an empty list of components in Cursor but the server works fine locally:
250
+
251
+ 1. **Quick fix:** Use Cursor Command Palette → `Developer: Reload Window`
252
+
253
+ 2. **Or run:** `pnpm run reload` to kill the old server process
254
+
255
+ 3. **Verify locally:** `pnpm run test` should show 74 components
256
+
257
+ For detailed troubleshooting steps, see [TROUBLESHOOTING.md](./TROUBLESHOOTING.md)
258
+
259
+ ### Common Issues
260
+
261
+ - **Documentation not generated:** Run `pnpm run build` to compile and generate docs
262
+ - **Changes not taking effect:** Reload Cursor window to restart MCP server
263
+ - **Server fails to start:** Check that `dist/doc/index.json` exists
264
+
166
265
  ## License
167
266
 
168
267
  MIT
@@ -103,7 +103,7 @@
103
103
  "key",
104
104
  "user-photo",
105
105
  "link",
106
- "... (200 more)"
106
+ "... (207 more)"
107
107
  ]
108
108
  },
109
109
  {
@@ -92,7 +92,7 @@
92
92
  "type": "string",
93
93
  "required": false,
94
94
  "description": "Name of the icon, placed before the text",
95
- "possibleValues": "TJoyIconsNames (210 values)"
95
+ "possibleValues": "TJoyIconsNames (217 values)"
96
96
  },
97
97
  {
98
98
  "name": "id",
@@ -65,7 +65,7 @@
65
65
  "key",
66
66
  "user-photo",
67
67
  "link",
68
- "... (200 more)"
68
+ "... (207 more)"
69
69
  ]
70
70
  }
71
71
  ],
@@ -54,7 +54,7 @@
54
54
  "type": "string",
55
55
  "required": false,
56
56
  "description": "Based on maltjoy/icons availabilities. Works in pair with displayIcon boolean prop.",
57
- "possibleValues": "TJoyIconsNames (210 values)"
57
+ "possibleValues": "TJoyIconsNames (217 values)"
58
58
  }
59
59
  ],
60
60
  "events": [],
@@ -65,7 +65,7 @@
65
65
  "key",
66
66
  "user-photo",
67
67
  "link",
68
- "... (200 more)"
68
+ "... (207 more)"
69
69
  ]
70
70
  },
71
71
  {
@@ -140,7 +140,7 @@
140
140
  "type": "string",
141
141
  "required": false,
142
142
  "description": "Add a JoyIcon / joy-icon with given name on left-side.",
143
- "possibleValues": "TJoyIconsNames (210 values)"
143
+ "possibleValues": "TJoyIconsNames (217 values)"
144
144
  },
145
145
  {
146
146
  "name": "size",
@@ -25,7 +25,7 @@
25
25
  "type": "string",
26
26
  "required": false,
27
27
  "description": "",
28
- "possibleValues": "TJoyIconsNames (210 values)"
28
+ "possibleValues": "TJoyIconsNames (217 values)"
29
29
  },
30
30
  {
31
31
  "name": "text",
@@ -7,7 +7,7 @@
7
7
  "type": "string",
8
8
  "required": false,
9
9
  "description": "",
10
- "possibleValues": "TJoyIconsNames (210 values)"
10
+ "possibleValues": "TJoyIconsNames (217 values)"
11
11
  }
12
12
  ],
13
13
  "events": [
@@ -130,8 +130,6 @@
130
130
  "\"block-shield\"",
131
131
  "\"bricks\"",
132
132
  "\"briefcase\"",
133
- "\"building-column\"",
134
- "\"business-suitcase\"",
135
133
  "\"calendar\"",
136
134
  "\"camcorder\"",
137
135
  "\"camera-device\"",
@@ -163,6 +161,7 @@
163
161
  "\"conditions\"",
164
162
  "\"conference\"",
165
163
  "\"contact\"",
164
+ "\"cookie\"",
166
165
  "\"cost-plus\"",
167
166
  "\"creditcard\"",
168
167
  "\"cross\"",
@@ -188,11 +187,11 @@
188
187
  "\"file\"",
189
188
  "\"five-day\"",
190
189
  "\"flag\"",
191
- "\"folder-arrow-down\"",
192
- "\"folder-text\"",
193
190
  "\"freelancer-placeholder\"",
194
191
  "\"fullscren\"",
195
192
  "\"gasoline\"",
193
+ "\"globe-hover\"",
194
+ "\"globe\"",
196
195
  "\"google\"",
197
196
  "\"granular-report\"",
198
197
  "\"graph-high\"",
@@ -209,6 +208,7 @@
209
208
  "\"home\"",
210
209
  "\"ico-list\"",
211
210
  "\"identity-switch\"",
211
+ "\"image\"",
212
212
  "\"info-circle\"",
213
213
  "\"instagram\"",
214
214
  "\"insurance\"",
@@ -217,6 +217,7 @@
217
217
  "\"legal-check\"",
218
218
  "\"legal\"",
219
219
  "\"linkedin\"",
220
+ "\"list-file\"",
220
221
  "\"list\"",
221
222
  "\"location\"",
222
223
  "\"lock\"",
@@ -232,11 +233,13 @@
232
233
  "\"money\"",
233
234
  "\"mood-bad\"",
234
235
  "\"mood-good\"",
236
+ "\"newspaper\"",
235
237
  "\"open-conversation\"",
236
238
  "\"paperclip\"",
237
239
  "\"pen\"",
238
240
  "\"pencil\"",
239
241
  "\"phone\"",
242
+ "\"plane-full\"",
240
243
  "\"plus-circle\"",
241
244
  "\"pound-circle\"",
242
245
  "\"print\"",
@@ -265,9 +268,12 @@
265
268
  "\"sort-asc\"",
266
269
  "\"sort-desc\"",
267
270
  "\"sparkle\"",
271
+ "\"sparkles\"",
268
272
  "\"star-fill\"",
269
273
  "\"star-half\"",
274
+ "\"star-message\"",
270
275
  "\"star\"",
276
+ "\"super-malter\"",
271
277
  "\"swipe\"",
272
278
  "\"switch\"",
273
279
  "\"sync-reset\"",
@@ -300,6 +306,7 @@
300
306
  "\"wallet\"",
301
307
  "\"warning-triangle\"",
302
308
  "\"warning\"",
309
+ "\"waving-hand\"",
303
310
  "\"web-design\"",
304
311
  "\"wench\"",
305
312
  "\"x\"",
@@ -23,7 +23,7 @@
23
23
  "type": "string",
24
24
  "required": false,
25
25
  "description": "",
26
- "possibleValues": "TJoyIconsNames (210 values)"
26
+ "possibleValues": "TJoyIconsNames (217 values)"
27
27
  },
28
28
  {
29
29
  "name": "current",
@@ -50,7 +50,7 @@
50
50
  "type": "string",
51
51
  "required": false,
52
52
  "description": "",
53
- "possibleValues": "TJoyIconsNames (210 values)"
53
+ "possibleValues": "TJoyIconsNames (217 values)"
54
54
  },
55
55
  {
56
56
  "name": "statusColor",
@@ -7,7 +7,7 @@
7
7
  "type": "string",
8
8
  "required": false,
9
9
  "description": "",
10
- "possibleValues": "TJoyIconsNames (210 values)"
10
+ "possibleValues": "TJoyIconsNames (217 values)"
11
11
  },
12
12
  {
13
13
  "name": "steps",
@@ -104,7 +104,7 @@
104
104
  "type": "string",
105
105
  "required": false,
106
106
  "description": "",
107
- "possibleValues": "TJoyIconsNames (210 values)"
107
+ "possibleValues": "TJoyIconsNames (217 values)"
108
108
  }
109
109
  ],
110
110
  "events": [
@@ -33,6 +33,7 @@
33
33
  "possibleValues": [
34
34
  "secondary",
35
35
  "primary",
36
+ "empty",
36
37
  "important",
37
38
  "inactive",
38
39
  "pending",
@@ -139,6 +140,11 @@
139
140
  }
140
141
  ],
141
142
  "events": [
143
+ {
144
+ "name": "remove",
145
+ "description": "",
146
+ "signature": "(event: \"remove\", value: IJoyTagRemoved): void"
147
+ },
142
148
  {
143
149
  "name": "click",
144
150
  "description": "",
@@ -148,11 +154,6 @@
148
154
  "name": "selected",
149
155
  "description": "",
150
156
  "signature": "(event: \"selected\", tag: IJoyTagSelected): void"
151
- },
152
- {
153
- "name": "remove",
154
- "description": "",
155
- "signature": "(event: \"remove\", value: IJoyTagRemoved): void"
156
157
  }
157
158
  ],
158
159
  "slots": [
@@ -228,13 +229,13 @@
228
229
  "isMethod": false
229
230
  },
230
231
  {
231
- "name": "onSelected",
232
- "type": "((tag: IJoyTagSelected) => any) | undefined",
232
+ "name": "onRemove",
233
+ "type": "((value: IJoyTagRemoved) => any) | undefined",
233
234
  "isMethod": true
234
235
  },
235
236
  {
236
- "name": "onRemove",
237
- "type": "((value: IJoyTagRemoved) => any) | undefined",
237
+ "name": "onSelected",
238
+ "type": "((tag: IJoyTagSelected) => any) | undefined",
238
239
  "isMethod": true
239
240
  }
240
241
  ],
@@ -30,6 +30,7 @@
30
30
  "possibleValues": [
31
31
  "secondary",
32
32
  "primary",
33
+ "empty",
33
34
  "important",
34
35
  "inactive",
35
36
  "pending",