@assistant-ui/mcp-docs-server 0.1.14 → 0.1.16

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 (57) hide show
  1. package/.docs/organized/code-examples/store-example.md +628 -0
  2. package/.docs/organized/code-examples/with-ag-ui.md +792 -178
  3. package/.docs/organized/code-examples/with-ai-sdk-v5.md +762 -209
  4. package/.docs/organized/code-examples/with-assistant-transport.md +707 -254
  5. package/.docs/organized/code-examples/with-cloud.md +848 -202
  6. package/.docs/organized/code-examples/with-custom-thread-list.md +1855 -0
  7. package/.docs/organized/code-examples/with-external-store.md +788 -172
  8. package/.docs/organized/code-examples/with-ffmpeg.md +796 -196
  9. package/.docs/organized/code-examples/with-langgraph.md +864 -230
  10. package/.docs/organized/code-examples/with-parent-id-grouping.md +785 -255
  11. package/.docs/organized/code-examples/with-react-hook-form.md +804 -226
  12. package/.docs/organized/code-examples/with-tanstack.md +1574 -0
  13. package/.docs/raw/blog/2024-07-29-hello/index.mdx +2 -3
  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/cli.mdx +396 -0
  21. package/.docs/raw/docs/cloud/persistence/ai-sdk.mdx +2 -3
  22. package/.docs/raw/docs/cloud/persistence/langgraph.mdx +2 -3
  23. package/.docs/raw/docs/devtools.mdx +2 -3
  24. package/.docs/raw/docs/getting-started.mdx +37 -1109
  25. package/.docs/raw/docs/guides/Attachments.mdx +3 -25
  26. package/.docs/raw/docs/guides/Branching.mdx +1 -1
  27. package/.docs/raw/docs/guides/Speech.mdx +1 -1
  28. package/.docs/raw/docs/guides/ToolUI.mdx +1 -1
  29. package/.docs/raw/docs/legacy/styled/AssistantModal.mdx +2 -3
  30. package/.docs/raw/docs/legacy/styled/Decomposition.mdx +6 -5
  31. package/.docs/raw/docs/legacy/styled/Markdown.mdx +2 -3
  32. package/.docs/raw/docs/legacy/styled/Thread.mdx +2 -3
  33. package/.docs/raw/docs/react-compatibility.mdx +2 -5
  34. package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +3 -4
  35. package/.docs/raw/docs/runtimes/ai-sdk/v4-legacy.mdx +3 -6
  36. package/.docs/raw/docs/runtimes/assistant-transport.mdx +891 -0
  37. package/.docs/raw/docs/runtimes/custom/external-store.mdx +2 -3
  38. package/.docs/raw/docs/runtimes/custom/local.mdx +11 -41
  39. package/.docs/raw/docs/runtimes/data-stream.mdx +15 -11
  40. package/.docs/raw/docs/runtimes/langgraph/index.mdx +4 -4
  41. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +1 -1
  42. package/.docs/raw/docs/runtimes/langgraph/tutorial/part-3.mdx +2 -3
  43. package/.docs/raw/docs/runtimes/langserve.mdx +2 -3
  44. package/.docs/raw/docs/runtimes/mastra/full-stack-integration.mdx +2 -3
  45. package/.docs/raw/docs/runtimes/mastra/separate-server-integration.mdx +2 -3
  46. package/.docs/raw/docs/ui/AssistantModal.mdx +3 -25
  47. package/.docs/raw/docs/ui/AssistantSidebar.mdx +2 -24
  48. package/.docs/raw/docs/ui/Attachment.mdx +3 -25
  49. package/.docs/raw/docs/ui/Markdown.mdx +2 -24
  50. package/.docs/raw/docs/ui/Mermaid.mdx +2 -24
  51. package/.docs/raw/docs/ui/Reasoning.mdx +2 -24
  52. package/.docs/raw/docs/ui/Scrollbar.mdx +4 -6
  53. package/.docs/raw/docs/ui/SyntaxHighlighting.mdx +3 -47
  54. package/.docs/raw/docs/ui/Thread.mdx +38 -53
  55. package/.docs/raw/docs/ui/ThreadList.mdx +4 -47
  56. package/.docs/raw/docs/ui/ToolFallback.mdx +2 -24
  57. package/package.json +15 -8
@@ -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.14",
3
+ "version": "0.1.16",
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.22.0",
12
- "zod": "^4.1.12",
11
+ "@modelcontextprotocol/sdk": "^1.24.3",
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
17
  "@types/node": "^24.10.1",
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.10"
21
+ "vitest": "^4.0.15"
22
22
  },
23
23
  "files": [
24
24
  "dist",
@@ -26,7 +26,15 @@
26
26
  "README.md"
27
27
  ],
28
28
  "publishConfig": {
29
- "access": "public"
29
+ "access": "public",
30
+ "provenance": true
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/assistant-ui/assistant-ui/tree/main/packages/mcp-docs-server"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/assistant-ui/assistant-ui/issues"
30
38
  },
31
39
  "scripts": {
32
40
  "clean": "tsx scripts/clean.mts",
@@ -36,7 +44,6 @@
36
44
  "dev": "tsx src/stdio.ts",
37
45
  "pretest": "pnpm build",
38
46
  "test": "vitest run",
39
- "test:watch": "vitest",
40
- "lint": "eslint ."
47
+ "test:watch": "vitest"
41
48
  }
42
49
  }