@assistant-ui/mcp-docs-server 0.1.9 → 0.1.11

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 (35) hide show
  1. package/.docs/organized/code-examples/with-ai-sdk-v5.md +26 -26
  2. package/.docs/organized/code-examples/with-assistant-transport.md +29 -29
  3. package/.docs/organized/code-examples/with-cloud.md +21 -21
  4. package/.docs/organized/code-examples/with-external-store.md +18 -18
  5. package/.docs/organized/code-examples/with-ffmpeg.md +22 -22
  6. package/.docs/organized/code-examples/with-langgraph.md +35 -120
  7. package/.docs/organized/code-examples/with-parent-id-grouping.md +18 -18
  8. package/.docs/organized/code-examples/with-react-hook-form.md +27 -27
  9. package/.docs/raw/docs/api-reference/primitives/Thread.mdx +40 -8
  10. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +64 -68
  11. package/.docs/raw/docs/getting-started.mdx +541 -152
  12. package/.docs/raw/docs/guides/Attachments.mdx +21 -0
  13. package/.docs/raw/docs/guides/ToolUI.mdx +112 -37
  14. package/.docs/raw/docs/guides/Tools.mdx +170 -6
  15. package/.docs/raw/docs/migrations/react-langgraph-v0-7.mdx +324 -0
  16. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +2 -2
  17. package/.docs/raw/docs/runtimes/custom/custom-thread-list.mdx +218 -0
  18. package/.docs/raw/docs/runtimes/custom/external-store.mdx +31 -24
  19. package/.docs/raw/docs/runtimes/langgraph/index.mdx +55 -20
  20. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +8 -3
  21. package/.docs/raw/docs/runtimes/pick-a-runtime.mdx +1 -1
  22. package/.docs/raw/docs/ui/AssistantModal.mdx +21 -0
  23. package/.docs/raw/docs/ui/AssistantSidebar.mdx +21 -0
  24. package/.docs/raw/docs/ui/Attachment.mdx +21 -0
  25. package/.docs/raw/docs/ui/Markdown.mdx +22 -1
  26. package/.docs/raw/docs/ui/Mermaid.mdx +22 -1
  27. package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +43 -2
  28. package/.docs/raw/docs/ui/Thread.mdx +374 -5
  29. package/.docs/raw/docs/ui/ThreadList.mdx +48 -2
  30. package/.docs/raw/docs/ui/ToolFallback.mdx +21 -0
  31. package/package.json +7 -7
  32. package/.docs/raw/docs/migrations/v0-7.mdx +0 -188
  33. package/.docs/raw/docs/migrations/v0-8.mdx +0 -160
  34. package/.docs/raw/docs/migrations/v0-9.mdx +0 -75
  35. package/.docs/raw/docs/ui/primitives/Thread.mdx +0 -197
@@ -4,26 +4,71 @@ title: Thread
4
4
 
5
5
  import { Steps, Step } from "fumadocs-ui/components/steps";
6
6
  import { Callout } from "fumadocs-ui/components/callout";
7
+ import { Tab, Tabs } from "fumadocs-ui/components/tabs";
8
+ import { ParametersTable } from "@/components/docs";
7
9
  import { ThreadSample } from "../../../components/samples/thread-sample";
8
10
 
11
+ A complete chat interface that combines message rendering, auto-scrolling, composer input,
12
+ attachments, and conditional UI states. Fully customizable and composable.
9
13
 
10
- ## Overview
11
-
12
- The raw message list and message composer UI.
13
14
 
14
15
  <ThreadSample />
15
16
 
