@mastra/mcp-docs-server 0.13.17-alpha.2 → 0.13.17-alpha.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.
Files changed (78) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +27 -0
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +10 -0
  3. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +24 -24
  4. package/.docs/organized/changelogs/%40mastra%2Fcore.md +49 -49
  5. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +16 -0
  6. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloudflare.md +12 -12
  7. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +32 -32
  8. package/.docs/organized/changelogs/%40mastra%2Fevals.md +10 -10
  9. package/.docs/organized/changelogs/%40mastra%2Ffirecrawl.md +10 -10
  10. package/.docs/organized/changelogs/%40mastra%2Fgithub.md +11 -11
  11. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +10 -10
  12. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +22 -22
  13. package/.docs/organized/changelogs/%40mastra%2Fmcp-registry-registry.md +11 -11
  14. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +10 -10
  15. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +14 -14
  16. package/.docs/organized/changelogs/%40mastra%2Fpg.md +10 -10
  17. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +31 -31
  18. package/.docs/organized/changelogs/%40mastra%2Fragie.md +10 -10
  19. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +7 -0
  20. package/.docs/organized/changelogs/%40mastra%2Fserver.md +23 -23
  21. package/.docs/organized/changelogs/%40mastra%2Fvoice-google-gemini-live.md +10 -0
  22. package/.docs/organized/changelogs/%40mastra%2Fvoice-openai-realtime.md +11 -11
  23. package/.docs/organized/changelogs/create-mastra.md +13 -13
  24. package/.docs/organized/changelogs/mastra.md +31 -31
  25. package/.docs/organized/code-examples/a2a.md +1 -1
  26. package/.docs/organized/code-examples/agent-network.md +1 -1
  27. package/.docs/organized/code-examples/agent.md +22 -1
  28. package/.docs/organized/code-examples/agui.md +1 -1
  29. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
  30. package/.docs/organized/code-examples/ai-sdk-v5.md +2 -2
  31. package/.docs/organized/code-examples/assistant-ui.md +3 -3
  32. package/.docs/organized/code-examples/bird-checker-with-express.md +1 -1
  33. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
  34. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
  35. package/.docs/organized/code-examples/client-side-tools.md +1 -1
  36. package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
  37. package/.docs/organized/code-examples/experimental-auth-weather-agent.md +1 -1
  38. package/.docs/organized/code-examples/fireworks-r1.md +1 -1
  39. package/.docs/organized/code-examples/mcp-configuration.md +2 -2
  40. package/.docs/organized/code-examples/mcp-registry-registry.md +1 -1
  41. package/.docs/organized/code-examples/memory-with-mem0.md +1 -1
  42. package/.docs/organized/code-examples/memory-with-processors.md +1 -1
  43. package/.docs/organized/code-examples/openapi-spec-writer.md +2 -2
  44. package/.docs/organized/code-examples/quick-start.md +1 -1
  45. package/.docs/organized/code-examples/stock-price-tool.md +1 -1
  46. package/.docs/organized/code-examples/weather-agent.md +1 -1
  47. package/.docs/organized/code-examples/workflow-ai-recruiter.md +1 -1
  48. package/.docs/organized/code-examples/workflow-with-inline-steps.md +1 -1
  49. package/.docs/organized/code-examples/workflow-with-memory.md +1 -1
  50. package/.docs/organized/code-examples/workflow-with-separate-steps.md +1 -1
  51. package/.docs/organized/code-examples/workflow-with-suspend-resume.md +1 -1
  52. package/.docs/raw/agents/overview.mdx +35 -4
  53. package/.docs/raw/deployment/monorepo.mdx +1 -1
  54. package/.docs/raw/frameworks/agentic-uis/ai-sdk.mdx +44 -14
  55. package/.docs/raw/getting-started/installation.mdx +52 -4
  56. package/.docs/raw/getting-started/templates.mdx +2 -22
  57. package/.docs/raw/reference/agents/generate.mdx +2 -2
  58. package/.docs/raw/reference/agents/getDefaultStreamOptions.mdx +2 -1
  59. package/.docs/raw/reference/agents/getDefaultVNextStreamOptions.mdx +1 -1
  60. package/.docs/raw/reference/agents/stream.mdx +2 -2
  61. package/.docs/raw/reference/agents/streamVNext.mdx +2 -4
  62. package/.docs/raw/reference/cli/build.mdx +0 -6
  63. package/.docs/raw/reference/cli/start.mdx +8 -1
  64. package/.docs/raw/reference/scorers/noise-sensitivity.mdx +237 -0
  65. package/.docs/raw/reference/scorers/prompt-alignment.mdx +369 -0
  66. package/.docs/raw/reference/workflows/run-methods/streamVNext.mdx +3 -5
  67. package/.docs/raw/scorers/off-the-shelf-scorers.mdx +2 -2
  68. package/.docs/raw/streaming/events.mdx +115 -0
  69. package/.docs/raw/streaming/overview.mdx +137 -0
  70. package/.docs/raw/streaming/tool-streaming.mdx +113 -0
  71. package/.docs/raw/streaming/workflow-streaming.mdx +97 -0
  72. package/.docs/raw/tools-mcp/overview.mdx +44 -0
  73. package/.docs/raw/workflows/overview.mdx +19 -17
  74. package/dist/stdio.js +5 -1
  75. package/dist/tools/docs.d.ts.map +1 -1
  76. package/package.json +7 -7
  77. package/.docs/raw/agents/streaming.mdx +0 -154
  78. package/.docs/raw/workflows/streaming.mdx +0 -115
