@assistant-ui/mcp-docs-server 0.1.15 → 0.1.17

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 (55) hide show
  1. package/.docs/organized/code-examples/store-example.md +249 -147
  2. package/.docs/organized/code-examples/with-ag-ui.md +250 -186
  3. package/.docs/organized/code-examples/with-ai-sdk-v5.md +250 -199
  4. package/.docs/organized/code-examples/with-assistant-transport.md +195 -243
  5. package/.docs/organized/code-examples/with-cloud.md +277 -226
  6. package/.docs/organized/code-examples/with-custom-thread-list.md +1855 -0
  7. package/.docs/organized/code-examples/with-external-store.md +246 -180
  8. package/.docs/organized/code-examples/with-ffmpeg.md +255 -189
  9. package/.docs/organized/code-examples/with-langgraph.md +293 -242
  10. package/.docs/organized/code-examples/with-parent-id-grouping.md +243 -263
  11. package/.docs/organized/code-examples/with-react-hook-form.md +262 -196
  12. package/.docs/organized/code-examples/with-tanstack.md +1578 -0
  13. package/.docs/raw/blog/2024-07-29-hello/index.mdx +2 -2
  14. package/.docs/raw/docs/api-reference/overview.mdx +6 -6
  15. package/.docs/raw/docs/api-reference/primitives/ActionBar.mdx +85 -4
  16. package/.docs/raw/docs/api-reference/primitives/AssistantIf.mdx +200 -0
  17. package/.docs/raw/docs/api-reference/primitives/Composer.mdx +0 -20
  18. package/.docs/raw/docs/api-reference/primitives/Message.mdx +0 -45
  19. package/.docs/raw/docs/api-reference/primitives/Thread.mdx +0 -50
  20. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
  21. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +2 -3
  22. package/.docs/raw/docs/devtools.mdx +2 -3
  23. package/.docs/raw/docs/getting-started.mdx +36 -1102
  24. package/.docs/raw/docs/guides/Attachments.mdx +3 -25
  25. package/.docs/raw/docs/guides/Branching.mdx +1 -1
  26. package/.docs/raw/docs/guides/Speech.mdx +1 -1
  27. package/.docs/raw/docs/guides/ToolUI.mdx +1 -1
  28. package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +2 -3
  29. package/.docs/raw/docs/legacy/styled/Decomposition.mdx +6 -5
  30. package/.docs/raw/docs/legacy/styled/Markdown.mdx +2 -3
  31. package/.docs/raw/docs/legacy/styled/Thread.mdx +2 -3
  32. package/.docs/raw/docs/react-compatibility.mdx +2 -5
  33. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +3 -4
  34. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +3 -6
  35. package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -3
  36. package/.docs/raw/docs/runtimes/custom/local.mdx +11 -41
  37. package/.docs/raw/docs/runtimes/data-stream.mdx +15 -11
  38. package/.docs/raw/docs/runtimes/langgraph/index.mdx +3 -3
  39. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
  40. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -3
  41. package/.docs/raw/docs/runtimes/langserve.mdx +2 -3
  42. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +2 -3
  43. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +2 -3
  44. package/.docs/raw/docs/ui/AssistantModal.mdx +3 -25
  45. package/.docs/raw/docs/ui/AssistantSidebar.mdx +2 -24
  46. package/.docs/raw/docs/ui/Attachment.mdx +3 -25
  47. package/.docs/raw/docs/ui/Markdown.mdx +2 -24
  48. package/.docs/raw/docs/ui/Mermaid.mdx +2 -24
  49. package/.docs/raw/docs/ui/Reasoning.mdx +2 -24
  50. package/.docs/raw/docs/ui/Scrollbar.mdx +4 -6
  51. package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +3 -47
  52. package/.docs/raw/docs/ui/Thread.mdx +38 -53
  53. package/.docs/raw/docs/ui/ThreadList.mdx +4 -47
  54. package/.docs/raw/docs/ui/ToolFallback.mdx +2 -24
  55. package/package.json +6 -7
