@aleph-alpha/lib-mcp 1.7.0 → 2.1.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.
package/README.md CHANGED
@@ -1,17 +1,30 @@
1
1
  # @aleph-alpha/lib-mcp
2
2
 
3
- MCP (Model Context Protocol) Server for UI Library component discovery tools.
3
+ MCP (Model Context Protocol) Server for UI Library and ChatKit component discovery tools.
4
4
 
5
5
  ## Overview
6
6
 
7
- This package provides an MCP server that enables AI assistants (like Claude and Cursor) to discover and understand UI Library components. It offers tools to list available components and retrieve detailed documentation including props, examples, and usage guidance.
7
+ This package provides an MCP server that enables AI assistants (like Claude and Cursor) to discover and understand components from:
8
+
9
+ - [`@aleph-alpha/ui-library`](../ui-library) — `Ui*` components
10
+ - [`@aleph-alpha/chat-kit`](../chat-kit) — `Ck*` components
11
+
12
+ It offers tools to list available components and retrieve detailed documentation including props, examples, and usage guidance.
8
13
 
9
14
  ## Installation
10
15
 
16
+ Install `@aleph-alpha/lib-mcp` together with the component packages whose docs you want to query. UI Library is required; ChatKit is optional and only needed if you want `Ck*` component docs.
17
+
11
18
  ```bash
19
+ # UI Library only
12
20
  pnpm add @aleph-alpha/lib-mcp @aleph-alpha/ui-library
21
+
22
+ # UI Library + ChatKit
23
+ pnpm add @aleph-alpha/lib-mcp @aleph-alpha/ui-library @aleph-alpha/chat-kit
13
24
  ```
14
25
 
26
+ > ChatKit docs require `@aleph-alpha/chat-kit` to publish its `src/` directory (component `types.ts` and `*.stories.ts` files). If `get_chat_kit_docs` returns "Could not find chat-kit source directory", upgrade `@aleph-alpha/chat-kit` to a version that includes `src/` in its published files.
27
+
15
28
  ## Usage
16
29
 
17
30
  ### Configure MCP Server
@@ -24,6 +37,9 @@ npx @aleph-alpha/lib-mcp mcp-install
24
37
 
25
38
  # For both Claude Code and Cursor
26
39
  npx @aleph-alpha/lib-mcp mcp-install --cursor
40
+
41
+ # For VS Code
42
+ npx @aleph-alpha/lib-mcp mcp-install --vscode
27
43
  ```
28
44
 
29
45
  After installation, restart your IDE to activate the MCP tools.
@@ -32,9 +48,11 @@ After installation, restart your IDE to activate the MCP tools.
32
48
 
33
49
  Once configured, the following tools are available to your AI assistant:
34
50
 
35
- #### `list_components`
51
+ #### UI Library tools
52
+
53
+ ##### `list_components`
36
54
 
37
- Lists all available UI components. Supports optional filtering by name, category, or description.
55
+ Lists all available UI Library components. Supports optional filtering by name, category, or description.
38
56
 
39
57
  ```
40
58
  list_components
@@ -42,9 +60,9 @@ list_components --filter="button"
42
60
  list_components --filter="form"
43
61
  ```
44
62
 
45
- #### `get_component_docs`
63
+ ##### `get_component_docs`
46
64
 
47
- Retrieves full documentation for a specific component including:
65
+ Retrieves full documentation for a specific UI Library component including:
48
66
 
49
67
  - Component description
50
68
  - Props with types, defaults, and descriptions
@@ -57,6 +75,45 @@ get_component_docs UiButton
57
75
  get_component_docs Button # "Ui" prefix is optional
58
76
  ```
59
77
 