17
+ ## Anatomy
18
+
19
+ The Thread component is built with the following primitives:
20
+
21
+ ```tsx
22
+ import { ThreadPrimitive } from "@assistant-ui/react";
23
+
24
+ <ThreadPrimitive.Root>
25
+ <ThreadPrimitive.Viewport>
26
+ <ThreadPrimitive.Empty />
27
+ <ThreadPrimitive.Messages
28
+ components={{
29
+ EditComposer,
30
+ UserMessage,
31
+ AssistantMessage,
32
+ }}
33
+ />
34
+ <ThreadPrimitive.ScrollToBottom />
35
+ </ThreadPrimitive.Viewport>
36
+ <ThreadPrimitive.Suggestion />
37
+ <ThreadPrimitive.If />
38
+ </ThreadPrimitive.Root>
39
+ ```
40
+
16
41
  ## Getting Started
17
42
 
18
43
  <Steps>
19
44
  <Step>
20
45
 
21
- ### Add `thread`
46
+ ### Add the component
47
+
48
+ <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
49
+ <Tab>
50
+
51
+ ```sh
52
+ npx assistant-ui@latest add thread
53
+ ```
54
+
55
+ </Tab>
56
+ <Tab>
57
+
58
+ ```sh
59
+ npx shadcn@latest add @assistant-ui/thread
60
+ ```
61
+
62
+ </Tab>
63
+ <Tab>
22
64
 
23
65
  ```sh
24
66
  npx shadcn@latest add "https://r.assistant-ui.com/thread"
25
67
  ```
26
68
 
69
+ </Tab>
70
+ </Tabs>
71
+
27
72
  This adds a `/components/assistant-ui/thread.tsx` file to your project, which you can adjust as needed.
28
73
 
29
74
  </Step>
