@mastra/mcp-docs-server 1.0.0-beta.7 → 1.0.0-beta.9
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/changelogs/%40internal%2Fchangeset-cli.md +1 -15
- package/.docs/organized/changelogs/%40internal%2Fexternal-types.md +1 -7
- package/.docs/organized/changelogs/%40internal%2Ftypes-builder.md +1 -55
- package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +48 -48
- package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
- package/.docs/organized/changelogs/%40mastra%2Fconvex.md +16 -0
- package/.docs/organized/changelogs/%40mastra%2Fcore.md +78 -78
- package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +18 -18
- package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +23 -23
- package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Flance.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Flibsql.md +65 -65
- package/.docs/organized/changelogs/%40mastra%2Floggers.md +29 -29
- package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +16 -16
- package/.docs/organized/changelogs/%40mastra%2Fmcp.md +12 -12
- package/.docs/organized/changelogs/%40mastra%2Fmemory.md +10 -10
- package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fmssql.md +17 -17
- package/.docs/organized/changelogs/%40mastra%2Fpg.md +69 -69
- package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +31 -31
- package/.docs/organized/changelogs/%40mastra%2Freact.md +14 -0
- package/.docs/organized/changelogs/%40mastra%2Fserver.md +56 -56
- package/.docs/organized/changelogs/%40mastra%2Fupstash.md +17 -17
- package/.docs/organized/changelogs/create-mastra.md +13 -13
- package/.docs/organized/changelogs/mastra.md +21 -21
- package/.docs/organized/code-examples/mcp-server-adapters.md +1 -2
- package/.docs/organized/code-examples/processors-with-ai-sdk.md +14 -0
- package/.docs/organized/code-examples/server-app-access.md +1 -1
- package/.docs/organized/code-examples/server-hono-adapter.md +1 -1
- package/.docs/raw/getting-started/studio.mdx +4 -2
- package/.docs/raw/guides/agent-frameworks/ai-sdk.mdx +161 -0
- package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +381 -431
- package/.docs/raw/guides/getting-started/quickstart.mdx +11 -0
- package/.docs/raw/guides/migrations/upgrade-to-v1/tools.mdx +3 -3
- package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +31 -0
- package/.docs/raw/reference/ai-sdk/chat-route.mdx +127 -0
- package/.docs/raw/reference/ai-sdk/handle-chat-stream.mdx +117 -0
- package/.docs/raw/reference/ai-sdk/handle-network-stream.mdx +64 -0
- package/.docs/raw/reference/ai-sdk/handle-workflow-stream.mdx +116 -0
- package/.docs/raw/reference/ai-sdk/network-route.mdx +99 -0
- package/.docs/raw/reference/ai-sdk/to-ai-sdk-stream.mdx +289 -0
- package/.docs/raw/reference/ai-sdk/workflow-route.mdx +110 -0
- package/.docs/raw/reference/client-js/agents.mdx +251 -67
- package/.docs/raw/reference/client-js/mastra-client.mdx +2 -2
- package/.docs/raw/reference/client-js/memory.mdx +4 -1
- package/.docs/raw/reference/core/getMemory.mdx +73 -0
- package/.docs/raw/reference/core/getStoredAgentById.mdx +183 -0
- package/.docs/raw/reference/core/listMemory.mdx +70 -0
- package/.docs/raw/reference/core/listStoredAgents.mdx +151 -0
- package/.docs/raw/reference/core/mastra-class.mdx +8 -0
- package/.docs/raw/reference/server/express-adapter.mdx +52 -0
- package/.docs/raw/reference/server/hono-adapter.mdx +54 -0
- package/.docs/raw/server-db/custom-api-routes.mdx +5 -5
- package/.docs/raw/server-db/server-adapters.mdx +94 -91
- package/.docs/raw/streaming/tool-streaming.mdx +10 -14
- package/.docs/raw/workflows/workflow-state.mdx +4 -5
- package/CHANGELOG.md +15 -0
- package/package.json +4 -4
|
@@ -18,9 +18,8 @@ By combining writable tool streams with agent streaming, you gain fine grained c
|
|
|
18
18
|
|
|
19
19
|
Agent streaming can be combined with tool calls, allowing tool outputs to be written directly into the agent’s streaming response. This makes it possible to surface tool activity as part of the overall interaction.
|
|
20
20
|
|
|
21
|
-
```typescript {
|
|
21
|
+
```typescript {2,9} showLineNumbers copy
|
|
22
22
|
import { Agent } from "@mastra/core/agent";
|
|
23
|
-
|
|
24
23
|
import { testTool } from "../tools/test-tool";
|
|
25
24
|
|
|
26
25
|
export const testAgent = new Agent({
|
|
@@ -34,30 +33,29 @@ export const testAgent = new Agent({
|
|
|
34
33
|
|
|
35
34
|
### Using `context.writer`
|
|
36
35
|
|
|
37
|
-
The `context.writer` object is available in a tool's `execute` function and can be used to emit custom events, data, or values into the active stream. This enables tools to provide intermediate results or status updates while execution is still in progress.
|
|
36
|
+
The `context.writer` object is available in a tool's `execute()` function and can be used to emit custom events, data, or values into the active stream. This enables tools to provide intermediate results or status updates while execution is still in progress.
|
|
38
37
|
|
|
39
38
|
:::warning
|
|
40
39
|
|
|
41
|
-
You must `await` the call to `writer.write(
|
|
40
|
+
You must `await` the call to `writer.write()` or else you will lock the stream and get a `WritableStream is locked` error.
|
|
42
41
|
|
|
43
42
|
:::
|
|
44
43
|
|
|
45
|
-
```typescript {
|
|
44
|
+
```typescript {4,7,14} showLineNumbers copy
|
|
46
45
|
import { createTool } from "@mastra/core/tools";
|
|
47
46
|
|
|
48
47
|
export const testTool = createTool({
|
|
49
|
-
// ...
|
|
50
48
|
execute: async (inputData, context) => {
|
|
51
49
|
const { value } = inputData;
|
|
52
50
|
|
|
53
|
-
|
|
51
|
+
await context?.writer?.write({
|
|
54
52
|
type: "custom-event",
|
|
55
53
|
status: "pending"
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
const response = await fetch(...);
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
await context?.writer?.write({
|
|
61
59
|
type: "custom-event",
|
|
62
60
|
status: "success"
|
|
63
61
|
});
|
|
@@ -69,14 +67,13 @@ export const testTool = createTool({
|
|
|
69
67
|
});
|
|
70
68
|
```
|
|
71
69
|
|
|
72
|
-
You can also use `writer.custom` if you want to emit top level stream chunks, This useful and relevant when
|
|
70
|
+
You can also use `writer.custom()` if you want to emit top level stream chunks, This useful and relevant when
|
|
73
71
|
integrating with UI Frameworks
|
|
74
72
|
|
|
75
|
-
```typescript {
|
|
73
|
+
```typescript {4,7,14} showLineNumbers copy
|
|
76
74
|
import { createTool } from "@mastra/core/tools";
|
|
77
75
|
|
|
78
76
|
export const testTool = createTool({
|
|
79
|
-
// ...
|
|
80
77
|
execute: async (inputData, context) => {
|
|
81
78
|
const { value } = inputData;
|
|
82
79
|
|
|
@@ -169,12 +166,11 @@ import { createTool } from "@mastra/core/tools";
|
|
|
169
166
|
import { z } from "zod";
|
|
170
167
|
|
|
171
168
|
export const testTool = createTool({
|
|
172
|
-
// ...
|
|
173
169
|
execute: async (inputData, context) => {
|
|
174
170
|
const { city } = inputData;
|
|
175
171
|
|
|
176
|
-
const
|
|
177
|
-
const stream = await
|
|
172
|
+
const agent = context?.mastra?.getAgent("testAgent");
|
|
173
|
+
const stream = await agent?.stream(`What is the weather in ${city}?`);
|
|
178
174
|
|
|
179
175
|
await stream!.fullStream.pipeTo(context?.writer!);
|
|
180
176
|
|
|
@@ -28,7 +28,7 @@ const step1 = createStep({
|
|
|
28
28
|
console.log(state.sharedCounter);
|
|
29
29
|
|
|
30
30
|
// Update state for subsequent steps
|
|
31
|
-
setState({
|
|
31
|
+
await setState({ sharedCounter: state.sharedCounter + 1 });
|
|
32
32
|
|
|
33
33
|
// Return output that flows to next step's inputData
|
|
34
34
|
return { step1Output: "processed" };
|
|
@@ -50,8 +50,7 @@ const step1 = createStep({
|
|
|
50
50
|
const { message } = inputData;
|
|
51
51
|
const { processedItems } = state;
|
|
52
52
|
|
|
53
|
-
setState({
|
|
54
|
-
...state,
|
|
53
|
+
await setState({
|
|
55
54
|
processedItems: [...processedItems, "item-1", "item-2"],
|
|
56
55
|
});
|
|
57
56
|
|
|
@@ -124,7 +123,7 @@ const step1 = createStep({
|
|
|
124
123
|
execute: async ({ state, setState, suspend, resumeData }) => {
|
|
125
124
|
if (!resumeData) {
|
|
126
125
|
// First run: update state and suspend
|
|
127
|
-
setState({
|
|
126
|
+
await setState({ count: state.count + 1, items: [...state.items, "item-1"] });
|
|
128
127
|
await suspend({});
|
|
129
128
|
return {};
|
|
130
129
|
}
|
|
@@ -166,7 +165,7 @@ const parentStep = createStep({
|
|
|
166
165
|
stateSchema: z.object({ sharedValue: z.string() }),
|
|
167
166
|
execute: async ({ state, setState }) => {
|
|
168
167
|
// Modify state before nested workflow runs
|
|
169
|
-
setState({
|
|
168
|
+
await setState({ sharedValue: "modified-by-parent" });
|
|
170
169
|
return {};
|
|
171
170
|
},
|
|
172
171
|
});
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @mastra/mcp-docs-server
|
|
2
2
|
|
|
3
|
+
## 1.0.0-beta.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`72df8ae`](https://github.com/mastra-ai/mastra/commit/72df8ae595584cdd7747d5c39ffaca45e4507227), [`9198899`](https://github.com/mastra-ai/mastra/commit/91988995c427b185c33714b7f3be955367911324), [`653e65a`](https://github.com/mastra-ai/mastra/commit/653e65ae1f9502c2958a32f47a5a2df11e612a92), [`c6fd6fe`](https://github.com/mastra-ai/mastra/commit/c6fd6fedd09e9cf8004b03a80925f5e94826ad7e), [`fdf5a82`](https://github.com/mastra-ai/mastra/commit/fdf5a822716b2fd7ba2e50bd4c1521851e208cd9), [`0bed332`](https://github.com/mastra-ai/mastra/commit/0bed332843f627202c6520eaf671771313cd20f3)]:
|
|
8
|
+
- @mastra/core@1.0.0-beta.9
|
|
9
|
+
- @mastra/mcp@1.0.0-beta.6
|
|
10
|
+
|
|
11
|
+
## 1.0.0-beta.8
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`0d41fe2`](https://github.com/mastra-ai/mastra/commit/0d41fe245355dfc66d61a0d9c85d9400aac351ff), [`6b3ba91`](https://github.com/mastra-ai/mastra/commit/6b3ba91494cc10394df96782f349a4f7b1e152cc), [`7907fd1`](https://github.com/mastra-ai/mastra/commit/7907fd1c5059813b7b870b81ca71041dc807331b)]:
|
|
16
|
+
- @mastra/core@1.0.0-beta.8
|
|
17
|
+
|
|
3
18
|
## 1.0.0-beta.7
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/mcp-docs-server",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.9",
|
|
4
4
|
"description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"@modelcontextprotocol/sdk": "^1.17.5",
|
|
29
29
|
"jsdom": "^26.1.0",
|
|
30
30
|
"zod": "^3.25.76",
|
|
31
|
-
"@mastra/core": "1.0.0-beta.
|
|
32
|
-
"@mastra/mcp": "^1.0.0-beta.
|
|
31
|
+
"@mastra/core": "1.0.0-beta.9",
|
|
32
|
+
"@mastra/mcp": "^1.0.0-beta.6"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@hono/node-server": "^1.19.6",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript": "^5.8.3",
|
|
47
47
|
"vitest": "4.0.12",
|
|
48
48
|
"@internal/lint": "0.0.53",
|
|
49
|
-
"@mastra/core": "1.0.0-beta.
|
|
49
|
+
"@mastra/core": "1.0.0-beta.9"
|
|
50
50
|
},
|
|
51
51
|
"homepage": "https://mastra.ai",
|
|
52
52
|
"repository": {
|