78
+ #### ChatKit tools
79
+
80
+ Available when `@aleph-alpha/chat-kit` is installed alongside this package.
81
+
82
+ ##### `list_chat_kit_components`
83
+
84
+ Lists all available ChatKit (`Ck*`) components. Supports optional filtering by name, category, or description.
85
+
86
+ ```
87
+ list_chat_kit_components
88
+ list_chat_kit_components --filter="history"
89
+ list_chat_kit_components --filter="message"
90
+ ```
91
+
92
+ ##### `get_chat_kit_docs`
93
+
94
+ Retrieves full documentation for a specific ChatKit component, with the same shape as `get_component_docs`:
95
+
96
+ - Component description
97
+ - Props with types, defaults, and descriptions
98
+ - Sub-components (if applicable)
99
+ - Usage guidance
100
+ - Code examples
101
+
102
+ ```
103
+ get_chat_kit_docs CkHistory
104
+ get_chat_kit_docs History # "Ck" prefix is optional
105
+ ```
106
+
107
+ #### Setup tool
108
+
109
+ ##### `get_setup_guide`
110
+
111
+ Returns the setup and installation guide for integrating the UI library into a project (UnoCSS config, Vite config, required dependencies, and MCP setup instructions).
112
+
113
+ ```
114
+ get_setup_guide
115
+ ```
116
+
60
117
  ## Development
61
118
 
62
119
  ### Building
@@ -67,6 +124,8 @@ pnpm build
67
124
 
68
125
  ### Generating Component Metadata
69
126
 
127
+ Regenerates `components-meta.json` (UI Library) and `chat-kit-components-meta.json` (ChatKit) by scanning each package's source files.
128
+
70
129
  ```bash
71
130
  pnpm generate:component-meta
72
131
  ```
@@ -79,21 +138,23 @@ pnpm test
79
138
 
80
139
  ## How It Works
81
140
 
82
- The MCP server reads component metadata from:
141
+ The MCP server reads component metadata from each package's source layout:
83
142
 
84
143
  1. **`types.ts`**: Extracts props, their types, descriptions, and component-level JSDoc tags (`@category`, `@useCases`, `@keywords`, `@related`)
85
144
  2. **`*.stories.ts`**: Extracts code examples and usage guidance from Storybook stories
86
- 3. **`components-meta.json`**: Pre-generated metadata for faster lookups
145
+ 3. **`index.ts`**: Detects sub-component exports for the documented component
146
+ 4. **`components-meta.json` / `chat-kit-components-meta.json`**: Pre-generated metadata for faster lookups
147
+
148
+ UI Library components are read from `@aleph-alpha/ui-library/src/**`, and ChatKit components from `@aleph-alpha/chat-kit/src/components/**`. Both packages must publish their `src/` directory for docs to resolve when consumed from `node_modules`.
87
149
 
88
150
  ## CLI Commands
89
151
 
90
- | Command | Description |
91
- |---------|-------------|
92
- | `mcp-install` | Configure MCP server for IDE |
93
- | `serve` | Start the MCP server (used internally by IDE) |
94
- | `--help` | Show help message |
152
+ | Command | Description |
153
+ | ------------- | ----------------------------------------------------------------------- |
154
+ | `mcp-install` | Configure MCP server for IDE (`--cursor`, `--vscode` to add extra IDEs) |
155
+ | `serve` | Start the MCP server (used internally by IDE) |
156
+ | `--help` | Show help message |
95
157
 
96
158
  ## License
97
159
 
98
160
  Apache-2.0