@@ -4,7 +4,7 @@ title: "Mermaid Diagrams"
4
4
 
5
5
  import { Callout } from "fumadocs-ui/components/callout";
6
6
  import { Step, Steps } from "fumadocs-ui/components/steps";
7
- import { Tab, Tabs } from "fumadocs-ui/components/tabs";
7
+ import { InstallCommand } from "@/components/docs/install-command";
8
8
 
9
9
  Render Mermaid diagrams in chat messages with the `mermaid-diagram` component.
10
10
 
@@ -13,29 +13,7 @@ Render Mermaid diagrams in chat messages with the `mermaid-diagram` component.
13
13
 
14
14
  ### Add `mermaid-diagram` component
15
15
 
16
- <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
17
- <Tab>
18
-
19
- ```sh
20
- npx assistant-ui@latest add mermaid-diagram
21
- ```
22
-
23
- </Tab>
24
- <Tab>
25
-
26
- ```sh
27
- npx shadcn@latest add @assistant-ui/mermaid-diagram
28
- ```
29
-
30
- </Tab>
31
- <Tab>
32
-
33
- ```sh
34
- npx shadcn@latest add "https://r.assistant-ui.com/mermaid-diagram"
35
- ```
36
-
37
- </Tab>
38
- </Tabs>
16
+ <InstallCommand shadcn={["mermaid-diagram"]} />
39
17
 
40
18
  This will install the required dependencies and add the component to your project.
41
19
 
@@ -3,7 +3,7 @@ title: Reasoning
3
3
  ---
4
4
 
5
5
  import { Steps, Step } from "fumadocs-ui/components/steps";
6
- import { Tab, Tabs } from "fumadocs-ui/components/tabs";
6
+ import { InstallCommand } from "@/components/docs/install-command";
7
7
 
8
8
  ## Overview
9
9
 
@@ -16,29 +16,7 @@ The Reasoning component displays AI reasoning or thinking messages in a collapsi
16
16
 
17
17
  ### Add `reasoning`
18
18
 
19
- <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
20
- <Tab>
21
-
22
- ```sh
23
- npx assistant-ui@latest add reasoning
24
- ```
25
-
26
- </Tab>
27
- <Tab>
28
-
29
- ```sh
30
- npx shadcn@latest add @assistant-ui/reasoning
31
- ```
32
-
33
- </Tab>
34
- <Tab>
35
-
36
- ```sh
37
- npx shadcn@latest add "https://r.assistant-ui.com/reasoning"
38
- ```
39
-
40
- </Tab>
41
- </Tabs>
19
+ <InstallCommand shadcn={["reasoning"]} />
42
20
 
43
21
  This adds a `/components/assistant-ui/reasoning.tsx` file to your project, which you can adjust as needed.
44
22
 
@@ -2,22 +2,20 @@
2
2
  title: Custom Scrollbar
3
3
  ---
4
4
 
5
+ import { InstallCommand } from "@/components/docs/install-command";
6
+
5
7
  If you want to show a custom scrollbar UI of the Thread.Viewport in place of the system default, you can integrate `@radix-ui/react-scroll-area`.