@@ -34,7 +79,7 @@ This adds a `/components/assistant-ui/thread.tsx` file to your project, which yo
34
79
  ```tsx title="/app/page.tsx" {1,6}
35
80
  import { Thread } from "@/components/assistant-ui/thread";
36
81
 
37
- export default function Home() {
82
+ export default function Chat() {
38
83
  return (
39
84
  <div className="h-full">
40
85
  <Thread />
@@ -45,3 +90,327 @@ export default function Home() {
45
90
 
46
91
  </Step>
47
92
  </Steps>
93
+
94
+ ## Examples
95
+
96
+ ### Welcome Screen
97
+
98
+ ```tsx
99
+ <ThreadPrimitive.If empty>
100
+ <ThreadWelcome />
101
+ </ThreadPrimitive.If>
102
+ ```
103
+
104
+ ### Viewport Spacer
105
+
106
+ ```tsx
107
+ <ThreadPrimitive.If empty={false}>
108
+ <div className="min-h-8 grow" />
109
+ </ThreadPrimitive.If>
110
+ ```
111
+
112
+ ### Conditional Send/Cancel Button
113
+
114
+ ```tsx
115
+ <ThreadPrimitive.If running={false}>
116
+ <ComposerPrimitive.Send>
117
+ Send
118
+ </ComposerPrimitive.Send>
119
+ </ThreadPrimitive.If>
120
+
121
+ <ThreadPrimitive.If running>
122
+ <ComposerPrimitive.Cancel>
123
+ Cancel
124
+ </ComposerPrimitive.Cancel>
125
+ </ThreadPrimitive.If>
126
+ ```
127
+
128
+ ### Suggestions
129
+
130
+ ```tsx
131
+ <ThreadPrimitive.Suggestion
132
+ prompt="What's the weather in San Francisco?"
133
+ send
134
+ />
135
+ ```
136
+
137
+ ## API Reference
138
+
139
+ The following primitives are used within the Thread component and can be customized in your `/components/assistant-ui/thread.tsx` file.
140
+
141
+ ### Root
142
+
143
+ Contains all parts of the thread.
144
+
145
+ <ParametersTable
146
+ type="ThreadPrimitiveRootProps"
147
+ parameters={[
148
+ {
149
+ name: "asChild",
150
+ type: "boolean",
151
+ default: "false",
152
+ description: "Merge props with child element instead of rendering a wrapper div.",
153
+ },
154
+ {
155
+ name: "className",
156
+ type: "string",
157
+ description: "CSS class name.",
158
+ },
159
+ ]}
160
+ />
161
+
162
+ This primitive renders a `<div>` element unless `asChild` is set.
163
+
164
+ ### Viewport
165
+
166
+ The scrollable area containing all messages. Automatically scrolls to the bottom as new messages are added.
167
+
168
+ <ParametersTable
169
+ type="ThreadPrimitiveViewportProps"
170
+ parameters={[
171
+ {
172
+ name: "asChild",
173
+ type: "boolean",
174
+ default: "false",
175
+ description: "Merge props with child element instead of rendering a wrapper div.",
176
+ },
177
+ {
178
+ name: "autoScroll",
179
+ type: "boolean",
180
+ default: "true",
181
+ description:
182
+ "Whether to automatically scroll to the bottom when new messages are added while the viewport was previously scrolled to the bottom.",
183
+ },
184
+ {
185
+ name: "className",
186
+ type: "string",
187
+ description: "CSS class name.",
188
+ },
189
+ ]}
190
+ />
191
+
192
+ This primitive renders a `<div>` element unless `asChild` is set.
193
+
194
+ ### Messages
195
+
196
+ Renders all messages in the thread. This primitive renders a separate component for each message.
197
+
198
+ ```tsx
199
+ <ThreadPrimitive.Messages
200
+ components={{
201
+ UserMessage: UserMessage,
202
+ EditComposer: EditComposer,
203
+ AssistantMessage: AssistantMessage,
204
+ }}
205
+ />
206
+ ```
207
+
208
+ <ParametersTable
209
+ type="ThreadPrimitiveMessagesProps"
210
+ parameters={[
211
+ {
212
+ name: "components",
213
+ type: "MessageComponents",
214
+ required: true,
215
+ description: "Components to render for different message types.",
216
+ children: [
217
+ {
218
+ type: "MessageComponents",
219
+ parameters: [
220
+ {
221
+ name: "Message",
222
+ type: "ComponentType",
223
+ description: "Default component for all messages.",
224
+ },
225
+ {
226
+ name: "UserMessage",
227
+ type: "ComponentType",
228
+ description: "Component for user messages.",
229
+ },
230
+ {
231
+ name: "EditComposer",
232
+ type: "ComponentType",
233
+ description:
234
+ "Component for user messages being edited.",
235
+ },
236
+ {
237
+ name: "AssistantMessage",
238
+ type: "ComponentType",
239
+ description: "Component for assistant messages.",
240
+ },
241
+ {
242
+ name: "SystemMessage",
243
+ type: "ComponentType",
244
+ description: "Component for system messages.",
245
+ },
246
+ ],
247
+ },
248
+ ],
249
+ },
250
+ ]}
251
+ />
252
+
253
+
254
+ ### MessageByIndex
255
+
256
+ Renders a single message at the specified index.
257
+
258
+ ```tsx
259
+ <ThreadPrimitive.MessageByIndex
260
+ index={0}
261
+ components={{
262
+ UserMessage: UserMessage,
263
+ AssistantMessage: AssistantMessage
264
+ }}
265
+ />
266
+ ```
267
+
268
+ <ParametersTable
269
+ type="ThreadPrimitiveMessageByIndexProps"
270
+ parameters={[
271
+ {
272
+ name: "index",
273
+ type: "number",
274
+ required: true,
275
+ description: "The index of the message to render.",
276
+ },
277
+ {
278
+ name: "components",
279
+ type: "MessageComponents",
280
+ description: "Components to render for different message types.",
281
+ },
282
+ ]}
283
+ />
284
+
285
+ ### Empty
286
+
287
+ Renders children only when there are no messages in the thread.
288
+
289
+ <ParametersTable
290
+ type="ThreadPrimitiveEmptyProps"
291
+ parameters={[
292
+ {
293
+ name: "children",
294
+ type: "ReactNode",
295
+ description: "Content to display when the thread is empty.",
296
+ },
297
+ ]}
298
+ />
299
+
300
+ ### ScrollToBottom
301
+
302
+ A button to scroll the viewport to the bottom. Disabled when the viewport is already at the bottom.
303
+
304
+ <ParametersTable
305
+ type="ThreadPrimitiveScrollToBottomProps"
306
+ parameters={[
307
+ {
308
+ name: "asChild",
309
+ type: "boolean",
310
+ default: "false",
311
+ description: "Merge props with child element instead of rendering a wrapper button.",
312
+ },
313
+ {
314
+ name: "className",
315
+ type: "string",
316
+ description: "CSS class name.",
317
+ },
318
+ ]}
319
+ />
320
+
321
+ This primitive renders a `<button>` element unless `asChild` is set.
322
+
323
+ ### Suggestion
324
+
325
+ Shows a suggestion to the user. When clicked, replaces the composer's value with the suggestion and optionally sends it.
326
+
327
+ ```tsx
328
+ <ThreadPrimitive.Suggestion
329
+ prompt="Tell me about React hooks"
330
+ send
331
+ />
332
+ ```
333
+
334
+ <ParametersTable
335
+ type="ThreadPrimitiveSuggestionProps"
336
+ parameters={[
337
+ {
338
+ name: "prompt",
339
+ type: "string",
340
+ required: true,
341
+ description: "The suggestion text to use when clicked.",
342
+ },
343
+ {
344
+ name: "send",
345
+ type: "boolean",
346
+ description:
347
+ "When true, automatically sends the message. When false, replaces or appends the composer text with the suggestion - depending on the value of `clearComposer`",
348
+ },
349
+ {
350
+ name: "clearComposer",
351
+ type: "boolean",
352
+ default: "true",
353
+ description:
354
+ "Whether to clear the composer after sending. When send is set to false, determines if composer text is replaced with suggestion (true, default), or if the suggestion's prompt is appended to the composer text (false).",
355
+ },
356
+ {
357
+ name: "autoSend",
358
+ type: "boolean",
359
+ deprecated: true,
360
+ description: "Deprecated. Use 'send' instead.",
361
+ },
362
+ {
363
+ name: "method",
364
+ type: "'replace'",
365
+ deprecated: true,
366
+ description: "Deprecated. This parameter is no longer used.",
367
+ },
368
+ {
369
+ name: "asChild",
370
+ type: "boolean",
371
+ default: "false",
372
+ description: "Merge props with child element instead of rendering a wrapper button.",
373
+ },
374
+ {
375
+ name: "className",
376
+ type: "string",
377
+ description: "CSS class name.",
378
+ },
379
+ ]}
380
+ />
381
+
382
+ This primitive renders a `<button>` element unless `asChild` is set.
383
+
384
+ ### If
385
+
386
+ Conditionally renders children based on thread state.
387
+
388
+ <ParametersTable
389
+ type="ThreadPrimitiveIfProps"
390
+ parameters={[
391
+ {
392
+ name: "empty",
393
+ type: "boolean | undefined",
394
+ description: "Render children if the thread is empty (no messages).",
395
+ },
396
+ {
397
+ name: "running",
398
+ type: "boolean | undefined",
399
+ description: "Render children if the thread is running (assistant is responding).",
400
+ },
401
+ {
402
+ name: "disabled",
403
+ type: "boolean | undefined",
404
+ description: "Render children if the thread is disabled.",
405
+ },
406
+ ]}
407
+ />
408
+
409
+ <Callout type="info">
410
+ Multiple conditions can be combined on `ThreadPrimitive.If` - all specified conditions must match for children to render.
411
+ </Callout>
412
+
413
+
414
+ ## Related Components
415
+
416
+ - [ThreadList](/docs/ui/ThreadList) - List of threads, with or without sidebar
@@ -24,14 +24,60 @@ This demo uses **ThreadListSidebar**, which includes `thread-list` as a dependen
24
24
 
25
25
  ### Add the component
26
26
 
27
+ Use `threadlist-sidebar` for a complete sidebar layout or `thread-list` for custom layouts.
28
+
29
+ #### ThreadListSidebar
30
+
31
+ <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
32
+ <Tab>
33
+
34
+ ```sh
35
+ npx assistant-ui@latest add threadlist-sidebar
36
+ ```
37
+
38
+ </Tab>
39
+ <Tab>
40
+
41
+ ```sh
42
+ npx shadcn@latest add @assistant-ui/threadlist-sidebar
43
+ ```
44
+
45
+ </Tab>
46
+ <Tab>
47
+
27
48
  ```sh
