@assistant-ui/mcp-docs-server 0.1.2 → 0.1.4
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/.docs/organized/code-examples/local-ollama.md +7 -7
- package/.docs/organized/code-examples/search-agent-for-e-commerce.md +9 -9
- package/.docs/organized/code-examples/with-ai-sdk.md +7 -7
- package/.docs/organized/code-examples/with-cloud.md +7 -7
- package/.docs/organized/code-examples/with-external-store.md +6 -6
- package/.docs/organized/code-examples/with-ffmpeg.md +10 -10
- package/.docs/organized/code-examples/with-langgraph.md +10 -10
- package/.docs/organized/code-examples/with-openai-assistants.md +7 -7
- package/.docs/organized/code-examples/with-react-hook-form.md +10 -10
- package/.docs/organized/code-examples/with-vercel-ai-rsc.md +7 -7
- package/.docs/raw/docs/api-reference/context-providers/{TextContentPartProvider.mdx → TextMessagePartProvider.mdx} +3 -3
- package/.docs/raw/docs/api-reference/integrations/react-hook-form.mdx +2 -2
- package/.docs/raw/docs/api-reference/overview.mdx +23 -23
- package/.docs/raw/docs/api-reference/primitives/Error.mdx +5 -3
- package/.docs/raw/docs/api-reference/primitives/Message.mdx +32 -0
- package/.docs/raw/docs/api-reference/primitives/{ContentPart.mdx → MessagePart.mdx} +41 -41
- package/.docs/raw/docs/api-reference/runtimes/MessagePartRuntime.mdx +22 -0
- package/.docs/raw/docs/api-reference/runtimes/ThreadListRuntime.mdx +1 -0
- package/.docs/raw/docs/api-reference/runtimes/ThreadRuntime.mdx +1 -0
- package/.docs/raw/docs/concepts/runtime-layer.mdx +7 -7
- package/.docs/raw/docs/copilots/make-assistant-tool-ui.mdx +79 -16
- package/.docs/raw/docs/copilots/make-assistant-tool.mdx +111 -7
- package/.docs/raw/docs/copilots/model-context.mdx +4 -1
- package/.docs/raw/docs/copilots/motivation.mdx +4 -1
- package/.docs/raw/docs/getting-started.mdx +11 -10
- package/.docs/raw/docs/guides/Attachments.mdx +24 -21
- package/.docs/raw/docs/guides/ToolUI.mdx +48 -8
- package/.docs/raw/docs/guides/Tools.mdx +24 -6
- package/.docs/raw/docs/mcp-docs-server.mdx +1 -3
- package/.docs/raw/docs/migrations/v0-11.mdx +169 -0
- package/.docs/raw/docs/migrations/v0-7.mdx +8 -8
- package/.docs/raw/docs/migrations/v0-8.mdx +14 -14
- package/.docs/raw/docs/migrations/v0-9.mdx +3 -3
- package/.docs/raw/docs/runtimes/ai-sdk/rsc.mdx +2 -2
- package/.docs/raw/docs/runtimes/ai-sdk/use-assistant-hook.mdx +1 -1
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat-hook.mdx +2 -2
- package/.docs/raw/docs/runtimes/ai-sdk/use-chat.mdx +2 -2
- package/.docs/raw/docs/runtimes/custom/external-store.mdx +5 -5
- package/.docs/raw/docs/runtimes/custom/local.mdx +3 -3
- package/.docs/raw/docs/runtimes/langgraph/tutorial/part-2.mdx +2 -2
- package/.docs/raw/docs/ui/Attachment.mdx +5 -2
- package/.docs/raw/docs/ui/Markdown.mdx +2 -3
- package/.docs/raw/docs/ui/ToolFallback.mdx +2 -2
- package/dist/{chunk-CZCDQ3YH.js → chunk-JS4PWCVA.js} +1 -1
- package/dist/{chunk-C7O7EFKU.js → chunk-M2RKUM66.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/prepare-docs/prepare.js +1 -1
- package/dist/stdio.js +1 -1
- package/package.json +5 -5
- package/.docs/raw/docs/api-reference/runtimes/ContentPartRuntime.mdx +0 -22
|
@@ -23,9 +23,9 @@ The following components and types have been moved to `@assistant-ui/react-edge`
|
|
|
23
23
|
- `CoreUserMessage`
|
|
24
24
|
- `CoreAssistantMessage`
|
|
25
25
|
- `CoreSystemMessage`
|
|
26
|
-
- `
|
|
27
|
-
- `
|
|
28
|
-
- `
|
|
26
|
+
- `CoreUserMessagePart`
|
|
27
|
+
- `CoreAssistantMessagePart`
|
|
28
|
+
- `CoreToolCallMessagePart`
|
|
29
29
|
- Core message converters
|
|
30
30
|
- `fromCoreMessages`
|
|
31
31
|
- `fromCoreMessage`
|
|
@@ -206,10 +206,10 @@ export default function RootLayout({
|
|
|
206
206
|
|
|
207
207
|
## Set up RSCDisplay
|
|
208
208
|
|
|
209
|
-
Pass the `RSCDisplay` component to your `MessagePrimitive.
|
|
209
|
+
Pass the `RSCDisplay` component to your `MessagePrimitive.Parts`:
|
|
210
210
|
|
|
211
211
|
```tsx
|
|
212
|
-
<MessagePrimitive.
|
|
212
|
+
<MessagePrimitive.Parts components={{ Text: RSCDisplay }} />
|
|
213
213
|
```
|
|
214
214
|
|
|
215
215
|
(if you are using react-ui: `<Thread assistantMessage={{ components: { Text: RSCDisplay } }} />`)
|
|
@@ -188,7 +188,7 @@ const MyAssistantMessage = () => {
|
|
|
188
188
|
|
|
189
189
|
const WeatherToolUI = makeAssistantToolUI({
|
|
190
190
|
render: () => {
|
|
191
|
-
const aiSDKMessage =
|
|
191
|
+
const aiSDKMessage = useMessagePart((p) => getExternalStoreMessages(p)[0]);
|
|
192
192
|
// ...
|
|
193
193
|
},
|
|
194
194
|
});
|
|
@@ -131,8 +131,8 @@ const MyAssistantMessage = () => {
|
|
|
131
131
|
|
|
132
132
|
const WeatherToolUI = makeAssistantToolUI({
|
|
133
133
|
render: () => {
|
|
134
|
-
const aiSDKMessage =
|
|
134
|
+
const aiSDKMessage = useMessagePart((p) => getExternalStoreMessages(p)[0]);
|
|
135
135
|
// ...
|
|
136
136
|
},
|
|
137
137
|
});
|
|
138
|
-
```
|
|
138
|
+
```
|
|
@@ -129,8 +129,8 @@ const MyAssistantMessage = () => {
|
|
|
129
129
|
|
|
130
130
|
const WeatherToolUI = makeAssistantToolUI({
|
|
131
131
|
render: () => {
|
|
132
|
-
const aiSDKMessage =
|
|
132
|
+
const aiSDKMessage = useMessagePart((p) => getExternalStoreMessages(p)[0]);
|
|
133
133
|
// ...
|
|
134
134
|
},
|
|
135
135
|
});
|
|
136
|
-
```
|
|
136
|
+
```
|
|
@@ -1144,13 +1144,13 @@ const MyComponent = () => {
|
|
|
1144
1144
|
messages for display.
|
|
1145
1145
|
</Callout>
|
|
1146
1146
|
|
|
1147
|
-
###
|
|
1147
|
+
### Message part Access
|
|
1148
1148
|
|
|
1149
1149
|
```tsx
|
|
1150
1150
|
const ToolUI = makeAssistantToolUI({
|
|
1151
1151
|
render: () => {
|
|
1152
|
-
const originalMessages =
|
|
1153
|
-
// Access original message data for this
|
|
1152
|
+
const originalMessages = useMessagePart((p) => getExternalStoreMessages(p));
|
|
1153
|
+
// Access original message data for this message part
|
|
1154
1154
|
},
|
|
1155
1155
|
});
|
|
1156
1156
|
```
|
|
@@ -1500,8 +1500,8 @@ A flexible message format that can be converted to assistant-ui's internal forma
|
|
|
1500
1500
|
},
|
|
1501
1501
|
{
|
|
1502
1502
|
name: "content",
|
|
1503
|
-
type: "string | readonly
|
|
1504
|
-
description: "Message content as string or structured
|
|
1503
|
+
type: "string | readonly MessagePart[]",
|
|
1504
|
+
description: "Message content as string or structured message parts",
|
|
1505
1505
|
required: true,
|
|
1506
1506
|
},
|
|
1507
1507
|
{
|
|
@@ -841,9 +841,9 @@ function MyCustomRuntimeProvider({ children }) {
|
|
|
841
841
|
</Callout>
|
|
842
842
|
|
|
843
843
|
<Callout type="warning">
|
|
844
|
-
**`useThreadRuntime` vs `useLocalThreadRuntime`:**
|
|
845
|
-
Access the current thread's runtime from within components
|
|
846
|
-
`useLocalThreadRuntime` - Create a new single-thread runtime instance
|
|
844
|
+
**`useThreadRuntime` vs `useLocalThreadRuntime`:**
|
|
845
|
+
- `useThreadRuntime` - Access the current thread's runtime from within components
|
|
846
|
+
- `useLocalThreadRuntime` - Create a new single-thread runtime instance
|
|
847
847
|
</Callout>
|
|
848
848
|
|
|
849
849
|
## Integration Examples
|
|
@@ -273,12 +273,12 @@ npx shadcn@latest add button
|
|
|
273
273
|
Then create a new file under `/components/tools/ToolFallback.tsx` to define the fallback UI.
|
|
274
274
|
|
|
275
275
|
```tsx title="@/components/tools/ToolFallback.tsx"
|
|
276
|
-
import {
|
|
276
|
+
import { ToolCallMessagePartComponent } from "@assistant-ui/react";
|
|
277
277
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
|
|
278
278
|
import { useState } from "react";
|
|
279
279
|
import { Button } from "../ui/button";
|
|
280
280
|
|
|
281
|
-
export const ToolFallback:
|
|
281
|
+
export const ToolFallback: ToolCallMessagePartComponent = ({
|
|
282
282
|
toolName,
|
|
283
283
|
argsText,
|
|
284
284
|
result,
|
|
@@ -13,7 +13,10 @@ The Attachment components let the user attach files and view the attachments.
|
|
|
13
13
|
<AttachmentSample />
|
|
14
14
|
|
|
15
15
|
<Callout type="info">
|
|
16
|
-
**Note:** These components provide the UI for attachments, but you also need
|
|
16
|
+
**Note:** These components provide the UI for attachments, but you also need
|
|
17
|
+
to configure attachment adapters in your runtime to handle file uploads and
|
|
18
|
+
processing. See the [Attachments Guide](/docs/guides/Attachments) for complete
|
|
19
|
+
setup instructions.
|
|
17
20
|
</Callout>
|
|
18
21
|
|
|
19
22
|
## Getting Started
|
|
@@ -69,7 +72,7 @@ const UserMessage: FC = () => {
|
|
|
69
72
|
<UserMessageAttachments />
|
|
70
73
|
|
|
71
74
|
<div className="...">
|
|
72
|
-
<MessagePrimitive.
|
|
75
|
+
<MessagePrimitive.Parts />
|
|
73
76
|
</div>
|
|
74
77
|
|
|
75
78
|
<BranchPicker className="..." />
|
|
@@ -30,7 +30,7 @@ This adds a `/components/assistant-ui/markdown-text.tsx` file to your project, w
|
|
|
30
30
|
|
|
31
31
|
### Use it in your application
|
|
32
32
|
|
|
33
|
-
Pass the `MarkdownText` component to the `MessagePrimitive.
|
|
33
|
+
Pass the `MarkdownText` component to the `MessagePrimitive.Parts` component
|
|
34
34
|
|
|
35
35
|
```tsx twoslash title="/components/assistant-ui/thread.tsx" {1,11}
|
|
36
36
|
// @filename: /components/assistant-ui/markdown-text.tsx
|
|
@@ -52,7 +52,7 @@ const AssistantMessage: FC = () => {
|
|
|
52
52
|
return (
|
|
53
53
|
<MessagePrimitive.Root className="...">
|
|
54
54
|
<div className="...">
|
|
55
|
-
<MessagePrimitive.
|
|
55
|
+
<MessagePrimitive.Parts components={{ Text: MarkdownText }} />
|
|
56
56
|
</div>
|
|
57
57
|
<AssistantActionBar />
|
|
58
58
|
|
|
@@ -69,4 +69,3 @@ const AssistantMessage: FC = () => {
|
|
|
69
69
|
## Syntax highlighting
|
|
70
70
|
|
|
71
71
|
Syntax Highlighting is not included by default, see [Syntax Highlighting](/docs/ui/SyntaxHighlighting) to learn how to add it.
|
|
72
|
-
|
|
@@ -26,7 +26,7 @@ This adds a `/components/assistant-ui/tool-fallback.tsx` file to your project, w
|
|
|
26
26
|
|
|
27
27
|
### Use it in your application
|
|
28
28
|
|
|
29
|
-
Pass the `ToolFallback` component to the `MessagePrimitive.
|
|
29
|
+
Pass the `ToolFallback` component to the `MessagePrimitive.Parts` component
|
|
30
30
|
|
|
31
31
|
```tsx twoslash title="/components/assistant-ui/thread.tsx" {1,11}
|
|
32
32
|
// @filename: /components/assistant-ui/tool-fallback.tsx
|
|
@@ -48,7 +48,7 @@ const AssistantMessage: FC = () => {
|
|
|
48
48
|
return (
|
|
49
49
|
<MessagePrimitive.Root className="...">
|
|
50
50
|
<div className="...">
|
|
51
|
-
<MessagePrimitive.
|
|
51
|
+
<MessagePrimitive.Parts
|
|
52
52
|
components={{ tools: { Fallback: ToolFallback } }}
|
|
53
53
|
/>
|
|
54
54
|
</div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { logger, IS_PREPARE_MODE, MDX_EXTENSION, DOCS_PATH, MAX_FILE_SIZE, CODE_EXAMPLES_PATH, MD_EXTENSION } from './chunk-
|
|
1
|
+
import { logger, IS_PREPARE_MODE, MDX_EXTENSION, DOCS_PATH, MAX_FILE_SIZE, CODE_EXAMPLES_PATH, MD_EXTENSION } from './chunk-M2RKUM66.js';
|
|
2
2
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
4
|
import { z } from 'zod';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { runServer, server } from './chunk-
|
|
1
|
+
export { runServer, server } from './chunk-JS4PWCVA.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ROOT_DIR, logger, EXAMPLES_PATH } from '../chunk-
|
|
1
|
+
import { ROOT_DIR, logger, EXAMPLES_PATH } from '../chunk-M2RKUM66.js';
|
|
2
2
|
import { rm, mkdir, readdir, readFile, writeFile, copyFile } from 'fs/promises';
|
|
3
3
|
import { join, extname, relative } from 'path';
|
|
4
4
|
|
package/dist/stdio.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/mcp-docs-server",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
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.
|
|
12
|
-
"zod": "^3.25.
|
|
11
|
+
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
12
|
+
"zod": "^3.25.67",
|
|
13
13
|
"gray-matter": "^4.0.3",
|
|
14
14
|
"cross-env": "^7.0.3"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@types/node": "^24.0.
|
|
17
|
+
"@types/node": "^24.0.4",
|
|
18
18
|
"tsup": "^8.5.0",
|
|
19
19
|
"tsx": "^4.20.3",
|
|
20
20
|
"typescript": "^5.8.3",
|
|
21
|
-
"vitest": "^3.2.
|
|
21
|
+
"vitest": "^3.2.4",
|
|
22
22
|
"eslint": "^9.29.0"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: ContentPartRuntime
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
import { ParametersTable } from "@/components/docs";
|
|
6
|
-
import { ContentPartState } from "@/components/docs/parameters/context";
|
|
7
|
-
|
|
8
|
-
### `useContentPart`
|
|
9
|
-
|
|
10
|
-
Access the content part state:
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
import { useContentPart } from "@assistant-ui/react";
|
|
14
|
-
|
|
15
|
-
const part = useContentPart();
|
|
16
|
-
const partState = useContentPart.getState();
|
|
17
|
-
|
|
18
|
-
const status = useContentPart((m) => m.status);
|
|
19
|
-
const statusAgain = useContentPart.getState().status;
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
<ParametersTable {...ContentPartState} />
|