@mastra/mcp-docs-server 1.0.0-beta.5 → 1.0.0-beta.7

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 (163) hide show
  1. package/.docs/organized/changelogs/%40mastra%2Fagent-builder.md +9 -9
  2. package/.docs/organized/changelogs/%40mastra%2Fai-sdk.md +67 -67
  3. package/.docs/organized/changelogs/%40mastra%2Fastra.md +10 -10
  4. package/.docs/organized/changelogs/%40mastra%2Fchroma.md +12 -12
  5. package/.docs/organized/changelogs/%40mastra%2Fclickhouse.md +57 -57
  6. package/.docs/organized/changelogs/%40mastra%2Fclient-js.md +110 -110
  7. package/.docs/organized/changelogs/%40mastra%2Fcloudflare-d1.md +57 -57
  8. package/.docs/organized/changelogs/%40mastra%2Fcloudflare.md +57 -57
  9. package/.docs/organized/changelogs/%40mastra%2Fcodemod.md +6 -0
  10. package/.docs/organized/changelogs/%40mastra%2Fconvex.md +60 -0
  11. package/.docs/organized/changelogs/%40mastra%2Fcore.md +358 -358
  12. package/.docs/organized/changelogs/%40mastra%2Fcouchbase.md +11 -11
  13. package/.docs/organized/changelogs/%40mastra%2Fdeployer-cloud.md +24 -24
  14. package/.docs/organized/changelogs/%40mastra%2Fdeployer-netlify.md +12 -12
  15. package/.docs/organized/changelogs/%40mastra%2Fdeployer.md +79 -79
  16. package/.docs/organized/changelogs/%40mastra%2Fduckdb.md +42 -0
  17. package/.docs/organized/changelogs/%40mastra%2Fdynamodb.md +57 -57
  18. package/.docs/organized/changelogs/%40mastra%2Felasticsearch.md +61 -0
  19. package/.docs/organized/changelogs/%40mastra%2Fevals.md +12 -12
  20. package/.docs/organized/changelogs/%40mastra%2Flance.md +57 -57
  21. package/.docs/organized/changelogs/%40mastra%2Flibsql.md +55 -55
  22. package/.docs/organized/changelogs/%40mastra%2Floggers.md +12 -12
  23. package/.docs/organized/changelogs/%40mastra%2Fmcp-docs-server.md +17 -17
  24. package/.docs/organized/changelogs/%40mastra%2Fmcp.md +125 -125
  25. package/.docs/organized/changelogs/%40mastra%2Fmemory.md +36 -36
  26. package/.docs/organized/changelogs/%40mastra%2Fmongodb.md +57 -57
  27. package/.docs/organized/changelogs/%40mastra%2Fmssql.md +57 -57
  28. package/.docs/organized/changelogs/%40mastra%2Fopensearch.md +10 -10
  29. package/.docs/organized/changelogs/%40mastra%2Fpg.md +59 -59
  30. package/.docs/organized/changelogs/%40mastra%2Fpinecone.md +10 -10
  31. package/.docs/organized/changelogs/%40mastra%2Fplayground-ui.md +77 -77
  32. package/.docs/organized/changelogs/%40mastra%2Fqdrant.md +10 -10
  33. package/.docs/organized/changelogs/%40mastra%2Frag.md +43 -43
  34. package/.docs/organized/changelogs/%40mastra%2Freact.md +16 -0
  35. package/.docs/organized/changelogs/%40mastra%2Fs3vectors.md +9 -0
  36. package/.docs/organized/changelogs/%40mastra%2Fschema-compat.md +6 -0
  37. package/.docs/organized/changelogs/%40mastra%2Fserver.md +113 -113
  38. package/.docs/organized/changelogs/%40mastra%2Fturbopuffer.md +10 -10
  39. package/.docs/organized/changelogs/%40mastra%2Fupstash.md +57 -57
  40. package/.docs/organized/changelogs/%40mastra%2Fvectorize.md +10 -10
  41. package/.docs/organized/changelogs/%40mastra%2Fvoice-google.md +19 -19
  42. package/.docs/organized/changelogs/create-mastra.md +15 -15
  43. package/.docs/organized/changelogs/mastra.md +30 -30
  44. package/.docs/organized/code-examples/agui.md +1 -0
  45. package/.docs/organized/code-examples/ai-elements.md +1 -1
  46. package/.docs/organized/code-examples/ai-sdk-useChat.md +1 -1
  47. package/.docs/organized/code-examples/ai-sdk-v5.md +2 -1
  48. package/.docs/organized/code-examples/assistant-ui.md +1 -1
  49. package/.docs/organized/code-examples/bird-checker-with-nextjs-and-eval.md +1 -1
  50. package/.docs/organized/code-examples/bird-checker-with-nextjs.md +1 -1
  51. package/.docs/organized/code-examples/crypto-chatbot.md +1 -1
  52. package/.docs/organized/code-examples/mcp-server-adapters.md +721 -0
  53. package/.docs/organized/code-examples/server-app-access.md +342 -0
  54. package/.docs/organized/code-examples/server-express-adapter.md +87 -0
  55. package/.docs/organized/code-examples/server-hono-adapter.md +85 -0
  56. package/.docs/raw/agents/agent-approval.mdx +189 -0
  57. package/.docs/raw/agents/guardrails.mdx +13 -9
  58. package/.docs/raw/agents/networks.mdx +1 -0
  59. package/.docs/raw/agents/overview.mdx +8 -152
  60. package/.docs/raw/agents/processors.mdx +279 -0
  61. package/.docs/raw/agents/structured-output.mdx +224 -0
  62. package/.docs/raw/deployment/cloud-providers/index.mdx +19 -26
  63. package/.docs/raw/deployment/cloud-providers/netlify-deployer.mdx +44 -13
  64. package/.docs/raw/evals/running-in-ci.mdx +0 -2
  65. package/.docs/raw/{guides/getting-started → getting-started}/manual-install.mdx +2 -2
  66. package/.docs/raw/getting-started/start.mdx +1 -1
  67. package/.docs/raw/guides/build-your-ui/ai-sdk-ui.mdx +8 -0
  68. package/.docs/raw/guides/getting-started/quickstart.mdx +1 -1
  69. package/.docs/raw/guides/guide/whatsapp-chat-bot.mdx +421 -0
  70. package/.docs/raw/guides/index.mdx +3 -35
  71. package/.docs/raw/guides/migrations/upgrade-to-v1/agent.mdx +11 -0
  72. package/.docs/raw/guides/migrations/upgrade-to-v1/workflows.mdx +37 -0
  73. package/.docs/raw/index.mdx +1 -1
  74. package/.docs/raw/memory/memory-processors.mdx +265 -79
  75. package/.docs/raw/memory/working-memory.mdx +11 -2
  76. package/.docs/raw/observability/overview.mdx +0 -1
  77. package/.docs/raw/observability/tracing/bridges/otel.mdx +200 -0
  78. package/.docs/raw/observability/tracing/exporters/arize.mdx +36 -0
  79. package/.docs/raw/observability/tracing/exporters/braintrust.mdx +19 -0
  80. package/.docs/raw/observability/tracing/exporters/langfuse.mdx +83 -0
  81. package/.docs/raw/observability/tracing/exporters/langsmith.mdx +12 -0
  82. package/.docs/raw/observability/tracing/exporters/otel.mdx +34 -22
  83. package/.docs/raw/observability/tracing/exporters/posthog.mdx +20 -0
  84. package/.docs/raw/observability/tracing/overview.mdx +76 -6
  85. package/.docs/raw/observability/tracing/processors/sensitive-data-filter.mdx +0 -1
  86. package/.docs/raw/rag/retrieval.mdx +23 -6
  87. package/.docs/raw/rag/vector-databases.mdx +93 -2
  88. package/.docs/raw/reference/agents/generate.mdx +55 -6
  89. package/.docs/raw/reference/agents/network.mdx +44 -0
  90. package/.docs/raw/reference/client-js/memory.mdx +43 -0
  91. package/.docs/raw/reference/client-js/workflows.mdx +92 -63
  92. package/.docs/raw/reference/deployer/netlify.mdx +1 -2
  93. package/.docs/raw/reference/evals/scorer-utils.mdx +362 -0
  94. package/.docs/raw/reference/index.mdx +1 -0
  95. package/.docs/raw/reference/observability/tracing/bridges/otel.mdx +177 -0
  96. package/.docs/raw/reference/observability/tracing/configuration.mdx +0 -4
  97. package/.docs/raw/reference/observability/tracing/exporters/arize.mdx +29 -0
  98. package/.docs/raw/reference/observability/tracing/exporters/langfuse.mdx +43 -0
  99. package/.docs/raw/reference/observability/tracing/exporters/langsmith.mdx +17 -1
  100. package/.docs/raw/reference/observability/tracing/exporters/otel.mdx +33 -43
  101. package/.docs/raw/reference/observability/tracing/instances.mdx +0 -4
  102. package/.docs/raw/reference/observability/tracing/interfaces.mdx +29 -4
  103. package/.docs/raw/reference/observability/tracing/spans.mdx +0 -4
  104. package/.docs/raw/reference/processors/language-detector.mdx +9 -2
  105. package/.docs/raw/reference/processors/message-history-processor.mdx +131 -0
  106. package/.docs/raw/reference/processors/moderation-processor.mdx +10 -3
  107. package/.docs/raw/reference/processors/pii-detector.mdx +10 -3
  108. package/.docs/raw/reference/processors/processor-interface.mdx +502 -0
  109. package/.docs/raw/reference/processors/prompt-injection-detector.mdx +9 -2
  110. package/.docs/raw/reference/processors/semantic-recall-processor.mdx +197 -0
  111. package/.docs/raw/reference/processors/system-prompt-scrubber.mdx +2 -2
  112. package/.docs/raw/reference/processors/tool-call-filter.mdx +125 -0
  113. package/.docs/raw/reference/processors/working-memory-processor.mdx +221 -0
  114. package/.docs/raw/reference/server/create-route.mdx +314 -0
  115. package/.docs/raw/reference/server/express-adapter.mdx +193 -0
  116. package/.docs/raw/reference/server/hono-adapter.mdx +174 -0
  117. package/.docs/raw/reference/server/mastra-server.mdx +316 -0
  118. package/.docs/raw/reference/server/routes.mdx +250 -0
  119. package/.docs/raw/reference/storage/cloudflare-d1.mdx +37 -0
  120. package/.docs/raw/reference/storage/convex.mdx +164 -0
  121. package/.docs/raw/reference/storage/lance.mdx +33 -0
  122. package/.docs/raw/reference/storage/libsql.mdx +37 -0
  123. package/.docs/raw/reference/storage/mongodb.mdx +39 -0
  124. package/.docs/raw/reference/storage/mssql.mdx +37 -0
  125. package/.docs/raw/reference/storage/postgresql.mdx +37 -0
  126. package/.docs/raw/reference/streaming/ChunkType.mdx +1 -1
  127. package/.docs/raw/reference/streaming/agents/stream.mdx +56 -1
  128. package/.docs/raw/reference/streaming/workflows/observeStream.mdx +7 -9
  129. package/.docs/raw/reference/streaming/workflows/{resumeStreamVNext.mdx → resumeStream.mdx} +51 -11
  130. package/.docs/raw/reference/streaming/workflows/stream.mdx +83 -24
  131. package/.docs/raw/reference/streaming/workflows/timeTravelStream.mdx +170 -0
  132. package/.docs/raw/reference/tools/mcp-client.mdx +128 -18
  133. package/.docs/raw/reference/vectors/convex.mdx +429 -0
  134. package/.docs/raw/reference/vectors/duckdb.mdx +462 -0
  135. package/.docs/raw/reference/vectors/elasticsearch.mdx +310 -0
  136. package/.docs/raw/reference/voice/google.mdx +159 -20
  137. package/.docs/raw/reference/workflows/run-methods/restart.mdx +142 -0
  138. package/.docs/raw/reference/workflows/run-methods/resume.mdx +44 -0
  139. package/.docs/raw/reference/workflows/run-methods/start.mdx +44 -0
  140. package/.docs/raw/reference/workflows/run-methods/timeTravel.mdx +310 -0
  141. package/.docs/raw/reference/workflows/run.mdx +27 -5
  142. package/.docs/raw/reference/workflows/step.mdx +13 -0
  143. package/.docs/raw/reference/workflows/workflow.mdx +19 -0
  144. package/.docs/raw/server-db/custom-adapters.mdx +380 -0
  145. package/.docs/raw/server-db/mastra-server.mdx +16 -8
  146. package/.docs/raw/server-db/request-context.mdx +0 -1
  147. package/.docs/raw/server-db/server-adapters.mdx +286 -0
  148. package/.docs/raw/server-db/storage.mdx +11 -0
  149. package/.docs/raw/streaming/overview.mdx +6 -6
  150. package/.docs/raw/streaming/tool-streaming.mdx +2 -2
  151. package/.docs/raw/streaming/workflow-streaming.mdx +5 -11
  152. package/.docs/raw/workflows/error-handling.mdx +1 -0
  153. package/.docs/raw/workflows/human-in-the-loop.mdx +4 -4
  154. package/.docs/raw/workflows/overview.mdx +56 -44
  155. package/.docs/raw/workflows/snapshots.mdx +1 -0
  156. package/.docs/raw/workflows/suspend-and-resume.mdx +85 -16
  157. package/.docs/raw/workflows/time-travel.mdx +313 -0
  158. package/.docs/raw/workflows/workflow-state.mdx +191 -0
  159. package/CHANGELOG.md +16 -0
  160. package/package.json +4 -4
  161. package/.docs/raw/agents/human-in-the-loop-with-tools.mdx +0 -91
  162. package/.docs/raw/reference/streaming/workflows/observeStreamVNext.mdx +0 -47
  163. package/.docs/raw/reference/streaming/workflows/streamVNext.mdx +0 -153