28
- # Complete thread-list sidebar layout
29
49
  npx shadcn@latest add "https://r.assistant-ui.com/threadlist-sidebar"
50
+ ```
51
+
52
+ </Tab>
53
+ </Tabs>
30
54
 
31
- # Just the thread-list for custom layouts
55
+ #### ThreadList
56
+
57
+ <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
58
+ <Tab>
59
+
60
+ ```sh
61
+ npx assistant-ui@latest add thread-list
62
+ ```
63
+
64
+ </Tab>
65
+ <Tab>
66
+
67
+ ```sh
68
+ npx shadcn@latest add @assistant-ui/thread-list
69
+ ```
70
+
71
+ </Tab>
72
+ <Tab>
73
+
74
+ ```sh
32
75
  npx shadcn@latest add "https://r.assistant-ui.com/thread-list"
33
76
  ```
34
77
 
78
+ </Tab>
79
+ </Tabs>
80
+
35
81
  </Step>
36
82
  <Step>
37
83
 
@@ -3,6 +3,7 @@ title: ToolFallback
3
3
  ---
4
4
 
5
5
  import { Steps, Step } from "fumadocs-ui/components/steps";
6
+ import { Tab, Tabs } from "fumadocs-ui/components/tabs";
6
7
 
7
8
  ## Overview
8
9
 
@@ -15,10 +16,30 @@ The ToolFallback component displays a default ToolUI for tools that do not have
15
16
 
16
17
  ### Add `tool-fallback`
17
18
 
19
+ <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
20
+ <Tab>
21
+
22
+ ```sh
23
+ npx assistant-ui@latest add tool-fallback
24
+ ```
25
+
26
+ </Tab>
27
+ <Tab>
28
+
29
+ ```sh
30
+ npx shadcn@latest add @assistant-ui/tool-fallback
31
+ ```
32
+
33
+ </Tab>
34
+ <Tab>
35
+
18
36
  ```sh