99
-
@@ -0,0 +1,546 @@
1
+ {
2
+ "CkAgentMessage": {
3
+ "description": "Layout for a single assistant (agent) turn in a conversation. Exposes `icon`, `header`, default content and `footer` slots for full control over each section while keeping consistent spacing and alignment.",
4
+ "category": "Messages",
5
+ "useCases": [
6
+ "render assistant reply",
7
+ "AI message layout",
8
+ "conversation turn",
9
+ "streaming message container"
10
+ ],
11
+ "keywords": [
12
+ "agent",
13
+ "assistant",
14
+ "message",
15
+ "bubble",
16
+ "reply",
17
+ "ai",
18
+ "conversation"
19
+ ],
20
+ "related": [
21
+ "CkUserMessage",
22
+ "CkConversation",
23
+ "CkMarkdownRenderer",
24
+ "CkCopyMessageActionButton"
25
+ ],
26
+ "props": [],
27
+ "examples": [
28
+ "Default",
29
+ "WithFooterActions",
30
+ "WithRichContent",
31
+ "WithCustomHeader",
32
+ "WithoutIcon"
33
+ ],
34
+ "_autoGenerated": true
35
+ },
36
+ "CkConversationLayout": {
37
+ "description": "Scroll-aware container that renders a list of messages with sticky-to-bottom behavior, a shrinking spacer so streaming agent replies don't jitter the viewport, and slots for rendering user/agent messages.",
38
+ "category": "Layout",
39
+ "useCases": [
40
+ "conversation scroll container",
41
+ "streaming chat layout",
42
+ "chat viewport with auto-scroll",
43
+ "follow-the-bottom chat list"
44
+ ],
45
+ "keywords": [
46
+ "conversation",
47
+ "layout",
48
+ "scroll",
49
+ "auto-scroll",
50
+ "streaming",
51
+ "chat",
52
+ "container"
53
+ ],
54
+ "related": [
55
+ "CkConversation",
56
+ "CkAgentMessage",
57
+ "CkUserMessage"
58
+ ],
59
+ "props": [
60
+ "messages"
61
+ ],
62
+ "examples": [
63
+ "Default",
64
+ "StreamingSimulation",
65
+ "Empty"
66
+ ],
67
+ "_autoGenerated": true
68
+ },
69
+ "CkCopyMessageActionButton": {
70
+ "description": "Copy-to-clipboard action button for chat messages. Shows a check icon and announces success for assistive technologies, then reverts after a delay.",
71
+ "category": "Actions",
72
+ "useCases": [
73
+ "copy assistant reply",
74
+ "copy message to clipboard",
75
+ "chat message action",
76
+ "feedback action on message footer"
77
+ ],
78
+ "keywords": [
79
+ "copy",
80
+ "clipboard",
81
+ "action",
82
+ "message",
83
+ "button",
84
+ "icon",
85
+ "feedback"
86
+ ],
87
+ "related": [
88
+ "CkMessageActionButton",
89
+ "CkAgentMessage",
90
+ "CkConversation"
91
+ ],
92
+ "props": [
93
+ "text",
94
+ "disabled",
95
+ "durationMs",
96
+ "ariaLabelCopy",
97
+ "ariaLabelCopied",
98
+ "writeToClipboard"
99
+ ],
100
+ "examples": [
101
+ "Default",
102
+ "Disabled"
103
+ ],
104
+ "_autoGenerated": true
105
+ },
106
+ "CkHistoryItem": {
107
+ "description": "A single chat history entry with title, optional meta line, active indicator, and a trailing action control (plain button or popover). Sidebar-agnostic: can be used anywhere, not only inside a sidebar.",
108
+ "category": "Actions",
109
+ "useCases": [
110
+ "chat history row",
111
+ "thread list entry",
112
+ "recent conversation item"
113
+ ],
114
+ "keywords": [
115
+ "chat",
116
+ "history",
117
+ "item",
118
+ "row",
119
+ "conversation",
120
+ "thread"
121
+ ],
122
+ "related": [
123
+ "CkHistoryWrapper"
124
+ ],
125
+ "props": [],
126
+ "examples": [
127
+ "Default",
128
+ "Active",
129
+ "AlwaysShowAction",
130
+ "NoMeta",
131
+ "WithActionPopover"
132
+ ],
133
+ "_autoGenerated": true
134
+ },
135
+ "CkHistoryWrapper": {
136
+ "description": "Vertical stack for chat history rows (`CkHistoryItem`). Sidebar-agnostic: can be used anywhere in the app, not only inside a sidebar.",
137
+ "category": "Layout",
138
+ "useCases": [
139
+ "chat history list",
140
+ "thread list container",
141
+ "recent conversations stack"
142
+ ],
143
+ "keywords": [
144
+ "chat",
145
+ "history",
146
+ "list",
147
+ "stack",
148
+ "container",
149
+ "wrapper"
150
+ ],
151
+ "related": [
152
+ "CkHistoryItem"
153
+ ],
154
+ "props": [
155
+ "withGap"
156
+ ],
157
+ "examples": [
158
+ "Default",
159
+ "WithoutGap"
160
+ ],
161
+ "_autoGenerated": true
162
+ },
163
+ "CkMarkdownRenderer": {
164
+ "description": "Renders a Markdown string as Vue VNodes with per-tag class overrides and an optional `code-block` slot. Use for assistant messages that contain prose, lists, tables, and code blocks.",
165
+ "category": "Data Display",
166
+ "useCases": [
167
+ "render assistant markdown reply",
168
+ "syntax-highlighted code blocks",
169
+ "GFM tables",
170
+ "chat message body"
171
+ ],
172
+ "keywords": [
173
+ "markdown",
174
+ "renderer",
175
+ "gfm",
176
+ "remark",
177
+ "code block",
178
+ "prose"
179
+ ],
180
+ "related": [
181
+ "CkAgentMessage",
182
+ "CkConversation"
183
+ ],
184
+ "props": [
185
+ "content",
186
+ "classes",
187
+ "plugins"
188
+ ],
189
+ "examples": [
190
+ "Default",
191
+ "WithCodeBlocks",
192
+ "WithCustomCodeBlockSlot",
193
+ "ComplexMarkdown",
194
+ "WithCustomClasses",
195
+ "GfmFeatures",
196
+ "WithCustomPlugin"
197
+ ],
198
+ "_autoGenerated": true
199
+ },
200
+ "CkMessageActionButton": {
201
+ "description": "Small icon-only action button used in the footer of chat messages. Acts as a ghost-styled wrapper around `UiButton` with consistent chat-kit tokens.",
202
+ "category": "Actions",
203
+ "useCases": [
204
+ "message footer action",
205
+ "like/dislike reaction",
206
+ "share button on reply",
207
+ "secondary message action"
208
+ ],
209
+ "keywords": [
210
+ "icon button",
211
+ "action",
212
+ "message",
213
+ "ghost",
214
+ "accessible",
215
+ "aria-label",
216
+ "button"
217
+ ],
218
+ "related": [
219
+ "CkCopyMessageActionButton",
220
+ "CkAgentMessage",
221
+ "CkConversation"
222
+ ],
223
+ "props": [
224
+ "ariaLabel",
225
+ "disabled"
226
+ ],
227
+ "examples": [
228
+ "Default"
229
+ ],
230
+ "_autoGenerated": true
231
+ },
232
+ "CkPromptActionButton": {
233
+ "description": "Icon-only call-to-action button styled for the chat prompt area (brand color). Typically used as the \"send\" button inside a prompt input toolbar, but works for any primary prompt-level action.",
234
+ "category": "Actions",
235
+ "useCases": [
236
+ "send message button",
237
+ "submit prompt",
238
+ "primary chat action",
239
+ "loading send button",
240
+ "disabled send button"
241
+ ],
242
+ "keywords": [
243
+ "prompt",
244
+ "send",
245
+ "action",
246
+ "button",
247
+ "icon",
248
+ "submit",
249
+ "loading",
250
+ "brand"
251
+ ],
252
+ "related": [
253
+ "CkPromptInput",
254
+ "CkInput",
255
+ "CkMessageActionButton"
256
+ ],
257
+ "props": [
258
+ "ariaLabel",
259
+ "disabled",
260
+ "loading",
261
+ "type"
262
+ ],
263
+ "examples": [
264
+ "Default",
265
+ "Disabled",
266
+ "Loading"
267
+ ],
268
+ "_autoGenerated": true
269
+ },
270
+ "CkPromptInput": {
271
+ "description": "Low-level prompt input: a single auto-growing textarea with left/right toolbar slots, a footer slot, and keyboard submission (Enter to submit, Shift+Enter for newline). Use when you need full control over the prompt layout; for a turnkey chat input use `CkInput` instead.",
272
+ "category": "Form Inputs",
273
+ "useCases": [
274
+ "raw chat prompt textarea",
275
+ "custom prompt toolbar",
276
+ "auto-growing textarea",
277
+ "compose box",
278
+ "keyboard submit"
279
+ ],
280
+ "keywords": [
281
+ "prompt",
282
+ "input",
283
+ "textarea",
284
+ "chat",
285
+ "auto-grow",
286
+ "compose",
287
+ "submit",
288
+ "v-model"
289
+ ],
290
+ "related": [
291
+ "CkInput",
292
+ "CkPromptActionButton",
293
+ "CkPromptInputDisclaimer"
294
+ ],
295
+ "props": [
296
+ "modelValue",
297
+ "placeholder",
298
+ "disabled",
299
+ "maxHeight",
300
+ "ariaLabel"
301
+ ],
302
+ "examples": [
303
+ "Default",
304
+ "WithToolbarSlots",
305
+ "WithFooterSlot",
306
+ "Disabled"
307
+ ],
308
+ "_autoGenerated": true
309
+ },
310
+ "CkPromptInputDisclaimer": {
311
+ "description": "Small helper/disclaimer line typically rendered under a chat input (\"AI may produce incorrect answers\"). Renders nothing when there is no text and no default slot content, making it safe to always include.",
312
+ "category": "Feedback",
313
+ "useCases": [
314
+ "chat disclaimer",
315
+ "ai may make mistakes",
316
+ "prompt footnote",
317
+ "small help text under input"
318
+ ],
319
+ "keywords": [
320
+ "disclaimer",
321
+ "notice",
322
+ "footer",
323
+ "help text",
324
+ "ai",
325
+ "prompt",
326
+ "input"
327
+ ],
328
+ "related": [
329
+ "CkInput",
330
+ "CkPromptInput"
331
+ ],
332
+ "props": [
333
+ "text"
334
+ ],
335
+ "examples": [
336
+ "Default",
337
+ "WithSlot",
338
+ "Empty"
339
+ ],
340
+ "_autoGenerated": true
341
+ },
342
+ "CkPromptStopButton": {
343
+ "description": "Icon-only button used to stop an in-flight assistant generation. Shares the brand styling of `CkPromptActionButton` but is intended to replace it in the prompt toolbar while a response is streaming.",
344
+ "category": "Actions",
345
+ "useCases": [
346
+ "stop assistant generation",
347
+ "cancel streaming reply",
348
+ "abort in-flight request",
349
+ "halt llm response"
350
+ ],
351
+ "keywords": [
352
+ "stop",
353
+ "cancel",
354
+ "abort",
355
+ "prompt",
356
+ "action",
357
+ "button",
358
+ "icon",
359
+ "streaming"
360
+ ],
361
+ "related": [
362
+ "CkPromptActionButton",
363
+ "CkPromptInput",
364
+ "CkInput"
365
+ ],
366
+ "props": [
367
+ "ariaLabel",
368
+ "disabled"
369
+ ],
370
+ "examples": [
371
+ "Default",
372
+ "Disabled"
373
+ ],
374
+ "_autoGenerated": true
375
+ },
376
+ "CkUserMessage": {
377
+ "description": "Bubble layout for a single user turn in a conversation. Renders the message text on the right side with a tokenized background and max-width; supports a default slot for custom inline content.",
378
+ "category": "Messages",
379
+ "useCases": [
380
+ "render user message bubble",
381
+ "conversation turn from user",
382
+ "chat input preview",
383
+ "right-aligned message"
384
+ ],
385
+ "keywords": [
386
+ "user",
387
+ "message",
388
+ "bubble",
389
+ "chat",
390
+ "conversation",
391
+ "turn"
392
+ ],
393
+ "related": [
394
+ "CkAgentMessage",
395
+ "CkConversation"
396
+ ],
397
+ "props": [
398
+ "message"
399
+ ],
400
+ "examples": [
401
+ "Default",
402
+ "LongMessage",
403
+ "MultilineMessage",
404
+ "WithSlotContent"
405
+ ],
406
+ "_autoGenerated": true
407
+ },
408
+ "CkConversation": {
409
+ "description": "High-level chat conversation: renders user and agent messages, Markdown for assistant replies, an avatar, copy-to-clipboard action, streaming viewport, and slots for overriding any part of the rendering. Use as the drop-in conversation surface for most chat-kit integrations.",
410
+ "category": "Messages",
411
+ "useCases": [
412
+ "complete chat conversation ui",
413
+ "streaming chat with markdown",
414
+ "assistant chat view",
415
+ "llm conversation component",
416
+ "drop-in chat surface"
417
+ ],
418
+ "keywords": [
419
+ "conversation",
420
+ "chat",
421
+ "messages",
422
+ "assistant",
423
+ "agent",
424
+ "user",
425
+ "markdown",
426
+ "streaming",
427
+ "avatar"
428
+ ],
429
+ "related": [
430
+ "CkConversationLayout",
431
+ "CkAgentMessage",
432
+ "CkUserMessage",
433
+ "CkMarkdownRenderer",
434
+ "CkCopyMessageActionButton",
435
+ "CkInput"
436
+ ],
437
+ "props": [
438
+ "messages",
439
+ "agentAvatarImage",
440
+ "agentAvatarFallback",
441
+ "agentLoadingImage",
442
+ "agentMarkdownClasses"
443
+ ],
444
+ "examples": [
445
+ "Default",
446
+ "WithIcon",
447
+ "WithCustomAvatarFallback",
448
+ "NoIcon",
449
+ "WithCustomIcon",
450
+ "WithFooterActions",
451
+ "WithCustomUserContent",
452
+ "WithCustomAgentContent",
453
+ "StreamingSimulation",
454
+ "WithCustomMarkdownClasses",
455
+ "WithCustomCodeBlock",
456
+ "Empty"
457
+ ],
458
+ "_autoGenerated": true
459
+ },
460
+ "CkHistory": {
461
+ "description": "Composed conversation history list. Renders each conversation as a real `<a href>` row so middle-click, cmd/ctrl-click, and right-click \"Copy link address\" all work natively. Plain left-clicks are intercepted via a RouterLink-style guard and exposed as a `select` event so consumers can call `router.push(...)` (or any other navigation primitive) themselves. Per-row \"Edit\" and \"Delete\" actions are rendered internally; consumers receive `edit` / `delete` events with the corresponding conversation. Use the `#item` scoped slot to fully replace the row rendering — for example to wrap each row in `<RouterLink>` for native vue-router integration. The slot scope exposes the resolved row data (`conversation`, `href`, `isActive`, `title`) plus `select` / `edit` / `delete` helpers that emit the same events as the default rendering.",
462
+ "category": "Messages",
463
+ "useCases": [
464
+ "conversation history list",
465
+ "recent chats sidebar entry",
466
+ "thread navigation",
467
+ "chat history pane"
468
+ ],
469
+ "keywords": [
470
+ "conversation",
471
+ "history",
472
+ "list",
473
+ "navigation",
474
+ "link",
475
+ "sidebar",
476
+ "threads",
477
+ "routerlink"
478
+ ],
479
+ "related": [
480
+ "CkHistoryWrapper",
481
+ "CkHistoryItem"
482
+ ],
483
+ "props": [
484
+ "conversations",
485
+ "hrefResolver",
486
+ "activeId",
487
+ "showAction",
488
+ "showActionOnHover"
489
+ ],
490
+ "examples": [
491
+ "Default",
492
+ "WithoutActions",
493
+ "RouterLinkIntegration",
494
+ "WithCustomItem"
495
+ ],
496
+ "_autoGenerated": true
497
+ },
498
+ "CkInput": {
499
+ "description": "Drop-in chat input: combines `CkPromptInput`, a `CkPromptActionButton` send button, and a `CkPromptInputDisclaimer`. Supports `v-model`, loading and disabled states, and slots to customize the toolbar and footer.",
500
+ "category": "Form Inputs",
501
+ "useCases": [
502
+ "chat compose input",
503
+ "prompt box with send button",
504
+ "llm input with disclaimer",
505
+ "quick-start chat input",
506
+ "turnkey chat input"
507
+ ],
508
+ "keywords": [
509
+ "input",
510
+ "prompt",
511
+ "chat",
512
+ "send",
513
+ "compose",
514
+ "disclaimer",
515
+ "loading",
516
+ "v-model",
517
+ "textarea"
518
+ ],
519
+ "related": [
520
+ "CkPromptInput",
521
+ "CkPromptActionButton",
522
+ "CkPromptInputDisclaimer",
523
+ "CkConversation"
524
+ ],
525
+ "props": [
526
+ "modelValue",
527
+ "placeholder",
528
+ "disabled",
529
+ "loading",
530
+ "maxHeight",
531
+ "ariaLabel",
532
+ "stopAriaLabel",
533
+ "disclaimer"
534
+ ],
535
+ "examples": [
536
+ "Default",
537
+ "WithModeToggle",
538
+ "FullExample",
539
+ "Disabled",
540
+ "Loading",
541
+ "WithLongText",
542
+ "MobileWidth"
543
+ ],
544
+ "_autoGenerated": true
545
+ }
546
+ }