@@ -1,154 +0,0 @@
1
- ---
2
- title: "Using Agent Streaming | Agents | Mastra Docs"
3
- description: Documentation on how to stream agents
4
- ---
5
-
6
- import { Callout } from "nextra/components";
7
-
8
- # Agent Streaming (VNext)
9
-
10
- Agents in Mastra support streaming responses for real-time interaction with clients. This enables progressive rendering of responses and better user experience.
11
-
12
- <Callout type="info">
13
- **Experimental API**: The `streamVNext` method shown in this guide is an experimental feature with enhanced streaming format support. It will replace the current `stream()` method after additional testing and refinement. For production use, consider using the stable [`stream()` method](/docs/agents/overview#streaming-responses) until `streamVNext` is finalized.
14
- </Callout>
15
-
16
- ## Usage
17
-
18
- The experimental streaming protocol uses the `streamVNext` method on an agent. This method now supports multiple output stream formats, for Mastra (default) and AI SDK v5.
19
-
20
-
21
- ## Format Parameter
22
-
23
- The `format` parameter determines the output stream type:
24
-
25
- - **`'mastra'` (default)**: Returns `MastraModelOutput` - Mastra's native streaming format
26
- - **`'aisdk'`**: Returns `AISDKV5OutputStream` - Compatible with AI SDK v5 interfaces like useChat.
27
-
28
- ```typescript
29
- // Mastra format (default)
30
- const mastraStream = await agent.streamVNext("Hello");
31
-
32
- // AI SDK v5 format
33
- const aiSdkStream = await agent.streamVNext("Hello", {
34
- format: 'aisdk'
35
- });
36
- ```
37
-
38
- ### Default Mastra Format
39
-
40
- By default, `streamVNext` returns a `MastraModelOutput` stream:
41
-
42
- ```typescript
43
- const stream = await agent.streamVNext("Tell me a story.");
44
-
45
- // Access the text stream
46
- for await (const chunk of stream.textStream) {
47
- console.log(chunk);
48
- }
49
-
50
- // Or get the full text after streaming
51
- const fullText = await stream.text;
52
- ```
53
-
54
- ### AI SDK v5 Compatibility
55
-
56
- For integration with AI SDK v5, use the `format: 'aisdk'` parameter to get an `AISDKV5OutputStream`:
57
-
58
- ```typescript
59
- const stream = await agent.streamVNext("Tell me a story.", {
60
- format: 'aisdk'
61
- });
62
-
63
- // The stream is now compatible with AI SDK v5 interfaces
64
- for await (const chunk of stream.fullStream) {
65
- // Process AI SDK v5 formatted chunks
66
- console.log(chunk);
67
- }
68
- ```
69
-
70
- ## Stream Properties
71
-
72
- Both stream formats provide access to various response properties:
73
-
74
- - `stream.textStream` - A readable stream that emits text chunks
75
- - `stream.text` - Promise that resolves to the full text response
76
- - `stream.finishReason` - The reason the agent stopped streaming
77
- - `stream.usage` - Token usage information
78
-
79
- ### How to use the stream in a tool
80
-
81
- Each tool gets a `writer` argument, which is a writable stream with a custom write function. This write function is used to write the tool's response to the stream.
82
-
83
- ```typescript filename="src/mastra/tools/test-tool.ts" showLineNumbers copy
84
- import { createTool } from "@mastra/core/tools";
85
- import { z } from "zod";
86
-
87
- export const weatherInfo = createTool({
88
- id: "Get Weather Information",
89
- inputSchema: z.object({
90
- city: z.string(),
91
- }),
92
- outputSchema: z.object({
93
- conditions: z.string(),
94
- temperature: z.number(),
95
- }),
96
- description: `Fetches the current weather information for a given city`,
97
- execute: async ({ context: { city }, writer }) => {
98
- writer.write({
99
- type: "weather-data",
100
- args: {
101
- city
102
- },
103
- status: "pending"
104
- })
105
- // Tool logic here (e.g., API call)
106
- console.log("Using tool to fetch weather information for", city);
107
-
108
- writer.write({
109
- type: "weather-data",
110
- args: {
111
- city
112
- },
113
- status: "success",
114
- result: {
115
- temperature: 20,
116
- conditions: "Sunny"
117
- }
118
- })
119
-
120
- return { temperature: 20, conditions: "Sunny" }; // Example return
121
- },
122
- });
123
- ```
124
-
125
- To use streaming within an agent-based tool, call `streamVNext` on the agent and pipe it to the writer:
126
-
127
- ```typescript filename="src/mastra/tools/test-tool.ts" showLineNumbers copy
128
- import { createTool } from "@mastra/core/tools";
129
- import { z } from "zod";
130
-
131
- export const weatherInfo = createTool({
132
- id: "Get Weather Information",
133
- description: `Fetches the current weather information for a given city`,
134
- inputSchema: z.object({
135
- city: z.string(),
136
- }),
137
- outputSchema: z.object({
138
- text: z.string(),
139
- }),
140
- execute: async ({ context: { city }, writer, mastra }) => {
141
- const agent = mastra.getAgent('weatherAgent')
142
- const stream = await agent.streamVNext(`What is the weather in ${city}?`);
143
-
144
- await stream.pipeTo(writer);
145
-
146
- return {
147
- text: await stream.text,
148
- }
149
- },
150
- });
151
- ```
152
-
153
- Piping the stream to the writer enables automatic aggregation of token usage across nested agent calls.
154
-
@@ -1,115 +0,0 @@
1
- ---
2
- title: "Using Workflow Streaming | Workflows | Mastra Docs"
3
- description: Documentation on how to stream workflows
4
- ---
5
-
6
- # Workflow Streaming
7
-
8
- Workflows in Mastra have access to a powerful streaming protocol! With seamless integration into tools or agents as a step, you can stream responses directly back to your clients, creating a more interactive and engaging experience.
9
-
10
- ## Usage
11
-
12
- To use the new protocol, you can use the `streamVNext` method on an workflow. This method will return a custom MatraWorkflowStream. This stream extends a ReadableStream, so all basic stream methods are available.
13
-
14
- ```typescript
15
- const run = await myWorkflow.createRunAsync();
16
- const stream = await run.streamVNext({ inputData: { city: 'New York' } });
17
-
18
- for await (const chunk of stream) {
19
- console.log(chunk);
20
- }
21
- ```
22
-
23
- Each chunk is a JSON object with the following properties:
24
-
25
- ```json
26
- {
27
- type: string;
28
- runId: string;
29
- from: string;
30
- payload: Record<string, any>;
31
- }
32
- ```
33
-
34
- We have a couple of utility functions on the stream to help you with the streaming process.
35
-
36
- - `stream.status` - The status of the workflow run.
37
- - `stream.result` - The result of the workflow run.
38
- - `stream.usage` - The total token usage of the workflow run.
39
-
40
- ### How to use the stream in a tool
41
-
42
- Each tool gets a `writer` argument, which is a writable stream with a custom write function. This write function is used to write the tool's response to the stream.
43
-
44
- ```typescript filename="src/mastra/workflows/weather.ts" showLineNumbers copy
45
- import { createStep } from "@mastra/core/workflows";
46
- import { z } from "zod";
47
-
48
- export const weatherInfo = createStep({
49
- id: "weather-info",
50
- inputSchema: z.object({
51
- city: z.string(),
52
- }),
53
- outputSchema: z.object({
54
- conditions: z.string(),
55
- temperature: z.number(),
56
- }),
57
- description: `Fetches the current weather information for a given city`,
58
- execute: async ({ inputData: { city }, writer }) => {
59
- writer.write({
60
- type: "weather-data",
61
- args: {
62
- city
63
- },
64
- status: "pending"
65
- })
66
- // Tool logic here (e.g., API call)
67
- console.log("Using tool to fetch weather information for", city);
68
-
69
- writer.write({
70
- type: "weather-data",
71
- args: {
72
- city
73
- },
74
- status: "success",
75
- result: {
76
- temperature: 20,
77
- conditions: "Sunny"
78
- }
79
- })
80
-
81
- return { temperature: 20, conditions: "Sunny" }; // Example return
82
- },
83
- });
84
- ```
85
-
86
- If you want to use the stream in an agent, you can use the `streamVNext` method on the agent and pipe it to the agent's input stream.
87
-
88
- ```typescript filename="src/mastra/workflows/weather.ts" showLineNumbers copy
89
- import { createStep } from "@mastra/core/workflows";
90
- import { z } from "zod";
91
-
92
- export const weatherInfo = createStep({
93
- id: "weather-info",
94
- inputSchema: z.object({
95
- city: z.string(),
96
- }),
97
- outputSchema: z.object({
98
- text: z.string(),
99
- }),
100
- description: `Fetches the current weather information for a given city`,
101
- execute: async ({ inputData: { city }, writer, mastra }) => {
102
- const agent = mastra.getAgent('weatherAgent')
103
- const stream = await agent.streamVNext(`What is the weather in ${city}?`);
104
-
105
- await stream.pipeTo(writer);
106
-
107
- return {
108
- text: await stream.text,
109
- }
110
- },
111
- });
112
- ```
113
-
114
- Piping the stream to the agent's input stream will allow us to automatically sum up the usage of the agent so the total usage count can be calculated.
115
-