@mastra/mcp-docs-server 1.3.13-alpha.6 → 1.3.13-alpha.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.
@@ -74,6 +74,47 @@ export const mastra = new Mastra({
74
74
  })
75
75
  ```
76
76
 
77
+ ## Export to storage and Platform
78
+
79
+ On Mastra Platform, a nonempty `MASTRA_DEPLOYMENT_ID` disables `MastraStorageExporter` and the deprecated `DefaultExporter` by default. Other exporters remain enabled. The opt-in below applies only to `MastraStorageExporter`. Deprecated `DefaultExporter` stays disabled on Platform even with the flag set to `true`. Migrate to `MastraStorageExporter` to use this option.
80
+
81
+ > **Local storage remains blocked even with the opt-in:** `retainStorageExporterOnPlatform: true` **doesn't** enable in-memory, local libSQL, or DuckDB observability writes on Platform. When the observability domain reports local persistence, the built-in storage exporter stays disabled: it won't persist traces, logs, metrics, scores, or feedback to that database. Other exporters continue to receive events.
82
+
83
+ With updated adapters and `retainStorageExporterOnPlatform: true`, the behavior on Platform is:
84
+
85
+ | Observability database | Storage export on Platform |
86
+ | --------------------------------------------------------------------- | -------------------------------- |
87
+ | PostgreSQL | Allowed |
88
+ | Remote libSQL/Turso (`libsql://` or `https://`) | Allowed |
89
+ | Local libSQL (`file:` or `:memory:`) | Blocked |
90
+ | libSQL embedded replica with a remote sync URL | Blocked: it still writes locally |
91
+ | DuckDB, including in-memory databases | Blocked |
92
+ | `InMemoryStore`, including the fallback when no storage is configured | Blocked |
93
+
94
+ To keep writing to your own remote database alongside Platform observability, set [`retainStorageExporterOnPlatform`](https://mastra.ai/reference/observability/tracing/configuration) to `true` on the observability config:
95
+
96
+ ```typescript
97
+ import { Observability, MastraStorageExporter, MastraPlatformExporter } from '@mastra/observability'
98
+
99
+ const observability = new Observability({
100
+ configs: {
101
+ production: {
102
+ serviceName: 'my-service',
103
+ retainStorageExporterOnPlatform: true,
104
+ exporters: [new MastraStorageExporter(), new MastraPlatformExporter()],
105
+ },
106
+ },
107
+ })
108
+ ```
109
+
110
+ Pass this `observability` instance to `new Mastra()` alongside your configured `storage` provider. The option applies only to this config, including exporters registered later. It doesn't configure a database or add exporters automatically. Other configs keep the default suppression unless they also opt in.
111
+
112
+ The restriction applies to the **observability domain**, which can use a different provider from your default application storage. It doesn't disable other storage domains. Outside Platform, local observability storage continues to work.
113
+
114
+ To enable this guard, upgrade `@mastra/core` and any `@mastra/libsql` or `@mastra/duckdb` adapters alongside `@mastra/observability`: older or custom adapters without the `persistenceLocation` capability retain the existing opt-in behavior and aren't checked for local persistence.
115
+
116
+ A blocked exporter logs a warning during initialization, but the restriction applies even if your logging setup hides that warning. If dual export isn't writing to your database, check the observability provider against the table above and configure a remote database. Retrying or increasing the batch interval won't enable a blocked exporter.
117
+
77
118
  ## Studio
78
119
 
79
120
  Access your traces through Studio:
@@ -243,6 +243,52 @@ export default function Chat() {
243
243
 
244
244
  Use [`prepareSendMessagesRequest`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat#transport.default-chat-transport.prepare-send-messages-request) to customize the request sent to the chat route, for example to pass additional configuration to the agent.
245
245
 
246
+ ### Resume a chat stream after a disconnect
247
+
248
+ Enable resumable streams on the Mastra route:
249
+
250
+ ```typescript
251
+ import { Mastra } from '@mastra/core'
252
+ import { chatRoute } from '@mastra/ai-sdk'
253
+
254
+ export const mastra = new Mastra({
255
+ server: {
256
+ apiRoutes: [
257
+ chatRoute({
258
+ path: '/chat',
259
+ agent: 'weatherAgent',
260
+ resumable: true,
261
+ }),
262
+ ],
263
+ },
264
+ })
265
+ ```
266
+
267
+ Pass a stable chat ID and `resume: true` to `useChat()`. AI SDK UI reconnects through `GET /chat/:chatId/stream` when the component mounts again while the generation is still active.
268
+
269
+ ```tsx
270
+ import { useChat } from '@ai-sdk/react'
271
+ import { DefaultChatTransport } from 'ai'
272
+
273
+ export function Chat({ chatId }: { chatId: string }) {
274
+ const { messages, sendMessage, status } = useChat({
275
+ id: chatId,
276
+ resume: true,
277
+ transport: new DefaultChatTransport({
278
+ api: 'http://localhost:4111/chat',
279
+ }),
280
+ })
281
+
282
+ // ...render messages and call sendMessage()
283
+ }
284
+ ```
285
+
286
+ Keep `chatId` in a URL, browser storage, or application state so a refresh reuses the same value. Resumption only applies to an active run. Completed or unavailable runs return `204`, so load completed chat history from memory separately.
287
+
288
+ Resumable mode lets generation continue after the POST connection closes, which means `useChat().stop()` doesn't cancel the agent run. Active-run discovery is process-local, so the reconnect request must reach the same running Mastra server process.
289
+
290
+ If the chat uses a resource ID, authentication middleware must set `MASTRA_RESOURCE_ID_KEY` in the request context. Don't send the resource ID only as `memory.resource` in the POST body because the reconnecting GET request has no body.
291
+
246
292
  ### Client tools with `useChat()`
247
293
 
248
294
  A tool without an `execute` function runs on the client. When the model calls it, the agent's run ends at that step and the stream finishes with a `tool-{toolKey}` part in the `input-available` state. To let the agent continue, run the tool in the browser, add its result with `addToolOutput()`, and send the conversation back. `sendAutomaticallyWhen` sends the next request once every tool call in the last assistant message has a result:
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Model Providers
6
6
 
7
- Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 8261 models from 223 providers through a single API.
7
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 8266 models from 223 providers through a single API.
8
8
 
9
9
  ## Features
10
10
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![CrossModel logo](https://models.dev/logos/crossmodel.svg)CrossModel
6
6
 
7
- Access 68 CrossModel models through Mastra's model router. Authentication is handled automatically using the `CROSSMODEL_API_KEY` environment variable.
7
+ Access 72 CrossModel models through Mastra's model router. Authentication is handled automatically using the `CROSSMODEL_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [CrossModel documentation](https://www.crossmodel.ai/docs).
10
10
 
@@ -40,6 +40,7 @@ for await (const chunk of stream) {
40
40
  | ------------------------------------------ | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
41
41
  | `crossmodel/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
42
42
  | `crossmodel/anthropic/claude-fable-5-1` | 1.0M | | | | | | $10 | $50 |
43
+ | `crossmodel/anthropic/claude-fable-5-2` | 1.0M | | | | | | $8 | $40 |
43
44
  | `crossmodel/anthropic/claude-haiku-4-5` | 200K | | | | | | $1 | $5 |
44
45
  | `crossmodel/anthropic/claude-haiku-5-5` | 1.0M | | | | | | $0.10 | $0.50 |
45
46
  | `crossmodel/anthropic/claude-opus-4-7` | 1.0M | | | | | | $5 | $25 |
@@ -67,6 +68,7 @@ for await (const chunk of stream) {
67
68
  | `crossmodel/moonshot/kimi-k2.6` | 262K | | | | | | $1 | $4 |
68
69
  | `crossmodel/moonshot/kimi-k2.7-code` | 262K | | | | | | $1 | $4 |
69
70
  | `crossmodel/moonshot/kimi-k3` | 1.0M | | | | | | $3 | $15 |
71
+ | `crossmodel/moonshot/kimi-k3.1-pro` | 1.0M | | | | | | $2 | $10 |
70
72
  | `crossmodel/openai/gpt-4o-mini` | 128K | | | | | | $0.15 | $0.60 |
71
73
  | `crossmodel/openai/gpt-5.4` | 1.1M | | | | | | $3 | $15 |
72
74
  | `crossmodel/openai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
@@ -80,6 +82,7 @@ for await (const chunk of stream) {
80
82
  | `crossmodel/openai/gpt-6-luna` | 1.1M | | | | | | $0.10 | $0.50 |
81
83
  | `crossmodel/openai/gpt-6-sol` | 1.1M | | | | | | $2 | $10 |
82
84
  | `crossmodel/openai/gpt-6.1-sol` | 1.1M | | | | | | $2 | $10 |
85
+ | `crossmodel/openai/gpt-6.1-terra` | 1.1M | | | | | | $1 | $5 |
83
86
  | `crossmodel/qwen/qwen3.6-flash` | 1.0M | | | | | | $0.19 | $1 |
84
87
  | `crossmodel/qwen/qwen3.6-plus` | 1.0M | | | | | | $0.32 | $2 |
85
88
  | `crossmodel/qwen/qwen3.7-flash` | 1.0M | | | | | | $0.04 | $0.13 |
@@ -89,6 +92,7 @@ for await (const chunk of stream) {
89
92
  | `crossmodel/qwen/qwen3.8-max` | 1.0M | | | | | | $2 | $6 |
90
93
  | `crossmodel/qwen/qwen3.8-omni-flash` | 1.0M | | | | | | $0.13 | $0.43 |
91
94
  | `crossmodel/tencent/hy3` | 262K | | | | | | $0.16 | $0.64 |
95
+ | `crossmodel/tencent/hy4` | 1.0M | | | | | | $0.96 | $3 |
92
96
  | `crossmodel/tencent/hy4-preview` | 1.0M | | | | | | $0.96 | $3 |
93
97
  | `crossmodel/x-ai/grok-4.3` | 1.0M | | | | | | $1 | $3 |
94
98
  | `crossmodel/x-ai/grok-4.5` | 500K | | | | | | $2 | $6 |
@@ -66,7 +66,7 @@ for await (const chunk of stream) {
66
66
  | `edenai/anthropic/claude-fable-5` | 1.0M | | | | | | $10 | $50 |
67
67
  | `edenai/anthropic/claude-fable-5-1` | 1.0M | | | | | | $10 | $50 |
68
68
  | `edenai/anthropic/claude-fable-5-2` | 1.0M | | | | | | $8 | $40 |
69
- | `edenai/anthropic/claude-fable-latest` | 1.0M | | | | | | $10 | $50 |
69
+ | `edenai/anthropic/claude-fable-latest` | 1.0M | | | | | | $8 | $40 |
70
70
  | `edenai/anthropic/claude-haiku-5-5` | 1.0M | | | | | | $0.10 | $0.50 |
71
71
  | `edenai/anthropic/claude-haiku-latest` | 1.0M | | | | | | $0.10 | $0.50 |
72
72
  | `edenai/anthropic/claude-opus-4-5` | 200K | | | | | | $5 | $25 |
@@ -47,7 +47,7 @@ for await (const chunk of stream) {
47
47
  | `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.04 | $0.30 |
48
48
  | `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
49
49
  | `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $10 |
50
- | `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.18 | $9 |
50
+ | `kilo/~moonshotai/kimi-latest` | 1.0M | | | | | | $0.18 | $11 |
51
51
  | `kilo/~openai/gpt-astra-latest` | 1.1M | | | | | | $10 | $50 |
52
52
  | `kilo/~openai/gpt-luna-latest` | 1.1M | | | | | | $0.10 | $0.50 |
53
53
  | `kilo/~openai/gpt-mini-latest` | 400K | | | | | | $0.75 | $5 |
@@ -137,7 +137,7 @@ for await (const chunk of stream) {
137
137
  | `kilo/google/gemma-3-12b-it` | 131K | | | | | | $0.04 | $0.12 |
138
138
  | `kilo/google/gemma-3-27b-it` | 131K | | | | | | $0.08 | $0.16 |
139
139
  | `kilo/google/gemma-3-4b-it` | 131K | | | | | | $0.04 | $0.05 |
140
- | `kilo/google/gemma-4-26b-a4b-it` | 256K | | | | | | $0.02 | $0.05 |
140
+ | `kilo/google/gemma-4-26b-a4b-it` | 256K | | | | | | $0.03 | $0.09 |
141
141
  | `kilo/google/gemma-4-31b-it` | 262K | | | | | | $0.10 | $0.34 |
142
142
  | `kilo/google/lyria-3-clip-preview` | 1.0M | | | | | | — | — |
143
143
  | `kilo/google/lyria-3-pro-preview` | 1.0M | | | | | | — | — |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![LLM Gateway logo](https://models.dev/logos/llmgateway-providers.svg)LLM Gateway
6
6
 
7
- Access 439 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
7
+ Access 440 LLM Gateway models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [LLM Gateway documentation](https://llmgateway.io/docs).
10
10
 
@@ -260,6 +260,7 @@ for await (const chunk of stream) {
260
260
  | `llmgateway-providers/luminal/deepseek-v4.1-flash` | 1.0M | | | | | | $0.14 | $0.54 |
261
261
  | `llmgateway-providers/meta-contributor/muse-spark-1.2-contributor` | 1.0M | | | | | | $0.10 | $0.20 |
262
262
  | `llmgateway-providers/meta-contributor/muse-spark-1.3-contributor` | 1.0M | | | | | | $0.10 | $0.20 |
263
+ | `llmgateway-providers/meta/muse-ember-1.0` | 1.0M | | | | | | $0.10 | $0.50 |
263
264
  | `llmgateway-providers/meta/muse-spark-1.1` | 1.0M | | | | | | $1 | $4 |
264
265
  | `llmgateway-providers/meta/muse-spark-1.2` | 1.0M | | | | | | $1 | $4 |
265
266
  | `llmgateway-providers/meta/muse-spark-1.3` | 1.0M | | | | | | $1 | $4 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![DevPass (LLM Gateway) logo](https://models.dev/logos/llmgateway.svg)DevPass (LLM Gateway)
6
6
 
7
- Access 202 DevPass (LLM Gateway) models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
7
+ Access 203 DevPass (LLM Gateway) models through Mastra's model router. Authentication is handled automatically using the `LLMGATEWAY_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [DevPass (LLM Gateway) documentation](https://llmgateway.io/docs).
10
10
 
@@ -190,6 +190,7 @@ for await (const chunk of stream) {
190
190
  | `llmgateway/mistral-medium-3-5` | 262K | | | | | | $2 | $8 |
191
191
  | `llmgateway/mistral-small-2506` | 128K | | | | | | $0.10 | $0.30 |
192
192
  | `llmgateway/mistral-small-2603` | 262K | | | | | | $0.15 | $0.60 |
193
+ | `llmgateway/muse-ember-1.0` | 1.0M | | | | | | $0.10 | $0.50 |
193
194
  | `llmgateway/muse-glimmer-30b` | 131K | | | | | | $0.30 | $1 |
194
195
  | `llmgateway/muse-spark-1.1` | 1.0M | | | | | | $1 | $4 |
195
196
  | `llmgateway/muse-spark-1.2` | 1.0M | | | | | | $1 | $4 |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![NanoGPT logo](https://models.dev/logos/nano-gpt.svg)NanoGPT
6
6
 
7
- Access 633 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
7
+ Access 632 NanoGPT models through Mastra's model router. Authentication is handled automatically using the `NANO_GPT_API_KEY` environment variable.
8
8
 
9
9
  Learn more in the [NanoGPT documentation](https://docs.nano-gpt.com).
10
10
 
@@ -135,8 +135,6 @@ for await (const chunk of stream) {
135
135
  | `nano-gpt/deepseek/deepseek-v4-pro-0813:thinking` | 1.0M | | | | | | $0.66 | $2 |
136
136
  | `nano-gpt/deepseek/deepseek-v4-pro:thinking` | 1.0M | | | | | | $0.70 | $1 |
137
137
  | `nano-gpt/deepseek/deepseek-v4.1-flash` | 1.0M | | | | | | $0.02 | $0.40 |
138
- | `nano-gpt/deepseek/deepseek-v4.1-flash-0910-uncensored` | 524K | | | | | | $0.33 | $1 |
139
- | `nano-gpt/deepseek/deepseek-v4.1-flash-0910-uncensored:thinking` | 524K | | | | | | $0.33 | $1 |
140
138
  | `nano-gpt/deepseek/deepseek-v4.1-flash-1017` | 1.0M | | | | | | $0.10 | $0.60 |
141
139
  | `nano-gpt/deepseek/deepseek-v4.1-flash-1017:thinking` | 1.0M | | | | | | $0.10 | $0.60 |
142
140
  | `nano-gpt/deepseek/deepseek-v4.1-flash:thinking` | 1.0M | | | | | | $0.02 | $0.40 |
@@ -233,9 +231,9 @@ for await (const chunk of stream) {
233
231
  | `nano-gpt/google/gemini-flash-latest` | 1.0M | | | | | | $0.75 | $4 |
234
232
  | `nano-gpt/google/gemini-flash-lite-latest` | 1.0M | | | | | | $0.30 | $3 |
235
233
  | `nano-gpt/google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
236
- | `nano-gpt/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.04 | $0.11 |
234
+ | `nano-gpt/google/gemma-4-26b-a4b-it` | 262K | | | | | | $0.02 | $0.07 |
237
235
  | `nano-gpt/google/gemma-4-26b-a4b-it-cybersecurity` | 262K | | | | | | $0.11 | $0.33 |
238
- | `nano-gpt/google/gemma-4-26b-a4b-it:thinking` | 262K | | | | | | $0.04 | $0.11 |
236
+ | `nano-gpt/google/gemma-4-26b-a4b-it:thinking` | 262K | | | | | | $0.02 | $0.07 |
239
237
  | `nano-gpt/google/gemma-4-31b-it` | 262K | | | | | | $0.14 | $0.40 |
240
238
  | `nano-gpt/google/gemma-4-31b-it:thinking` | 262K | | | | | | $0.10 | $0.34 |
241
239
  | `nano-gpt/google/gemma4-31b-splituntied` | 262K | | | | | | $0.10 | $0.30 |
@@ -354,6 +352,7 @@ for await (const chunk of stream) {
354
352
  | `nano-gpt/NeverSleep/Lumimaid-v0.2-70B` | 16K | | | | | | $1 | $2 |
355
353
  | `nano-gpt/nex-agi/nex-n2.5-mini` | 262K | | | | | | $0.03 | $0.10 |
356
354
  | `nano-gpt/nex-agi/nex-n2.5-pro` | 262K | | | | | | $0.07 | $0.25 |
355
+ | `nano-gpt/nex-agi/nex-n2.6` | 262K | | | | | | $0.15 | $0.50 |
357
356
  | `nano-gpt/nothingiisreal/L3.1-70B-Celeste-V0.1-BF16` | 33K | | | | | | $0.49 | $0.49 |
358
357
  | `nano-gpt/nvidia/Llama-3.1-Nemotron-70B-Instruct-HF` | 16K | | | | | | $0.36 | $0.41 |
359
358
  | `nano-gpt/nvidia/Llama-3.3-Nemotron-Super-49B-v1` | 128K | | | | | | $0.15 | $0.15 |
@@ -629,10 +628,10 @@ for await (const chunk of stream) {
629
628
  | `nano-gpt/z-ai/GLM-4.5:thinking` | 128K | | | | | | $0.30 | $1 |
630
629
  | `nano-gpt/z-ai/glm-4.5v` | 66K | | | | | | $0.60 | $2 |
631
630
  | `nano-gpt/z-ai/glm-4.5v:thinking` | 66K | | | | | | $0.60 | $2 |
632
- | `nano-gpt/z-ai/glm-4.6` | 200K | | | | | | $0.50 | $2 |
633
- | `nano-gpt/z-ai/glm-4.6-original` | 256K | | | | | | $0.50 | $2 |
634
- | `nano-gpt/z-ai/GLM-4.6-turbo` | 205K | | | | | | $1 | $3 |
635
- | `nano-gpt/z-ai/GLM-4.6-turbo:thinking` | 205K | | | | | | $1 | $3 |
631
+ | `nano-gpt/z-ai/glm-4.6` | 200K | | | | | | $0.55 | $2 |
632
+ | `nano-gpt/z-ai/glm-4.6-original` | 256K | | | | | | $0.55 | $2 |
633
+ | `nano-gpt/z-ai/GLM-4.6-turbo` | 205K | | | | | | $0.55 | $2 |
634
+ | `nano-gpt/z-ai/GLM-4.6-turbo:thinking` | 205K | | | | | | $0.55 | $2 |
636
635
  | `nano-gpt/z-ai/glm-4.6:thinking` | 200K | | | | | | $0.55 | $2 |
637
636
  | `nano-gpt/z-ai/glm-4.6v` | 128K | | | | | | $0.30 | $0.90 |
638
637
  | `nano-gpt/z-ai/glm-4.6v-original` | 128K | | | | | | $0.60 | $0.90 |
@@ -10,9 +10,9 @@ Use [`handleChatStream()`](https://mastra.ai/reference/ai-sdk/handle-chat-stream
10
10
 
11
11
  `chatRoute()` keeps the existing AI SDK v5/default behavior. If your app is typed against AI SDK v6, pass `version: 'v6'`.
12
12
 
13
- > **Disconnect behavior:** `chatRoute()` forwards the incoming request's `AbortSignal` to `agent.stream()`. If the client disconnects, Mastra aborts the in-flight generation.
13
+ > **Disconnect behavior:** By default, `chatRoute()` forwards the incoming request's `AbortSignal` to `agent.stream()`. If the client disconnects, Mastra aborts the in-flight generation.
14
14
  >
15
- > If you want the server to continue generation and persist the final response after disconnect, build a [custom API route](https://mastra.ai/docs/server/custom-api-routes) around `agent.stream()` and call `consumeStream()` on the returned `MastraModelOutput`.
15
+ > Set `resumable: true` to let the generation continue after a disconnect and allow AI SDK UI to reconnect to the active stream. Resumable chats don't support abort-based cancellation because `useChat().stop()` is indistinguishable from a refresh or network interruption at the server.
16
16
 
17
17
  ## Usage example
18
18
 
@@ -61,6 +61,8 @@ export const mastra = new Mastra({
61
61
 
62
62
  **agentVersion** (`{ versionId: string } | { status?: 'draft' | 'published' }`): Selects a specific agent version. Pass { versionId: '\<id>' } to target an exact version, or { status: 'draft' } / { status: 'published' } to resolve by status. When the route is called, query parameters ?versionId=\<id> or ?status=draft|published take precedence over this static value. Requires the Editor to be configured.
63
63
 
64
+ **resumable** (`boolean`): Enables AI SDK UI stream resumption. Returns the POST route and a GET \<path>/:chatId/stream route, uses the AI SDK chat ID as the Mastra thread ID, and lets generation continue after the POST connection closes. (Default: `false`)
65
+
64
66
  **defaultOptions** (`AgentExecutionOptions`): Default options passed to agent execution. These can include instructions, memory configuration, maxSteps, and other execution settings.
65
67
 
66
68
  **sendStart** (`boolean`): Whether to send start events in the stream. (Default: `true`)
@@ -77,6 +79,35 @@ export const mastra = new Mastra({
77
79
 
78
80
  **heartbeatMs** (`number`): Interval in milliseconds for SSE heartbeats that keep connections active through infrastructure with idle timeouts.
79
81
 
82
+ ## Resumable streams
83
+
84
+ Set `resumable: true` on `chatRoute()` and `resume: true` on AI SDK UI's `useChat()` to reconnect after a refresh or network interruption. The route factory returns a two-item array containing:
85
+
86
+ - `POST <path>`: Starts the agent run. The request's AI SDK chat ID becomes the Mastra memory thread ID.
87
+ - `GET <path>/:chatId/stream`: Replays cached events and follows the active run. The route returns `204` when the run is finished, unavailable, expired, or outside the caller's scope.
88
+
89
+ Pass the returned array as one entry in `server.apiRoutes`. Mastra flattens nested route arrays during server configuration.
90
+
91
+ ```typescript
92
+ import { Mastra } from '@mastra/core'
93
+ import { chatRoute } from '@mastra/ai-sdk'
94
+
95
+ export const mastra = new Mastra({
96
+ server: {
97
+ apiRoutes: [
98
+ chatRoute({
99
+ path: '/chat/:agentId',
100
+ resumable: true,
101
+ }),
102
+ ],
103
+ },
104
+ })
105
+ ```
106
+
107
+ Active-run discovery is process-local. A reconnect request must reach the same running server process that started the generation. Resumable mode doesn't forward the request `AbortSignal`, so `useChat().stop()` closes the client connection without cancelling the agent run.
108
+
109
+ If the chat uses a resource ID, set `MASTRA_RESOURCE_ID_KEY` in the request context through authentication middleware. Don't send the resource ID only as `memory.resource` in the POST body: the reconnecting GET request has no body, so `chatRoute()` rejects that configuration with `400`.
110
+
80
111
  ## Additional configuration
81
112
 
82
113
  You can use [`prepareSendMessagesRequest`](https://ai-sdk.dev/docs/reference/ai-sdk-ui/use-chat#transport.default-chat-transport.prepare-send-messages-request) to customize the request sent to the chat route, for example to pass additional configuration to the agent:
@@ -45,7 +45,9 @@ const scorer = createScorer({
45
45
 
46
46
  **judge.model** (`LanguageModel`): The LLM model instance to use for evaluation.
47
47
 
48
- **judge.instructions** (`string`): System prompt/instructions for the LLM.
48
+ **judge.instructions** (`SystemMessage | ({ requestContext: RequestContext }) => SystemMessage | Promise<SystemMessage>`): System instructions for the LLM. Can be a string, array of strings, system message object, array of system messages, or a function that returns any of these types.
49
+
50
+ **judge.requestContext** (`RequestContext`): Values available to the judge's dynamic instructions, tools, and processors. Values from the run's requestContext override these values. scorer.run doesn't pass reserved Mastra keys or MastraMemory from the run to the judge, because they could put the judge on the caller's memory thread or give it credentials such as the auth token. To give the judge a reserved key, set it on this option. Only the scorer-level judge accepts this option.
49
51
 
50
52
  **judge.jsonPromptInjection** (`boolean | 'system' | 'inline' | 'auto'`): Controls how the judge's structured output schema reaches the model. Defaults to 'auto', which uses native structured output when supported and inline prompt injection otherwise. Explicit values override automatic routing.
51
53
 
@@ -31,6 +31,7 @@ interface ObservabilityInstanceConfig {
31
31
  serviceName: string
32
32
  sampling?: SamplingStrategy
33
33
  exporters?: ObservabilityExporter[]
34
+ retainStorageExporterOnPlatform?: boolean
34
35
  spanOutputProcessors?: SpanOutputProcessor[]
35
36
  includeInternalSpans?: boolean
36
37
  excludeSpanTypes?: SpanType[]
@@ -49,6 +50,8 @@ interface ObservabilityInstanceConfig {
49
50
 
50
51
  **exporters** (`ObservabilityExporter[]`): Trace data exporters
51
52
 
53
+ **retainStorageExporterOnPlatform** (`boolean`): Defaults to false. Retains configured MastraStorageExporter instances on Platform, including later registration. Known local storage remains blocked, and deprecated DefaultExporter remains disabled. See storage export on Platform for configuration, adapter requirements, and restrictions.
54
+
52
55
  **spanOutputProcessors** (`SpanOutputProcessor[]`): Span output processors
53
56
 
54
57
  **includeInternalSpans** (`boolean`): Include spans internal to Mastra operations
@@ -8,6 +8,10 @@ Persists traces to Mastra's configured storage with automatic batching and retry
8
8
 
9
9
  > **Note:** `MastraStorageExporter` was previously called `DefaultExporter`. The original `DefaultExporter` class is still exported from `@mastra/observability` so existing imports keep working, but it's deprecated and will be removed in a future major version. New code should use `MastraStorageExporter`.
10
10
 
11
+ > **Platform storage restrictions:** When `MASTRA_DEPLOYMENT_ID` is set, this exporter is disabled by default. Set `retainStorageExporterOnPlatform: true` on the **observability config**, not the exporter constructor, to allow remote storage export. `InMemoryStore` (including the fallback when no storage is configured), local libSQL, embedded replicas, and DuckDB remain blocked when the adapter reports local persistence, even with the opt-in. No observability events are written to that local database, even if the initialization warning is hidden by your logging setup.
12
+ >
13
+ > See [storage export on Platform](https://mastra.ai/docs/observability/integrations/exporters/mastra-storage) for the supported-provider table, adapter upgrade requirements, and a configuration example.
14
+
11
15
  ## Span previews
12
16
 
13
17
  `MastraStorageExporter` automatically generates short, readable `inputPreview`, `outputPreview`, and `errorPreview` summaries based on the span type. Each preview contains up to 100 characters plus an ellipsis when truncated. Full payloads remain available separately.
@@ -1261,6 +1261,8 @@ interface ObservabilityInstanceConfig {
1261
1261
  }
1262
1262
  ```
1263
1263
 
1264
+ The `@mastra/observability` implementation also supports `retainStorageExporterOnPlatform`. See the [configuration reference](https://mastra.ai/reference/observability/tracing/configuration) for this implementation-specific option.
1265
+
1264
1266
  ### `ObservabilityRegistryConfig`
1265
1267
 
1266
1268
  Complete observability registry configuration.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.3.13-alpha.6",
3
+ "version": "1.3.13-alpha.7",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -26,7 +26,7 @@
26
26
  "@mastra/mcp-legacy": "npm:@mastra/mcp@^1.18.0",
27
27
  "local-pkg": "^1.2.1",
28
28
  "zod": "^4.6.7",
29
- "@mastra/core": "1.83.0-alpha.3",
29
+ "@mastra/core": "1.83.0-alpha.4",
30
30
  "@mastra/mcp": "^2.9.0-alpha.1"
31
31
  },
32
32
  "devDependencies": {
@@ -43,8 +43,7 @@
43
43
  "typescript": "^7.0.2",
44
44
  "vitest": "5.1.0",
45
45
  "@internal/lint": "0.0.148",
46
- "@internal/types-builder": "0.0.123",
47
- "@mastra/core": "1.83.0-alpha.3"
46
+ "@internal/types-builder": "0.0.123"
48
47
  },
49
48
  "homepage": "https://mastra.ai",
50
49
  "repository": {