19
37
  npx shadcn@latest add "https://r.assistant-ui.com/tool-fallback"
20
38
  ```
21
39
 
40
+ </Tab>
41
+ </Tabs>
42
+
22
43
  This adds a `/components/assistant-ui/tool-fallback.tsx` file to your project, which you can adjust as needed.
23
44
 
24
45
  </Step>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/mcp-docs-server",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "MCP server for assistant-ui documentation and examples",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,18 +8,18 @@
8
8
  "assistant-ui-mcp": "./dist/stdio.js"
9
9
  },
10
10
  "dependencies": {
11
- "@modelcontextprotocol/sdk": "^1.18.2",
12
- "zod": "^4.1.11",
11
+ "@modelcontextprotocol/sdk": "^1.20.1",
12
+ "zod": "^4.1.12",
13
13
  "gray-matter": "^4.0.3",
14
- "cross-env": "^10.0.0"
14
+ "cross-env": "^10.1.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@types/node": "^24.5.2",
17
+ "@types/node": "^24.8.1",
18
18
  "tsup": "^8.5.0",
19
19
  "tsx": "^4.20.6",
20
- "typescript": "^5.9.2",
20
+ "typescript": "^5.9.3",
21
21
  "vitest": "^3.2.4",
22
- "eslint": "^9.36.0"
22
+ "eslint": "^9.38.0"
23
23
  },
24
24
  "files": [
25
25
  "dist",