6
8
  An example implementation of this is [shadcn/ui's Scroll Area](https://ui.shadcn.com/docs/components/scroll-area).
7
9
 
8
10
  ## Add shadcn Scroll Area
9
11
 
10
- ```sh
11
- npx shadcn@latest add scroll-area
12
- ```
12
+ <InstallCommand shadcn={["scroll-area"]} />
13
13
 
14
14
  ### @radix-ui/react-scroll-area v1.2.0 release candidate required
15
15
 
16
16
  The v1.2.0-rc.x release candidate can be installed via
17
17
 
18
- ```sh
19
- pnpm add @radix-ui/react-scroll-area@next
20
- ```
18
+ <InstallCommand npm={["@radix-ui/react-scroll-area@next"]} />
21
19
 
22
20
  ## Additional Styles
23
21
 
@@ -5,7 +5,7 @@ title: Syntax Highlighting
5
5
  import { Steps, Step } from "fumadocs-ui/components/steps";
6
6
  import { Callout } from "fumadocs-ui/components/callout";
7
7
  import { TypeTable } from "fumadocs-ui/components/type-table";
8
- import { Tab, Tabs } from "fumadocs-ui/components/tabs";
8
+ import { InstallCommand } from "@/components/docs/install-command";
9
9
 
10
10
  Syntax highlighting for code blocks in markdown.
11
11
 
@@ -26,29 +26,7 @@ Syntax highlighting for code blocks in markdown.
26
26
 
27
27
  #### Add `shiki-highlighter`
28
28
 
29
- <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
30
- <Tab>
31
-
32
- ```sh
33
- npx assistant-ui@latest add shiki-highlighter
34
- ```
35
-
36
- </Tab>
37
- <Tab>
38
-
39
- ```sh
40
- npx shadcn@latest add @assistant-ui/shiki-highlighter
41
- ```
42
-
43
- </Tab>
44
- <Tab>
45
-
46
- ```sh
47
- npx shadcn@latest add "https://r.assistant-ui.com/shiki-highlighter"
48
- ```
49
-
50
- </Tab>
51
- </Tabs>
29
+ <InstallCommand shadcn={["shiki-highlighter"]} />
52
30
 
53
31
  This adds a `/components/assistant-ui/shiki-highlighter.tsx` file to your project and
54
32
  installs the `react-shiki` dependency. The highlighter can be customized by editing
@@ -237,29 +215,7 @@ For more information, see [Shiki's documentation on dual and multi themes](https
237
215
 
238
216
  #### Add `syntax-highlighter`
239
217
 
240
- <Tabs items={["assistant-ui", "shadcn (namespace)", "shadcn"]}>
241
- <Tab>
242
-
243
- ```sh
244
- npx assistant-ui@latest add syntax-highlighter
245
- ```
246
-
247
- </Tab>
248
- <Tab>
249
-
250
- ```sh
251
- npx shadcn@latest add @assistant-ui/syntax-highlighter
252
- ```
253
-
254
- </Tab>
255
- <Tab>
256
-
257
- ```sh
258
- npx shadcn@latest add "https://r.assistant-ui.com/syntax-highlighter"
259
- ```
260
-
261
- </Tab>
262
- </Tabs>
218
+ <InstallCommand shadcn={["syntax-highlighter"]} />
263
219
 
264
220
  Adds a `/components/assistant-ui/syntax-highlighter.tsx` file to your project and installs the `react-syntax-highlighter` dependency.
265
221
 
@@ -4,9 +4,9 @@ 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
7
  import { ParametersTable } from "@/components/docs";
9
- import { ThreadSample } from "../../../components/samples/thread-sample";
8
+ import { InstallCommand } from "@/components/docs/install-command";
9
+ import { ThreadSample } from "@/components/samples/thread-sample";
10
10
 
11
11
  A complete chat interface that combines message rendering, auto-scrolling, composer input,
12
12
  attachments, and conditional UI states. Fully customizable and composable.
@@ -19,7 +19,7 @@ attachments, and conditional UI states. Fully customizable and composable.
19
19
  The Thread component is built with the following primitives:
20
20
 
21
21
  ```tsx
22
- import { ThreadPrimitive } from "@assistant-ui/react";
22
+ import { ThreadPrimitive, AssistantIf } from "@assistant-ui/react";
23
23
 
24
24
  <ThreadPrimitive.Root>
25
25
  <ThreadPrimitive.Viewport>
@@ -27,14 +27,14 @@ import { ThreadPrimitive } from "@assistant-ui/react";
27
27
  <ThreadPrimitive.Messages
28
28
  components={{
29
29
  EditComposer,
30
- UserMessage,
30
+ UserMessage,
31
31
  AssistantMessage,
32
32
  }}
33
33
  />
34
34
  <ThreadPrimitive.ScrollToBottom />
35
35
  </ThreadPrimitive.Viewport>
36
36
  <ThreadPrimitive.Suggestion />
37
- <ThreadPrimitive.If />
37
+ <AssistantIf condition={...} />
38
38
  </ThreadPrimitive.Root>
39
39
  ```
40
40
 
@@ -45,29 +45,7 @@ import { ThreadPrimitive } from "@assistant-ui/react";
45
45
 
46
46
  ### Add the component
47
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>
64
-
65
- ```sh
66
- npx shadcn@latest add "https://r.assistant-ui.com/thread"
67
- ```
68
-
69
- </Tab>
70
- </Tabs>
48
+ <InstallCommand shadcn={["thread"]} />
71
49
 
72
50
  This adds a `/components/assistant-ui/thread.tsx` file to your project, which you can adjust as needed.
73
51
 
@@ -96,33 +74,33 @@ export default function Chat() {
96
74
  ### Welcome Screen
97
75
 
98
76
  ```tsx
99
- <ThreadPrimitive.If empty>
77
+ <AssistantIf condition={({ thread }) => thread.isEmpty}>
100
78
  <ThreadWelcome />
101
- </ThreadPrimitive.If>
79
+ </AssistantIf>
102
80
  ```
103
81
 
104
82
  ### Viewport Spacer
105
83
 
106
84
  ```tsx
107
- <ThreadPrimitive.If empty={false}>
85
+ <AssistantIf condition={({ thread }) => !thread.isEmpty}>
108
86
  <div className="min-h-8 grow" />
109
- </ThreadPrimitive.If>
87
+ </AssistantIf>
110
88
  ```
111
89
 
112
90
  ### Conditional Send/Cancel Button
113
91
 
114
92
  ```tsx
115
- <ThreadPrimitive.If running={false}>
93
+ <AssistantIf condition={({ thread }) => !thread.isRunning}>
116
94
  <ComposerPrimitive.Send>
117
95
  Send
118
96
  </ComposerPrimitive.Send>
119
- </ThreadPrimitive.If>
97
+ </AssistantIf>
120
98
 
121
- <ThreadPrimitive.If running>
99
+ <AssistantIf condition={({ thread }) => thread.isRunning}>
122
100
  <ComposerPrimitive.Cancel>
123
101
  Cancel
124
102
  </ComposerPrimitive.Cancel>
125
- </ThreadPrimitive.If>
103
+ </AssistantIf>
126
104
  ```
127
105
 
128
106
  ### Suggestions
@@ -381,33 +359,40 @@ Shows a suggestion to the user. When clicked, replaces the composer's value with
381
359
 
382
360
  This primitive renders a `<button>` element unless `asChild` is set.
383
361
 
384
- ### If
362
+ ### AssistantIf
363
+
364
+ Conditionally renders children based on assistant state. This is a generic component that can access thread, message, composer, and other state.
385
365
 
386
- Conditionally renders children based on thread state.
366
+ ```tsx
367
+ import { AssistantIf } from "@assistant-ui/react";
368
+
369
+ <AssistantIf condition={({ thread }) => thread.isEmpty}>
370
+ <WelcomeScreen />
371
+ </AssistantIf>
372
+
373
+ <AssistantIf condition={({ thread }) => thread.isRunning}>
374
+ <LoadingIndicator />
375
+ </AssistantIf>
376
+
377
+ <AssistantIf condition={({ message }) => message.role === "assistant"}>
378
+ <AssistantAvatar />
379
+ </AssistantIf>
380
+ ```
387
381
 
388
382
  <ParametersTable
389
- type="ThreadPrimitiveIfProps"
383
+ type="AssistantIfProps"
390
384
  parameters={[
391
385
  {
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.",
386
+ name: "condition",
387
+ type: "(state: AssistantState) => boolean",
388
+ required: true,
389
+ description: "A function that receives the assistant state and returns whether to render children.",
405
390
  },
406
391
  ]}
407
392
  />
408
393
 
409
394
  <Callout type="info">
410
- Multiple conditions can be combined on `ThreadPrimitive.If` - all specified conditions must match for children to render.
395
+ The condition function receives an `AssistantState` object with access to `thread`, `message`, `composer`, `part`, and `attachment` state depending on context.
411
396
  </Callout>
412
397
 
413
398
 
@@ -5,7 +5,8 @@ title: ThreadList
5
5
  import { Steps, Step } from "fumadocs-ui/components/steps";
6
6
  import { Callout } from "fumadocs-ui/components/callout";
7
7
  import { Tabs, Tab } from "fumadocs-ui/components/tabs";
8
- import { ThreadListSample } from "../../../components/samples/threadlist-sample";
8
+ import { InstallCommand } from "@/components/docs/install-command";
9
+ import { ThreadListSample } from "@/components/samples/threadlist-sample";
9
10
 
10
11
  ## Overview
11
12
 
@@ -28,55 +29,11 @@ Use `threadlist-sidebar` for a complete sidebar layout or `thread-list` for cust
28
29
 
29
30
  #### ThreadListSidebar
30
31
 
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
-
48
- ```sh
49
- npx shadcn@latest add "https://r.assistant-ui.com/threadlist-sidebar"
50
- ```
51
-
52
- </Tab>
53
- </Tabs>
32
+ <InstallCommand shadcn={["threadlist-sidebar"]} />
54
33
 
55
34
  #### ThreadList
56
35
 
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
75
- npx shadcn@latest add "https://r.assistant-ui.com/thread-list"
76
- ```
77
-
78
- </Tab>
79
- </Tabs>
36
+ <InstallCommand shadcn={["thread-list"]} />
80
37
 
81
38
  </Step>
82
39
  <Step>
@@ -3,7 +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
+ import { InstallCommand } from "@/components/docs/install-command";
7
7
 
8
8
  ## Overview
9
9
 
@@ -16,29 +16,7 @@ The ToolFallback component displays a default ToolUI for tools that do not have
16
16
 
17
17
  ### Add `tool-fallback`
18
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
-
36
- ```sh
37
- npx shadcn@latest add "https://r.assistant-ui.com/tool-fallback"
38
- ```
39
-
40
- </Tab>
41
- </Tabs>
19
+ <InstallCommand shadcn={["tool-fallback"]} />
42
20
 
43
21
  This adds a `/components/assistant-ui/tool-fallback.tsx` file to your project, which you can adjust as needed.
44
22
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/mcp-docs-server",
3
- "version": "0.1.15",
3
+ "version": "0.1.17",
4
4
  "description": "MCP server for assistant-ui documentation and examples",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,17 +8,17 @@
8
8
  "assistant-ui-mcp": "./dist/stdio.js"
9
9
  },
10
10
  "dependencies": {
11
- "@modelcontextprotocol/sdk": "^1.23.0",
11
+ "@modelcontextprotocol/sdk": "^1.24.3",
12
12
  "zod": "^4.1.13",
13
13
  "gray-matter": "^4.0.3",
14
14
  "cross-env": "^10.1.0"
15
15
  },
16
16
  "devDependencies": {
17
- "@types/node": "^24.10.1",
17
+ "@types/node": "^25.0.0",
18
18
  "tsup": "^8.5.1",
19
- "tsx": "^4.20.6",
19
+ "tsx": "^4.21.0",
20
20
  "typescript": "^5.9.3",
21
- "vitest": "^4.0.14"
21
+ "vitest": "^4.0.15"
22
22
  },
23
23
  "files": [
24
24
  "dist",
@@ -44,7 +44,6 @@
44
44
  "dev": "tsx src/stdio.ts",
45
45
  "pretest": "pnpm build",
46
46
  "test": "vitest run",
47
- "test:watch": "vitest",
48
- "lint": "eslint ."
47
+ "test:watch": "vitest"
49
48
  }
50
49
  }