@@ -0,0 +1,224 @@
1
+ ---
2
+ title: "Structured Output | Agents"
3
+ description: "Learn how to generate structured data from agents using schemas and validation."
4
+ ---
5
+
6
+ import Tabs from "@theme/Tabs";
7
+ import TabItem from "@theme/TabItem";
8
+
9
+ # Structured Output
10
+
11
+ Structured output lets an agent return an object that matches the shape defined by a schema instead of returning text. The schema tells the model what fields to produce, and the model ensures the final result fits that shape.
12
+
13
+ ## When to use structured output
14
+
15
+ Use structured output when you need an agent to return a data object rather than text. Having well defined fields can make it simpler to pull out the values you need for API calls, UI rendering, or application logic.
16
+
17
+ ## Defining schemas
18
+
19
+ Agents can return structured data by defining the expected output with either [Zod](https://zod.dev/) or [JSON Schema](https://json-schema.org/). Zod is recommended because it provides TypeScript type inference and runtime validation, while JSON Schema is useful when you need a language agnostic format.
20
+
21
+ <Tabs>
22
+ <TabItem value="zod" label="Zod">
23
+
24
+ Define the `output` shape using [Zod](https://zod.dev/):
25
+
26
+ ```typescript showLineNumbers copy
27
+ import { z } from "zod";
28
+
29
+ const response = await testAgent.generate("Help me plan my day.", {
30
+ structuredOutput: {
31
+ schema: z.array(
32
+ z.object({
33
+ name: z.string(),
34
+ activities: z.array(z.string()),
35
+ }),
36
+ ),
37
+ },
38
+ });
39
+
40
+ console.log(response.object);
41
+ ```
42
+
43
+ </TabItem>
44
+ <TabItem value="json-schema" label="JSON Schema">
45
+
46
+ You can also use JSON Schema to define your output structure:
47
+
48
+ ```typescript showLineNumbers copy
49
+ const response = await testAgent.generate("Help me plan my day.", {
50
+ structuredOutput: {
51
+ schema: {
52
+ type: "array",
53
+ items: {
54
+ type: "object",
55
+ properties: {
56
+ name: { type: "string" },
57
+ activities: {
58
+ type: "array",
59
+ items: { type: "string" },
60
+ },
61
+ },
62
+ required: ["name", "activities"],
63
+ },
64
+ },
65
+ },
66
+ });
67
+
68
+ console.log(response.object);
69
+ ```
70
+
71
+ </TabItem>
72
+ </Tabs>
73
+
74
+
75
+ > See [.generate()](/reference/v1/agents/generate#structuredoutput) for a full list of configuration options.
76
+
77
+ ### Example output
78
+
79
+ The `response.object` will contain the structured data as defined by the schema.
80
+
81
+ ```json
82
+ [
83
+ {
84
+ "name": "Morning Routine",
85
+ "activities": ["Wake up at 7am", "Exercise", "Shower", "Breakfast"]
86
+ },
87
+ {
88
+ "name": "Work",
89
+ "activities": ["Check emails", "Team meeting", "Lunch break"]
90
+ },
91
+ {
92
+ "name": "Evening",
93
+ "activities": ["Dinner", "Relax", "Read a book", "Sleep by 10pm"]
94
+ }
95
+ ]
96
+ ```
97
+
98
+ ## Streaming
99
+
100
+ Streaming also supports structured output. The final structured object is available on `stream.fullStream` and after the stream completes on `stream.object`. Text stream chunks are still emitted, but they contain natural language text rather than structured data.
101
+
102
+ ```typescript showLineNumbers copy
103
+ import { z } from "zod";
104
+
105
+ const stream = await testAgent.stream("Help me plan my day.", {
106
+ structuredOutput: {
107
+ schema: z.array(
108
+ z.object({
109
+ name: z.string(),
110
+ activities: z.array(z.string())
111
+ })
112
+ ),
113
+ },
114
+ });
115
+
116
+ for await (const chunk of stream.fullStream) {
117
+ if (chunk.type === "object-result") {
118
+ console.log("\n", JSON.stringify(chunk, null, 2));
119
+ }
120
+ process.stdout.write(JSON.stringify(chunk));
121
+ }
122
+
123
+ console.log(await stream.object)
124
+
125
+ for await (const chunk of stream.textStream) {
126
+ process.stdout.write(chunk);
127
+ }
128
+ ```
129
+
130
+ ## Structuring agent
131
+
132
+ When your main agent isn't proficient at creating structured output you can provide a `model` to `structuredOutput`. In this case, Mastra uses a second agent under the hood to extract structured data from the main agent's natural language response. This makes two LLM calls, one to generate the response and another to turn that response into the structured object, which adds some latency and cost but can improve accuracy for complex structuring tasks.
133
+
134
+ ```typescript showLineNumbers copy
135
+ import { z } from "zod";
136
+
137
+ const response = await testAgent.generate("Analyze the TypeScript programming language.", {
138
+ structuredOutput: {
139
+ schema: z.object({
140
+ overview: z.string(),
141
+ strengths: z.array(z.string()),
142
+ weaknesses: z.array(z.string()),
143
+ useCases: z.array(z.object({
144
+ scenario: z.string(),
145
+ reasoning: z.string(),
146
+ })),
147
+ comparison: z.object({
148
+ similarTo: z.array(z.string()),
149
+ differentiators: z.array(z.string()),
150
+ }),
151
+ }),
152
+ model: "openai/gpt-4o",
153
+ },
154
+ });
155
+
156
+ console.log(response.object);
157
+ ```
158
+
159
+ ## Response format
160
+
161
+ By default, Mastra passes the schema to the model provider using the `response_format` API parameter. Most model providers have built-in support for this, which reliably enforces the schema.
162
+
163
+ If your model provider doesn't support `response_format`, you'll get an error from the API. When this happens, set `jsonPromptInjection: true`. This adds the schema to the system prompt instead, instructing the model to output JSON. This is less reliable than the API parameter approach.
164
+
165
+ ```typescript showLineNumbers copy
166
+ import { z } from "zod";
167
+
168
+ const response = await testAgent.generate("Help me plan my day.", {
169
+ structuredOutput: {
170
+ schema: z.array(
171
+ z.object({
172
+ name: z.string(),
173
+ activities: z.array(z.string()),
174
+ }),
175
+ ),
176
+ jsonPromptInjection: true,
177
+ },
178
+ });
179
+
180
+ console.log(response.object);
181
+ ```
182
+
183
+ :::info[Gemini 2.5 with tools]
184
+
185
+ Gemini 2.5 models do not support combining `response_format` (structured output) with function calling (tools) in the same API call. If your agent has tools and you're using `structuredOutput` with a Gemini 2.5 model, you must set `jsonPromptInjection: true` to avoid the error `Function calling with a response mime type: 'application/json' is unsupported`.
186
+
187
+ ```typescript
188
+ const response = await agentWithTools.generate("Your prompt", {
189
+ structuredOutput: {
190
+ schema: yourSchema,
191
+ jsonPromptInjection: true, // Required for Gemini 2.5 when tools are present
192
+ },
193
+ });
194
+ ```
195
+ :::
196
+
197
+ ## Error handling
198
+
199
+ When schema validation fails, you can control how errors are handled using `errorStrategy`. The default `strict` strategy throws an error, while `warn` logs a warning and continues. The `fallback` strategy returns the values provided using `fallbackValue`.
200
+
201
+ ```typescript showLineNumbers copy
202
+ import { z } from "zod";
203
+
204
+ const response = await testAgent.generate("Tell me about TypeScript.", {
205
+ structuredOutput: {
206
+ schema: z.object({
207
+ summary: z.string(),
208
+ keyFeatures: z.array(z.string())
209
+ }),
210
+ errorStrategy: "fallback",
211
+ fallbackValue: {
212
+ summary: "TypeScript is a typed superset of JavaScript",
213
+ keyFeatures: ["Static typing", "Compiles to JavaScript", "Better tooling"]
214
+ }
215
+ }
216
+ });
217
+
218
+ console.log(response.object);
219
+ ```
220
+
221
+ ## Related
222
+
223
+ - [Using Tools](/docs/v1/agents/using-tools)
224
+ - [Agent Memory](/docs/v1/agents/agent-memory)
@@ -15,7 +15,6 @@ Standalone Mastra applications can be deployed to popular cloud providers, see o
15
15
  - [Netlify](/docs/v1/deployment/cloud-providers/netlify-deployer)
16
16
  - [Vercel](/docs/v1/deployment/cloud-providers/vercel-deployer)
17
17
 
18
-
19
18
  For self-hosted Node.js server deployment, see the [Creating A Mastra Server](/docs/v1/deployment/building-mastra) guide.
20
19
 
21
20
  ## Prerequisites
@@ -30,33 +29,27 @@ Before deploying to a cloud provider, ensure you have:
30
29
 
31
30
  ## LibSQLStore
32
31
 
33
- `LibSQLStore` writes to the local filesystem, which is not supported in cloud environments that use ephemeral file systems. If you're deploying to platforms like **AWS Lambda**, **Azure App Services**, or **Digital Ocean App Platform**, you **must remove** all usage of `LibSQLStore`.
32
+ `LibSQLStore` writes to the local filesystem, which is not supported in cloud environments that use ephemeral file systems. If you're deploying to platforms like AWS Lambda, Netlify, Azure App Services, or Digital Ocean App Platform, you must remove all usage of `LibSQLStore`.
34
33
 
35
- Specifically, ensure you've removed it from both `src/mastra/index.ts` and `src/mastra/agents/weather-agent.ts`:
34
+ Specifically, ensure you've removed it from all Mastra files, including configuration on the main Mastra instance and any agents using it, e.g. for memory storage.
36
35
 
37
- ```typescript title="src/mastra/index.ts" showLineNumbers
38
- export const mastra = new Mastra({
39
- // ...
40
- storage: new LibSQLStore({
41
- id: 'mastra-storage',
42
- // [!code --]
43
- // stores telemetry, scorer results, ... into memory storage, if it needs to persist, change to file:../mastra.db // [!code --]
44
- url: ":memory:", // [!code --]
45
- }), //[!code --]
46
- });
36
+ ```diff title="src/mastra/index.ts"
37
+ export const mastra = new Mastra({
38
+ - storage: new LibSQLStore({
39
+ - id: 'mastra-storage',
40
+ - url: ":memory:",
41
+ - }),
42
+ });
47
43
  ```
48
44
 
49
- ```typescript title="src/mastra/agents/weather-agent.ts" showLineNumbers
50
- export const weatherAgent = new Agent({
51
- id: "weather-agent",
52
- // ..
53
- memory: new Memory({
54
- // [!code --]
55
- storage: new LibSQLStore({
56
- id: 'mastra-storage',
57
- // [!code --]
58
- url: "file:../mastra.db", // path is relative to the .mastra/output directory // [!code --]
59
- }), // [!code --]
60
- }), // [!code --]
61
- });
45
+ ```diff
46
+ export const weatherAgent = new Agent({
47
+ id: "weather-agent",
48
+ memory: new Memory({
49
+ - storage: new LibSQLStore({
50
+ - id: 'mastra-storage',
51
+ - url: "file:../mastra.db",
52
+ - }),
53
+ }),
54
+ });
62
55
  ```
@@ -15,12 +15,11 @@ npm install @mastra/deployer-netlify@beta
15
15
 
16
16
  ## Usage example
17
17
 
18
- ```typescript title="src/mastra/index.ts" showLineNumbers copy
18
+ ```typescript title="src/mastra/index.ts" copy
19
19
  import { Mastra } from "@mastra/core";
20
20
  import { NetlifyDeployer } from "@mastra/deployer-netlify";
21
21
 
22
22
  export const mastra = new Mastra({
23
- // ...
24
23
  deployer: new NetlifyDeployer(),
25
24
  });
26
25
  ```
@@ -43,32 +42,64 @@ Your project is now configured with automatic deployments which occur whenever y
43
42
 
44
43
  ## Manual deployment
45
44
 
46
- Manual deployments are also possible using the [Netlify CLI](https://docs.netlify.com/cli/get-started/). With the Netlify CLI installed run the following from your project root to deploy your application.
45
+ Manual deployments are also possible using the [Netlify CLI](https://docs.netlify.com/cli/get-started/). With the Netlify CLI installed run the following from your project root to deploy your application. You can also run `netlify dev` from your project root to test your Mastra application locally.
47
46
 
48
47
  ```bash copy
49
48
  netlify deploy --prod
50
49
  ```
51
50
 
52
- > You can also run `netlify dev` from your project root to test your Mastra application locally.
51
+ :::warning
53
52
 
54
- ## Build output
53
+ When using `netlify deploy` instead of continuous deployment, you need to create a `netlify.toml` file with these contents:
54
+
55
+ ```toml
56
+ [build]
57
+ command = "npm run build"
58
+ publish = ".netlify/v1/functions"
55
59
 
56
- The build output for Mastra applications using the `NetlifyDeployer` includes all agents, tools, and workflows in your project, along with Mastra specific files required to run your application on Netlify.
60
+ [functions]
61
+ directory = ".netlify/v1/functions"
62
+ node_bundler = "none"
63
+ included_files = [".netlify/v1/functions/**"]
57
64
 
65
+ [[redirects]]
66
+ from = "/*"
67
+ to = "/.netlify/functions/api/:splat"
68
+ status = 200
69
+
70
+ [build.environment]
71
+ NODE_VERSION = "22.13.0"
58
72
  ```
59
- .netlify/
60
- └── v1/
61
- ├── functions/
62
- │ └── api/
63
- │ └── index.mjs
64
- └── config.json
65
- package.json
73
+
74
+ Adjust the `build.command` to your project.
75
+
76
+ :::
77
+
78
+ ## Build output
79
+
80
+ The build output for Mastra applications using the `NetlifyDeployer` includes all agents, tools, and workflows in your project, along with Mastra-specific files required to run your application on Netlify.
81
+
82
+ ```bash
83
+ your-project/
84
+ └── .netlify/
85
+ └── v1/
86
+ ├── config.json
87
+ └── functions/
88
+ └── api/
89
+ ├── index.js
90
+ ├── package.json
91
+ └── node_modules/
66
92
  ```
67
93
 
68
94
  The `NetlifyDeployer` automatically generates a `config.json` configuration file in `.netlify/v1` with the following settings:
69
95
 
70
96
  ```json
71
97
  {
98
+ "functions": {
99
+ "directory": ".netlify/v1/functions",
100
+ "node_bundler": "none",
101
+ "included_files": [".netlify/v1/functions/**"]
102
+ },
72
103
  "redirects": [
73
104
  {
74
105
  "force": true,
@@ -49,8 +49,6 @@ describe('Weather Agent Tests', () => {
49
49
  });
50
50
  ```
51
51
 
52
- View the full example [here](/examples/v1/evals/running-in-ci)
53
-
54
52
  ## Understanding Results
55
53
 
56
54
  The `runEvals` function returns an object with:
@@ -1,5 +1,5 @@
1
1
  ---
2
- title: "Manual Install | Guides"
2
+ title: "Manual Install | Getting Started"
3
3
  description: Set up a Mastra project manually without using the create mastra CLI.
4
4
  ---
5
5
 
@@ -11,7 +11,7 @@ import StepItem from "@site/src/components/StepItem";
11
11
  # Manual Install
12
12
 
13
13
  :::info
14
- Use this guide to manually build a standalone Mastra server step by step. In most cases, it's quicker to follow the [Standalone Server Quickstart](/guides/v1/getting-started/quickstart), which achieves the same result using the [`mastra create`](/reference/v1/cli/create-mastra) command. For existing projects, you can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init).
14
+ Use this guide to manually build a standalone Mastra server step by step. In most cases, it's quicker to follow a [getting-started guide](/docs/v1/getting-started/start), which achieves the same result using the [`mastra create`](/reference/v1/cli/create-mastra) command. For existing projects, you can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init).
15
15
  :::
16
16
 
17
17
  If you prefer not to use our automatic CLI tool, you can set up your project yourself by following the guide below.
@@ -6,7 +6,7 @@ description: Choose how to get started with Mastra - quickstart, framework integ
6
6
  import { CardGrid, CardGridItem } from "@site/src/components/cards/card-grid";
7
7
 
8
8
  # Start
9
- Start a new Mastra project, or integrate Mastra with your preferred framework.
9
+ Create a new Mastra project, or integrate Mastra with your preferred framework to start building.
10
10
 
11
11
  ## New project
12
12
 
@@ -142,6 +142,12 @@ const { error, status, sendMessage, messages, regenerate, stop } = useChat({
142
142
  });
143
143
  ```
144
144
 
145
+ :::tip Agent streaming in workflows
146
+ When a workflow step pipes an agent's stream to the workflow writer (e.g., `await response.fullStream.pipeTo(writer)`), the agent's text chunks and tool calls are automatically streamed to the UI in real-time. This provides a seamless streaming experience even when agents are running inside workflow steps.
147
+
148
+ Learn more in [Workflow Streaming](/docs/v1/streaming/workflow-streaming#streaming-agent-text-chunks-to-ui).
149
+ :::
150
+
145
151
  ### `networkRoute()`
146
152
 
147
153
  Use the `networkRoute()` utility to create a route handler that automatically formats the agent network stream into an AI SDK-compatible format.
@@ -292,6 +298,7 @@ export async function POST(req: Request) {
292
298
 
293
299
  // Transform stream into AI SDK format and create UI messages stream
294
300
  const uiMessageStream = createUIMessageStream({
301
+ originalMessages: messages,
295
302
  execute: async ({ writer }) => {
296
303
  for await (const part of toAISdkStream(stream, { from: "agent" })!) {
297
304
  writer.write(part);
@@ -384,6 +391,7 @@ export async function POST(req: Request) {
384
391
  });
385
392
 
386
393
  const uiMessageStream = createUIMessageStream({
394
+ initialMessages: messages,
387
395
  execute: async ({ writer }) => {
388
396
  for await (const part of toAISdkStream(stream, {
389
397
  from: "agent",
@@ -13,7 +13,7 @@ import { VideoPlayer } from "@site/src/components/video-player";
13
13
 
14
14
  The `create mastra` CLI command is the quickest way to get started. It walks you through setup and creates example agents, workflows, and tools for you to run locally or adapt
15
15
 
16
- If you need more control over the setup, see the [manual installation guide](/guides/v1/getting-started/manual-install). You can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init) for existing projects.
16
+ If you need more control over the setup, see the [manual installation guide](/docs/v1/getting-started/manual-install). You can also use [`mastra init`](/reference/v1/cli/mastra#mastra-init) for existing projects.
17
17
 
18
18
  ## Before you begin
19
19