@mastra/mcp-docs-server 1.3.7-alpha.1 → 1.3.7-alpha.5

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 (142) hide show
  1. package/.docs/docs/agents/guardrails.md +2 -2
  2. package/.docs/docs/auth/fga.md +0 -1
  3. package/.docs/docs/deployment/workers.md +1 -1
  4. package/.docs/docs/evals/datasets.md +5 -6
  5. package/.docs/docs/evals/gates-and-verdicts.md +3 -3
  6. package/.docs/docs/mastra-platform/deploy.md +8 -1
  7. package/.docs/docs/mastra-platform/observability.md +25 -19
  8. package/.docs/docs/mastra-platform/system-environment-variables.md +1 -1
  9. package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
  10. package/.docs/docs/mastra-platform/workspaces.md +2 -2
  11. package/.docs/docs/memory/multi-user-threads.md +1 -1
  12. package/.docs/docs/observability/metrics/overview.md +1 -1
  13. package/.docs/docs/observability/tracing/overview.md +6 -0
  14. package/.docs/docs/sandbox/computer.md +13 -13
  15. package/.docs/docs/sandbox/overview.md +5 -5
  16. package/.docs/docs/server/custom-adapters.md +1 -1
  17. package/.docs/docs/server/server-adapters.md +1 -1
  18. package/.docs/docs/studio/auth.md +1 -1
  19. package/.docs/docs/workflows/control-flow.md +28 -0
  20. package/.docs/docs/workflows/time-travel.md +1 -1
  21. package/.docs/integrations/databases/clickhouse.md +13 -0
  22. package/.docs/integrations/observability/langfuse.md +8 -0
  23. package/.docs/integrations/observability/opentelemetry.md +2 -0
  24. package/.docs/models/environment-variables.md +2 -1
  25. package/.docs/models/gateways/merge-gateway.md +2 -1
  26. package/.docs/models/gateways/netlify.md +5 -1
  27. package/.docs/models/gateways/openrouter.md +2 -1
  28. package/.docs/models/gateways/vercel.md +3 -10
  29. package/.docs/models/index.md +3 -2
  30. package/.docs/models/providers/aixy.md +14 -8
  31. package/.docs/models/providers/chutes.md +4 -4
  32. package/.docs/models/providers/cloudferro-sherlock.md +2 -2
  33. package/.docs/models/providers/edenai.md +10 -4
  34. package/.docs/models/providers/kenari.md +5 -1
  35. package/.docs/models/providers/kilo.md +10 -9
  36. package/.docs/models/providers/llmgateway-providers.md +7 -7
  37. package/.docs/models/providers/llmgateway.md +6 -5
  38. package/.docs/models/providers/lowrouter.md +16 -12
  39. package/.docs/models/providers/meta.md +3 -2
  40. package/.docs/models/providers/nano-gpt.md +21 -21
  41. package/.docs/models/providers/opencode-go.md +3 -3
  42. package/.docs/models/providers/opencode.md +5 -5
  43. package/.docs/models/providers/prime.md +136 -0
  44. package/.docs/models/providers.md +2 -1
  45. package/.docs/reference/agent-controller/session.md +30 -8
  46. package/.docs/reference/auth/better-auth.md +1 -1
  47. package/.docs/reference/auth/clerk.md +1 -1
  48. package/.docs/reference/auth/neon.md +2 -2
  49. package/.docs/reference/cli/mastra.md +15 -15
  50. package/.docs/reference/datasets/compareExperiments.md +18 -9
  51. package/.docs/reference/datasets/dataset.md +3 -1
  52. package/.docs/reference/datasets/finalizeExperiment.md +2 -2
  53. package/.docs/reference/datasets/listExperiments.md +2 -2
  54. package/.docs/reference/datasets/submitExperimentResult.md +1 -1
  55. package/.docs/reference/editor/tools.md +11 -3
  56. package/.docs/reference/evals/completeness.md +3 -3
  57. package/.docs/reference/evals/context-precision.md +1 -1
  58. package/.docs/reference/evals/create-scorer.md +3 -7
  59. package/.docs/reference/evals/faithfulness.md +6 -4
  60. package/.docs/reference/evals/filter-run.md +2 -2
  61. package/.docs/reference/evals/trajectory-accuracy.md +3 -2
  62. package/.docs/reference/index.md +0 -1
  63. package/.docs/reference/memory/listThreads.md +1 -1
  64. package/.docs/reference/migrations/mcp-v2.md +2 -2
  65. package/.docs/reference/migrations/upgrade-to-v1/agent.md +1 -1
  66. package/.docs/reference/migrations/vnext-to-standard-apis.md +1 -1
  67. package/.docs/reference/observability/feedback.md +1 -1
  68. package/.docs/reference/observability/metrics/automatic-metrics.md +11 -1
  69. package/.docs/reference/observability/tracing/interfaces.md +26 -0
  70. package/.docs/reference/observability/tracing/spans.md +2 -0
  71. package/.docs/reference/processors/moderation-processor.md +1 -1
  72. package/.docs/reference/processors/prompt-injection-detector.md +2 -2
  73. package/.docs/reference/processors/provider-history-compat.md +12 -8
  74. package/.docs/reference/processors/regex-filter-processor.md +1 -1
  75. package/.docs/reference/processors/system-prompt-scrubber.md +3 -3
  76. package/.docs/reference/processors/token-limiter-processor.md +2 -2
  77. package/.docs/reference/rag/graph-rag.md +1 -1
  78. package/.docs/reference/server/create-route.md +1 -1
  79. package/.docs/reference/server/elysia-adapter.md +1 -1
  80. package/.docs/reference/server/express-adapter.md +1 -1
  81. package/.docs/reference/server/fastify-adapter.md +1 -1
  82. package/.docs/reference/server/hono-adapter.md +2 -2
  83. package/.docs/reference/server/koa-adapter.md +1 -1
  84. package/.docs/reference/server/nestjs-adapter.md +1 -1
  85. package/.docs/reference/server/routes.md +1 -1
  86. package/.docs/reference/storage/composite.md +34 -0
  87. package/.docs/reference/storage/overview.md +3 -3
  88. package/.docs/reference/streaming/agents/MastraModelOutput.md +1 -1
  89. package/.docs/reference/streaming/agents/streamUntilIdle.md +1 -1
  90. package/.docs/reference/streaming/workflows/timeTravelStream.md +6 -4
  91. package/.docs/reference/tools/document-chunker-tool.md +8 -8
  92. package/.docs/reference/tools/mcp-client.md +1 -1
  93. package/.docs/reference/tools/mcp-server.md +17 -0
  94. package/.docs/reference/tools/submit-plan-tool.md +2 -0
  95. package/.docs/reference/tools/vector-query-tool.md +4 -4
  96. package/.docs/reference/vectors/astra.md +1 -1
  97. package/.docs/reference/vectors/azure-ai-search.md +1 -0
  98. package/.docs/reference/vectors/chroma.md +9 -5
  99. package/.docs/reference/vectors/convex.md +1 -3
  100. package/.docs/reference/vectors/couchbase.md +4 -9
  101. package/.docs/reference/vectors/duckdb.md +1 -1
  102. package/.docs/reference/vectors/libsql.md +1 -1
  103. package/.docs/reference/vectors/mongodb.md +2 -1
  104. package/.docs/reference/vectors/pg.md +16 -11
  105. package/.docs/reference/vectors/pinecone.md +8 -4
  106. package/.docs/reference/vectors/qdrant.md +8 -4
  107. package/.docs/reference/vectors/s3vectors.md +8 -4
  108. package/.docs/reference/vectors/turbopuffer.md +12 -6
  109. package/.docs/reference/vectors/upstash.md +10 -4
  110. package/.docs/reference/vectors/vectorize.md +7 -3
  111. package/.docs/reference/vectors/weaviate.md +1 -1
  112. package/.docs/reference/voice/composite-voice.md +15 -15
  113. package/.docs/reference/voice/mastra-voice.md +15 -11
  114. package/.docs/reference/voice/voice.addInstructions.md +1 -1
  115. package/.docs/reference/voice/voice.addTools.md +1 -1
  116. package/.docs/reference/voice/voice.answer.md +1 -1
  117. package/.docs/reference/voice/voice.close.md +1 -1
  118. package/.docs/reference/voice/voice.events.md +2 -2
  119. package/.docs/reference/voice/voice.listen.md +1 -1
  120. package/.docs/reference/voice/voice.off.md +1 -1
  121. package/.docs/reference/voice/voice.on.md +1 -1
  122. package/.docs/reference/voice/voice.send.md +2 -2
  123. package/.docs/reference/voice/voice.updateConfig.md +1 -1
  124. package/.docs/reference/workflows/dynamic-workflow-definition.md +3 -2
  125. package/.docs/reference/workflows/run-methods/cancel.md +1 -2
  126. package/.docs/reference/workflows/run-methods/resume.md +2 -0
  127. package/.docs/reference/workflows/run-methods/timeTravel.md +27 -0
  128. package/.docs/reference/workflows/run.md +14 -0
  129. package/.docs/reference/workflows/workflow-methods/agent.md +1 -1
  130. package/.docs/reference/workflows/workflow-methods/branch.md +4 -4
  131. package/.docs/reference/workflows/workflow-methods/classifier.md +1 -1
  132. package/.docs/reference/workflows/workflow-methods/create-run.md +2 -2
  133. package/.docs/reference/workflows/workflow-methods/dountil.md +1 -1
  134. package/.docs/reference/workflows/workflow-methods/dowhile.md +1 -1
  135. package/.docs/reference/workflows/workflow-methods/sleepUntil.md +1 -1
  136. package/.docs/reference/workspace/filesystem.md +10 -13
  137. package/.docs/reference/workspace/local-filesystem.md +5 -5
  138. package/.docs/reference/workspace/local-sandbox.md +1 -1
  139. package/.docs/reference/workspace/process-manager.md +2 -2
  140. package/.docs/reference/workspace/workspace-class.md +4 -4
  141. package/package.json +5 -5
  142. package/.docs/reference/agents/getTools.md +0 -31
@@ -232,7 +232,7 @@ inputProcessors: [
232
232
 
233
233
  ## Violation callbacks
234
234
 
235
- All processors support an `onViolation` callback that fires when a policy violation is detected, regardless of strategy. Use it for side effects like alerting, logging to external systems, or sending notifications.
235
+ Processors support an `onViolation` callback that fires when a policy violation aborts the run, for example with the `block` strategy. Aborts from `processToolResult`, and from processor workflows while streaming output, don't call it. Some processors also call it directly: `RegexFilterProcessor` when it redacts content, and `TokenCostControl` when it warns. Strategies that only log, such as `ModerationProcessor`'s `warn`, don't call it. Use it for side effects like alerting, logging to external systems, or sending notifications.
236
236
 
237
237
  The callback receives a `ProcessorViolation` object with `processorId`, `message`, and `detail` (processor-specific metadata).
238
238
 
@@ -263,7 +263,7 @@ moderation.onViolation = ({ processorId, message, detail }) => {
263
263
  }
264
264
  ```
265
265
 
266
- The `onViolation` property is part of the base [`Processor` interface](https://mastra.ai/reference/processors/processor-interface), so any processor, including custom ones, can use it. The runner automatically invokes `onViolation` when any processor calls `abort()`. For processors using a `warn` strategy (like `TokenCostControl`), the callback also fires on warnings without blocking the request.
266
+ The `onViolation` property is part of the base [`Processor` interface](https://mastra.ai/reference/processors/processor-interface), so any processor, including custom ones, can use it. The runner automatically invokes `onViolation` when a processor calls `abort()`, except on the paths noted above. For processors using a `warn` strategy (like `TokenCostControl`), the callback also fires on warnings without blocking the request.
267
267
 
268
268
  Errors thrown by runner-invoked callbacks after `abort()` are silently caught to prevent interfering with the processor's main logic. On the `TokenCostControl` warning path, callback errors are caught and logged through the Mastra logger.
269
269
 
@@ -79,7 +79,6 @@ resourceMapping: {
79
79
  - `user`: the authenticated user
80
80
  - `resourceId`: the owning Mastra resource ID when available (for example, a thread's `resourceId`)
81
81
  - `requestContext`: the current request context for advanced tenant resolution
82
- - `metadata`: provider-specific metadata for the attempted action
83
82
 
84
83
  Return `undefined` from `deriveId()` to fall back to the original Mastra resource ID.
85
84
 
@@ -146,7 +146,7 @@ Workers are internal infrastructure. They're not exposed to end users and don't
146
146
  In a split deployment:
147
147
 
148
148
  - **The API server is the only public-facing process**: It serves all client HTTP requests. These requests include REST endpoints and agent interactions, plus workflow triggers and custom routes.
149
- - **Workers connect outbound only**: They pull events from the distributed PubSub backend and read/write to the shared storage database. They don't accept inbound traffic from clients.
149
+ - **Workers don't serve client traffic**: They pull events from the distributed PubSub backend and read/write to the shared storage database. Each worker process also listens on `PORT` (default `4111`) for internal health checks. `/health` reports readiness and `/config` returns the worker configuration to authorized callers. Keep this port on the private network.
150
150
  - **The orchestration worker calls the API internally**: It sends step execution requests to the API over the container network using `MASTRA_STEP_EXECUTION_URL`. This is internal service-to-service communication, not a public endpoint.
151
151
 
152
152
  All three worker types (orchestration, scheduler, background task) sit behind the API on a private network. They share access to the PubSub backend and storage database but never receive traffic directly from clients. HTTP routes for worker-related features run on the API server rather than the worker process. One example is creating a token for a voice integration.
@@ -219,7 +219,7 @@ MongoDB storage requires a replica set or sharded deployment with transaction su
219
219
 
220
220
  ## Listing and searching items
221
221
 
222
- [`listItems()`](https://mastra.ai/reference/datasets/listItems) supports pagination and full-text search:
222
+ [`listItems()`](https://mastra.ai/reference/datasets/listItems) supports pagination and case-insensitive substring search:
223
223
 
224
224
  ```typescript
225
225
  // Paginated list
@@ -228,7 +228,7 @@ const { items, pagination } = await dataset.listItems({
228
228
  perPage: 50,
229
229
  })
230
230
 
231
- // Full-text search
231
+ // Substring search
232
232
  const { items: matches } = await dataset.listItems({
233
233
  search: 'Hello',
234
234
  })
@@ -240,11 +240,10 @@ const { items: v2Matches } = await dataset.listItems({
240
240
  page: 0,
241
241
  perPage: 50,
242
242
  })
243
-
244
- // Version-only snapshot returns a bare DatasetItem[]
245
- const v2Items = await dataset.listItems({ version: 2 })
246
243
  ```
247
244
 
245
+ Calling `listItems({ version })` without `search`, `page`, or `perPage` returns a bare `DatasetItem[]`. This form is deprecated. Pass `page` and `perPage` to always receive the paginated shape.
246
+
248
247
  ## Versioning
249
248
 
250
249
  Adding, updating, or deleting dataset items bumps the dataset version. Purging an item's stored content with [`purgeItem()`](https://mastra.ai/reference/datasets/purgeItem) doesn't create a new version. This lets you pin experiments to a specific snapshot of the data while erasing sensitive content without changing the version history.
@@ -278,7 +277,7 @@ for (const row of history) {
278
277
  Fetch the exact items that existed at a past version:
279
278
 
280
279
  ```typescript
281
- const items = await dataset.listItems({ version: 2 })
280
+ const { items } = await dataset.listItems({ version: 2, page: 0, perPage: 100 })
282
281
  ```
283
282
 
284
283
  You can also pin experiments to a version, see [running experiments](https://mastra.ai/docs/evals/experiments). Visit the [`Dataset` reference](https://mastra.ai/reference/datasets/dataset) for the full list of methods and parameters.
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Gates and verdicts
6
6
 
7
- Gates and verdicts add severity semantics to `runEvals`. Gates are scorers that must score 1.0, hard requirements that block a run. Thresholds are minimum acceptable scores on tracked metrics. The verdict summarizes the outcome as `passed`, `scored`, or `failed`.
7
+ Gates and verdicts add severity semantics to `runEvals`. Gates are scorers that must score 1.0, hard requirements that block a run. Thresholds are lower and/or upper bounds on the average score of tracked metrics. The verdict summarizes the outcome as `passed`, `scored`, or `failed`.
8
8
 
9
9
  ## When to use gates and verdicts
10
10
 
@@ -50,7 +50,7 @@ The verdict field is omitted when no gates or threshold-bearing scorers are prov
50
50
 
51
51
  ## Gates
52
52
 
53
- Gates are scorers passed via the `gates` field. They run before regular scorers on each data item. A gate must average a score of 1.0 across all data items to pass.
53
+ Gates are scorers passed via the `gates` field. They run before regular scorers on each data item. A gate must average a score of 1.0 across the data items it could score to pass. Items where the gate returns `notScorable()` are excluded from the average, and a gate that throws an error counts as 0 for that item.
54
54
 
55
55
  ```typescript
56
56
  import { runEvals } from '@mastra/core/evals'
@@ -87,7 +87,7 @@ You must provide at least one scorer or gate, a run with neither throws an error
87
87
 
88
88
  ## Thresholds
89
89
 
90
- Wrap a scorer in `{ scorer, threshold }` to set pass/fail bounds. The threshold is compared against the scorer's average score across all data items.
90
+ Wrap a scorer in `{ scorer, threshold }` to set pass/fail bounds. The threshold is compared against the scorer's average score across scored data items. Results that return `notScorable()` are left out of the average.
91
91
 
92
92
  A `threshold` can be:
93
93
 
@@ -63,7 +63,14 @@ A local `.env` file is optional. Environment variables stored on the platform ar
63
63
  > })
64
64
  > ```
65
65
 
66
- If the build statically finds `backgroundTasks.enabled: true`, the deploy artifact includes a worker manifest. Mastra Cloud automatically provisions or updates a dedicated worker service from the same artifact. No separate toggle or add-on is required.
66
+ If the build statically finds `backgroundTasks.enabled: true`, the CLI decides whether to run background tasks on a dedicated worker service or in-process inside the API server container:
67
+
68
+ - A dedicated worker service requires Redis for coordination. Without a usable `REDIS_URL` in the deploy env, background tasks run in-process.
69
+ - With Redis available, the CLI uses a dedicated worker service when the environment already has one, when you pass `--yes`, or when the deploy runs headless. Otherwise it asks whether to provision one.
70
+ - Pass `--workers dedicated` or `--workers in-process` to skip the decision. `--workers dedicated` fails if `REDIS_URL` is missing.
71
+ - Dedicated worker services are rolling out gradually, so for organizations without access the CLI omits the worker manifest and background tasks run in-process, even with Redis and `--workers dedicated`.
72
+
73
+ When a dedicated worker service is chosen, the deploy artifact includes a worker manifest, and Mastra Cloud provisions or updates the worker service from the same artifact.
67
74
 
68
75
  Removing `backgroundTasks` or setting `enabled: false` in a later deploy removes the manifest and spins down the existing worker service. Values that can't be determined statically are omitted from the manifest display, but the worker process still reads the complete configuration from your bundled code.
69
76
 
@@ -207,15 +207,17 @@ If `mastra init` configured observability for the project, use the token it wrot
207
207
 
208
208
  You can run `--dry-run` without this token because a dry run doesn't contact the collector or query API.
209
209
 
210
- Specify the destination with `--project`, or set `MASTRA_PROJECT_ID`. You can use a project name, slug, or ID with `--project`:
210
+ `--target-project` names the destination: the Mastra Platform project that receives the traces. Specify it with a project name, slug, or ID, or set `MASTRA_PROJECT_ID`:
211
211
 
212
212
  ```bash
213
- npx mastra traces import langfuse --project my-project --dry-run
213
+ npx mastra traces import langfuse --target-project my-mastra-project --dry-run
214
214
  ```
215
215
 
216
- The `--project` flag takes precedence over `MASTRA_PROJECT_ID`. Without either value, the CLI uses the project linked in `.mastra-project.json`.
216
+ The `--target-project` flag takes precedence over `MASTRA_PROJECT_ID`. Without either value, the CLI uses the project linked in `.mastra-project.json`.
217
217
 
218
- For a headless environment, set the API token and organization ID. The command uses `MASTRA_API_TOKEN` for project discovery, upload, and read-back. Set the project ID or pass `--project`:
218
+ The source project isn't a command-line option. The provider credentials in `.env` select it, and the preparation summary names it before anything is uploaded.
219
+
220
+ For a headless environment, set the API token and organization ID. The command uses `MASTRA_API_TOKEN` for project discovery, upload, and read-back. Set the project ID or pass `--target-project`:
219
221
 
220
222
  ```bash
221
223
  MASTRA_API_TOKEN=<mastra-api-token>
@@ -225,7 +227,7 @@ MASTRA_PROJECT_ID=<project-id>
225
227
 
226
228
  ### Configure Langfuse
227
229
 
228
- Create [project API keys in Langfuse](https://langfuse.com/docs/api-and-data-platform/features/public-api), then add them to `.env` or `.env.local` in the directory where you run the command:
230
+ Langfuse API keys belong to one Langfuse project, so they also select the source project. Create [project API keys in Langfuse](https://langfuse.com/docs/api-and-data-platform/features/public-api), then add them to `.env` or `.env.local` in the directory where you run the command:
229
231
 
230
232
  ```bash
231
233
  LANGFUSE_PUBLIC_KEY=<langfuse-public-key>
@@ -243,12 +245,12 @@ LANGFUSE_BASE_URL=https://us.cloud.langfuse.com
243
245
  Run a dry run before uploading:
244
246
 
245
247
  ```bash
246
- npx mastra traces import langfuse --project my-project --dry-run
248
+ npx mastra traces import langfuse --target-project my-mastra-project --dry-run
247
249
  ```
248
250
 
249
251
  The dry run reads the source, prepares valid Mastra traces locally, and reports:
250
252
 
251
- - The source and destination projects.
253
+ - The source Langfuse project by name and ID, and the destination Mastra Platform project.
252
254
  - The fixed import window.
253
255
  - Prepared and skipped trace and span counts.
254
256
  - The size of the prepared local data.
@@ -258,22 +260,24 @@ It doesn't upload traces. The command prints a `--resume` command that uploads t
258
260
 
259
261
  ### Choose the import window
260
262
 
261
- By default, the command selects the last 30 days, ending when the import starts. Use `--from` and `--to` to choose a smaller window:
263
+ By default, the command selects the last 30 days, ending when the import starts. Use `--since` and `--until` to choose a smaller window:
262
264
 
263
265
  ```bash
264
266
  npx mastra traces import langfuse \
265
- --project my-project \
266
- --from "$FROM" \
267
- --to "$TO" \
267
+ --target-project my-mastra-project \
268
+ --since "$SINCE" \
269
+ --until "$UNTIL" \
268
270
  --dry-run
269
271
  ```
270
272
 
271
- Set `FROM` and `TO` to ISO 8601 dates or timestamps. The following rules apply:
273
+ Set `SINCE` and `UNTIL` to ISO 8601 dates or timestamps. The following rules apply:
272
274
 
273
- - `--to` can't be in the future or outside the current 30-day Platform retention period.
274
- - `--from` must be earlier than `--to` and inside the current retention period.
275
+ - `--until` can't be in the future or outside the current 30-day Platform retention period.
276
+ - `--since` must be earlier than `--until` and inside the current retention period.
275
277
  - The selected window can't exceed 30 days.
276
- - If only `--to` is set, the default start is the later of 30 days before `--to` and the current retention boundary.
278
+ - If only `--until` is set, the default start is the later of 30 days before `--until` and the current retention boundary.
279
+
280
+ Commands written with the earlier `--from` and `--to` names still work.
277
281
 
278
282
  Trace eligibility is based on the root observation's start time. The Langfuse adapter discovers roots in the selected window and then reads all currently available observations for each selected trace. It skips the complete trace if the available parent-child tree or timestamps are invalid.
279
283
 
@@ -282,13 +286,13 @@ Trace eligibility is based on the root observation's start time. The Langfuse ad
282
286
  Run the command without `--dry-run` to upload the prepared traces:
283
287
 
284
288
  ```bash
285
- npx mastra traces import langfuse --project my-project
289
+ npx mastra traces import langfuse --target-project my-mastra-project
286
290
  ```
287
291
 
288
292
  The CLI displays the preparation summary and asks for confirmation before upload. Pass `--yes` to skip this prompt in an automated environment:
289
293
 
290
294
  ```bash
291
- npx mastra traces import langfuse --project my-project --yes
295
+ npx mastra traces import langfuse --target-project my-mastra-project --yes
292
296
  ```
293
297
 
294
298
  The importer keeps every trace in one upload request and checkpoints progress only after Mastra Platform acknowledges the batch. Temporary source and destination failures use bounded retries.
@@ -304,10 +308,10 @@ Use the exact command printed by the CLI when a dry run, cancellation, interrupt
304
308
  ```bash
305
309
  npx mastra traces import langfuse \
306
310
  --resume 00000000-0000-0000-0000-000000000000 \
307
- --project my-project
311
+ --target-project my-mastra-project
308
312
  ```
309
313
 
310
- A resumed import must use the original provider and destination project. Its saved date window can't be changed, so `--from`, `--to`, and `--dry-run` can't be combined with `--resume`.
314
+ A resumed import must use the original provider and destination project. Its saved date window can't be changed, so `--since`, `--until`, and `--dry-run` can't be combined with `--resume`.
311
315
 
312
316
  Resume behavior depends on where the command stopped:
313
317
 
@@ -337,7 +341,9 @@ These files can contain trace content. Mastra creates the import directory and f
337
341
  For Langfuse imports:
338
342
 
339
343
  - Observations become Mastra spans with their parent-child relationships and timestamps.
344
+ - Langfuse `AGENT`, `TOOL`, and `EVALUATOR` observations, and plain spans that carry OpenTelemetry GenAI attributes such as `gen_ai.operation.name: invoke_agent`, keep their primitive type and name. Mastra Platform shows them in the Primitive type and Primitive name columns and includes them in those filters, like native traces.
340
345
  - Supported fields such as names, input, output, errors, model details, usage, cost, tags, and source context are mapped when present.
346
+ - Environments you set in Langfuse, such as `staging`, are kept. Langfuse's built-in `default` environment isn't copied. Those traces have no environment in Mastra, and Mastra Studio shows them for every environment.
341
347
  - Destination trace and span IDs are deterministic. Original Langfuse IDs remain in span metadata for correlation.
342
348
  - Unknown Langfuse observation types become generic spans and produce a warning instead of being silently discarded.
343
349
  - Only trace observations are imported. Scores, feedback, datasets, attachments, and logs aren't imported.
@@ -37,7 +37,7 @@ Attaching a hosted database adds its connection variables to the environments th
37
37
  | -------- | ---------------------------------------- |
38
38
  | Turso | `TURSO_DATABASE_URL`, `TURSO_AUTH_TOKEN` |
39
39
  | Neon | `DATABASE_URL` |
40
- | Postgres | `POSTGRES_URL` |
40
+ | Postgres | `DATABASE_URL` |
41
41
 
42
42
  Values are resolved at deploy time and never stored in your project. An environment-scoped database replaces the values of a project-scoped database of the same provider for that environment.
43
43
 
@@ -83,7 +83,7 @@ Entities appear while their signals are still collecting or processing. The inde
83
83
 
84
84
  ### Configure a custom signal
85
85
 
86
- Users with project management permission can configure custom signals without leaving Intelligence:
86
+ Organization admins can configure custom signals without leaving Intelligence:
87
87
 
88
88
  1. Return to the entity index and select **Signal settings**.
89
89
  2. Select **Create signal**, provide a stable signal name, display label, description, and signal instructions, then save it. Definitions and their versions are shared across the organization.
@@ -82,8 +82,8 @@ export const mastra = new Mastra({
82
82
 
83
83
  - `start()` provisions a fresh sandbox (or reattaches when you passed `sandboxId`).
84
84
  - `executeCommand()` runs commands against it.
85
- - `stop()` tears down the remote sandbox while preserving its recovery checkpoint when it has one.
86
- - `destroy()` also releases the recovery checkpoint associated with a caller-supplied recovery `id`.
85
+ - `stop()` releases this process's lease without touching the remote sandbox. The VM keeps running under the environment's idle policy, and a later `start()` with the same `id` or `sandboxId` reattaches to it.
86
+ - `destroy()` releases the VM. On Railway, it also deletes the recovery checkpoint associated with a caller-supplied recovery `id`. On E2B, it only kills the VM, and any snapshot you captured remains yours to manage.
87
87
 
88
88
  A statically configured `PlatformSandbox` is shared across every request and agent using that configuration rather than creating separate sandboxes for requests or memory threads. `PlatformFilesystem` is also a separate provider: configuring both providers doesn't mount the environment bucket inside the sandbox.
89
89
 
@@ -158,7 +158,7 @@ const memory = new Memory({
158
158
  })
159
159
  ```
160
160
 
161
- OM requires a storage adapter that supports it: `@mastra/libsql`, `@mastra/pg`, `@mastra/mongodb`, or `@mastra/oracledb`.
161
+ OM requires a storage adapter that supports it: `@mastra/libsql`, `@mastra/pg`, `@mastra/mongodb`, `@mastra/mysql`, `@mastra/convex`, or `@mastra/oracledb`.
162
162
 
163
163
  > **Note:** If you switch the Observer to a less capable model and see facts attributed to a generic `User` instead of individual participants, use [`observation.instruction`](https://mastra.ai/reference/memory/observational-memory) to explain how to interpret the `<turn>` tag.
164
164
 
@@ -10,7 +10,7 @@ Mastra emits:
10
10
 
11
11
  - **Duration metrics** for agent runs, workflows, tools, model calls, and processors
12
12
  - **Token usage metrics** for model input and output, including detailed token categories when the provider reports them
13
- - **Cost estimates** calculated from token usage, provider, model, and an embedded pricing registry
13
+ - **Cost estimates** calculated from token usage, provider, model, and model prices from [models.dev](https://models.dev)
14
14
 
15
15
  Metrics retain trace correlation context, so you can investigate a change in a chart by finding the related span. See the [Automatic metrics reference](https://mastra.ai/reference/observability/metrics/automatic-metrics) for metric names, labels, and cost fields.
16
16
 
@@ -919,6 +919,12 @@ app.post('/api/analyze', async (req, res) => {
919
919
 
920
920
  This creates a single distributed trace that includes both the HTTP request handling and the Mastra agent execution, viewable in your observability platform of choice.
921
921
 
922
+ ### MCP calls
923
+
924
+ Model Context Protocol (MCP) calls link the caller's trace and the server's trace without any setup. When an agent or workflow calls a tool through `MCPClient`, the `MCPServer` that handles it keeps its own trace and records a link to the tool call span, and the tool call span links back to the server's span. Each side keeps its own trace, root span, and trace summary. When the server uses a tracing bridge and its HTTP instrumentation continues the caller's trace, the request joins that trace instead. Mastra storage saves the links with the spans, and exporters with span link support send them too.
925
+
926
+ This also works with non-Mastra software on either side. See the [`MCPServer` reference](https://mastra.ai/reference/tools/mcp-server) for details, and the [`MCPClient` reference](https://mastra.ai/reference/tools/mcp-client) to send your own trace context.
927
+
922
928
  ## What gets traced
923
929
 
924
930
  Mastra automatically creates spans for:
@@ -10,19 +10,19 @@ Sandboxes that run a desktop environment can expose screenshot, mouse, and keybo
10
10
 
11
11
  ## Computer tools
12
12
 
13
- | Tool | Does |
14
- | -------------------------- | -------------------------------------------------------------------------------- |
15
- | `computer_screenshot` | Captures the desktop as a PNG image and returns it to the model as native media. |
16
- | `computer_click` | Presses and releases the left mouse button at pixel coordinates. |
17
- | `computer_double_click` | Presses the left mouse button twice at pixel coordinates. |
18
- | `computer_right_click` | Presses and releases the right mouse button at pixel coordinates. |
19
- | `computer_move_mouse` | Moves the cursor to pixel coordinates without pressing a button. |
20
- | `computer_drag` | Presses, drags, and releases between two points. |
21
- | `computer_type` | Types text into the focused element. |
22
- | `computer_press_key` | Presses a key or key combination, such as `Enter` or `ctrl+s`. |
23
- | `computer_scroll` | Scrolls up or down. |
24
- | `computer_get_screen_info` | Gets the screen dimensions and cursor position. |
25
- | `computer_wait` | Waits for the interface to settle. |
13
+ | Tool | Does |
14
+ | ------------------------------------------- | -------------------------------------------------------------------------------- |
15
+ | `mastra_workspace_computer_screenshot` | Captures the desktop as a PNG image and returns it to the model as native media. |
16
+ | `mastra_workspace_computer_click` | Presses and releases the left mouse button at pixel coordinates. |
17
+ | `mastra_workspace_computer_double_click` | Presses the left mouse button twice at pixel coordinates. |
18
+ | `mastra_workspace_computer_right_click` | Presses and releases the right mouse button at pixel coordinates. |
19
+ | `mastra_workspace_computer_move_mouse` | Moves the cursor to pixel coordinates without pressing a button. |
20
+ | `mastra_workspace_computer_drag` | Presses, drags, and releases between two points. |
21
+ | `mastra_workspace_computer_type` | Types text into the focused element. |
22
+ | `mastra_workspace_computer_press_key` | Presses a key or key combination, such as `Enter` or `ctrl+s`. |
23
+ | `mastra_workspace_computer_scroll` | Scrolls up or down. |
24
+ | `mastra_workspace_computer_get_screen_info` | Gets the screen dimensions and cursor position. |
25
+ | `mastra_workspace_computer_wait` | Waits for the interface to settle. |
26
26
 
27
27
  ## Configure computer tools
28
28
 
@@ -49,11 +49,11 @@ A static sandbox is shared across every request and memory thread that uses the
49
49
 
50
50
  Agents receive tools for the capabilities supported by the sandbox backend:
51
51
 
52
- | Tool | Does |
53
- | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
- | `execute_command` | Runs a shell command and returns stdout, stderr, and the exit code. Supports `background: true` when the backend can spawn long-running processes. |
55
- | `get_process_output` | Gets stdout, stderr, and status for a background process. Supports `tail` to limit output and `wait: true` to wait for the process to exit. This tool and `kill_process` are only added when the backend supports background processes. |
56
- | `kill_process` | Stops a background process and returns its recent output. |
52
+ | Tool | Does |
53
+ | -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54
+ | `execute_command` | Runs a shell command and returns stdout, stderr, and the exit code. Supports `background: true` when the backend can spawn long-running processes. |
55
+ | `get_process_output` | Gets stdout, stderr, and status for a background process. Supports `tail` to limit output and `wait: true` to wait for the process to exit. For a static sandbox, this tool and `kill_process` are only added when the backend supports background processes. Workspaces that resolve their sandbox per request always include both tools, because capabilities aren't known until the sandbox resolves. |
56
+ | `kill_process` | Stops a background process and returns its recent output. |
57
57
 
58
58
  Configured capabilities determine which tools are available. Tool configuration can then disable, rename, or add policies to those tools:
59
59
 
@@ -162,7 +162,7 @@ async getParams(
162
162
  request: MyRequest
163
163
  ): Promise<{
164
164
  urlParams: Record<string, string>;
165
- queryParams: Record<string, string>;
165
+ queryParams: Record<string, string | string[]>; // repeated keys (?tag=a&tag=b) become arrays
166
166
  body: unknown;
167
167
  }> {
168
168
  return {
@@ -823,7 +823,7 @@ When using adapters, configure these features directly with your framework. For
823
823
 
824
824
  Server adapters register MCP (Model Context Protocol) routes during `registerRoutes()` when MCP servers are configured in your Mastra instance. MCP allows external tools and services to connect to your Mastra server and interact with your agents.
825
825
 
826
- Each server is exposed at `/api/mcp/:serverId/mcp` over Streamable HTTP. Because every request is self-contained, the routes work unchanged in serverless environments like Cloudflare Workers or Vercel Edge.
826
+ Each server is exposed at `/api/mcp/:serverId/mcp` over Streamable HTTP. By default the transport keeps session state between requests. For serverless environments like Cloudflare Workers or Vercel Edge, set `mcpOptions: { serverless: true }` to run in stateless mode without session management.
827
827
 
828
828
  Pass `mcpOptions` to control how the authenticated principal reaches tools. When using the Mastra deployer (the standard `mastra dev` / `mastra build` path), set it in your server config:
829
829
 
@@ -124,7 +124,7 @@ Permissions follow the pattern `{resource}:{action}`, with optional resource-lev
124
124
  | `agents:execute` | Execute agents only |
125
125
  | `agents:read:my-id` | Read a specific agent by ID |
126
126
 
127
- Resources include `agents`, `workflows`, `tools`, `datasets`, `memory`, `scores`, `observability`, and others. Actions are `read`, `write`, `execute`, and `delete`.
127
+ Resources include `agents`, `workflows`, `tools`, `datasets`, `memory`, `scores`, `observability`, and others. Actions are `read`, `write`, `create`, `delete`, `execute`, `publish`, and `share`.
128
128
 
129
129
  ### Map external provider roles
130
130
 
@@ -519,6 +519,34 @@ export const testWorkflow = createWorkflow({})
519
519
  .commit();
520
520
  ```
521
521
 
522
+ ### Passing data between iterations
523
+
524
+ Each iteration of `.dountil()` or `.dowhile()` receives the previous iteration's output as its `inputData`. When input validation is enabled (the default), that output is validated against the loop body's `inputSchema` before the body runs. With an object schema such as `z.object()`, keys the schema doesn't declare are removed. Schemas that allow unknown keys, such as `.passthrough()`, keep them.
525
+
526
+ When the loop body is a nested workflow, the output is validated against the nested workflow's `inputSchema` and then against its first step's `inputSchema`. A value is only available on the next iteration if the nested workflow returns it and both schemas declare it. This includes values produced inside the nested workflow, such as feedback from a step that suspended and resumed.
527
+
528
+ To carry data across iterations, declare it in the body's `inputSchema` and return it from the body's last step:
529
+
530
+ ```typescript
531
+ const loopSchema = z.object({
532
+ draft: z.string(),
533
+ feedback: z.string().optional(),
534
+ attempts: z.number(),
535
+ })
536
+
537
+ const reviewStep = createStep({
538
+ id: 'review',
539
+ inputSchema: loopSchema,
540
+ outputSchema: loopSchema,
541
+ execute: async ({ inputData }) => {
542
+ // ...
543
+ return { draft, feedback, attempts: inputData.attempts + 1 }
544
+ },
545
+ })
546
+ ```
547
+
548
+ For values that don't belong in the step's input, such as counters or audit data, use [workflow state](https://mastra.ai/docs/workflows/workflow-state) instead.
549
+
522
550
  ### Looping with `.foreach()`
523
551
 
524
552
  Use `.foreach()` to run the same step for each item in an array. The input must be of type `array` so the loop can iterate over its values, applying the step's logic to each one. See [Choosing the right pattern](#choosing-the-right-pattern) for guidance on when to use `.foreach()` vs other methods.
@@ -197,7 +197,7 @@ const result = await run.timeTravel({
197
197
 
198
198
  ## Error handling
199
199
 
200
- Time travel throws errors in specific situations:
200
+ Time travel throws errors in specific situations. It rejects a call that observes a running snapshot, but it doesn't atomically claim the run. Concurrent calls can both pass the status check and proceed, so guard against duplicates in your application. See [Concurrent time travel calls](https://mastra.ai/reference/workflows/run-methods/timeTravel).
201
201
 
202
202
  ### Running workflow
203
203
 
@@ -232,6 +232,19 @@ The same `client` form is accepted by `ObservabilityStorageClickhouse` and `Obse
232
232
 
233
233
  `ClickhouseStore` also accepts every option from `ClickHouseClientConfigOptions` (such as `database`, `request_timeout`, `compression`, `keep_alive`, and `max_open_connections`).
234
234
 
235
+ `ClickhouseStore` and `ObservabilityStorageClickhouseVNext` apply `clickhouse_settings` to every query they run. On ClickHouse services that keep data in object storage, such as ClickHouse Cloud, limiting read-ahead lowers the memory each observability query uses, but queries that miss the local cache can run slower:
236
+
237
+ ```typescript
238
+ const observabilityStore = new ObservabilityStorageClickhouseVNext({
239
+ url: process.env.CLICKHOUSE_URL!,
240
+ username: process.env.CLICKHOUSE_USERNAME!,
241
+ password: process.env.CLICKHOUSE_PASSWORD!,
242
+ clickhouse_settings: {
243
+ filesystem_prefetches_limit: 8,
244
+ },
245
+ })
246
+ ```
247
+
235
248
  ### Replicated clusters
236
249
 
237
250
  Use `replication` when Mastra writes to a multi-replica ClickHouse cluster through a load balancer.
@@ -199,6 +199,14 @@ If you set a custom `traceName` via `mastra.metadata.traceName`, your value take
199
199
 
200
200
  A run started with `tracingOptions.nestUnderParent` doesn't own the trace, so the exporter doesn't write the trace name, input, output, metadata, user, or session from it. See [Nesting a run under an earlier Mastra run](https://mastra.ai/docs/observability/tracing/overview).
201
201
 
202
+ ## Filtering observations by span attributes
203
+
204
+ Observation-level evaluators in Langfuse filter on top-level observation metadata. The exporter promotes each scalar span attribute (string, number, or boolean) that the OpenTelemetry exporter writes as `mastra.<span_type>.<key>` to `langfuse.observation.metadata.<key>`, with the key converted to camelCase. The exporter also sets `agentId`, `agentName`, `spanType`, and `operationName` on each observation.
205
+
206
+ For a `MODEL_STEP` span this produces `stepIndex` and `isContinued`. To judge each agent run once, against the step that produced the final answer, filter an observation-level evaluator on `spanType` equals `model_step` and `isContinued` equals `"false"`.
207
+
208
+ Values are sent as strings, so compare against string values such as `"false"` or `"1"`. Span input and output keep their own mapping, and attributes that hold objects or arrays stay in the nested `attributes` metadata only.
209
+
202
210
  ## Custom trace metadata
203
211
 
204
212
  Langfuse filters and groups traces by top-level metadata only. Nested metadata keys can't be used for filtering or grouping.
@@ -838,6 +838,8 @@ Both services must have:
838
838
  2. W3C Trace Context propagator enabled
839
839
  3. Mastra with `OtelBridge` configured
840
840
 
841
+ A Mastra `MCPServer` request over HTTP follows the same rule. With this setup, it joins the caller's trace. Without HTTP instrumentation on the server, each request keeps its own trace. In both cases, when a request carries a W3C `traceparent`, in `_meta` or as an HTTP header, the request span links to the caller's span, and the exporter and the bridge send that link as an OpenTelemetry span link. See [Linking to the caller's trace](https://mastra.ai/reference/tools/mcp-server).
842
+
841
843
  ### Using tags
842
844
 
843
845
  Tags help you categorize and filter traces in your OTEL backend. Add tags when executing agents or workflows:
@@ -140,8 +140,8 @@ List of required environment variables for each model provider and gateway suppo
140
140
  | [Ofox](https://mastra.ai/models/providers/ofox) | `ofox/*` | `OFOX_API_KEY` |
141
141
  | [Ollama Cloud](https://mastra.ai/models/providers/ollama-cloud) | `ollama-cloud/*` | `OLLAMA_API_KEY` |
142
142
  | [OpenAI](https://mastra.ai/models/providers/openai) | `openai/*` | `OPENAI_API_KEY` |
143
+ | [OpenCode](https://mastra.ai/models/providers/opencode) | `opencode/*` | `OPENCODE_API_KEY` |
143
144
  | [OpenCode Go](https://mastra.ai/models/providers/opencode-go) | `opencode-go/*` | `OPENCODE_API_KEY` |
144
- | [OpenCode Zen](https://mastra.ai/models/providers/opencode) | `opencode/*` | `OPENCODE_API_KEY` |
145
145
  | [OpenReason](https://mastra.ai/models/providers/openreason) | `openreason/*` | `OPENREASON_API_KEY` |
146
146
  | [Opper](https://mastra.ai/models/providers/opper) | `opper/*` | `OPPER_API_KEY` |
147
147
  | [OrcaRouter](https://mastra.ai/models/providers/orcarouter) | `orcarouter/*` | `ORCAROUTER_API_KEY` |
@@ -153,6 +153,7 @@ List of required environment variables for each model provider and gateway suppo
153
153
  | [Pioneer](https://mastra.ai/models/providers/pioneer) | `pioneer/*` | `PIONEER_API_KEY` |
154
154
  | [Poe](https://mastra.ai/models/providers/poe) | `poe/*` | `POE_API_KEY` |
155
155
  | [Poolside](https://mastra.ai/models/providers/poolside) | `poolside/*` | `POOLSIDE_API_KEY` |
156
+ | [Prime Inference](https://mastra.ai/models/providers/prime) | `prime/*` | `PRIME_API_KEY` |
156
157
  | [Privatemode AI](https://mastra.ai/models/providers/privatemode-ai) | `privatemode-ai/*` | `PRIVATEMODE_API_KEY` |
157
158
  | [QiHang](https://mastra.ai/models/providers/qihang-ai) | `qihang-ai/*` | `QIHANG_API_KEY` |
158
159
  | [Qiniu](https://mastra.ai/models/providers/qiniu-ai) | `qiniu-ai/*` | `QINIU_API_KEY` |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![Merge Gateway logo](https://models.dev/logos/merge-gateway.svg)Merge Gateway
6
6
 
7
- Merge Gateway aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 198 models through Mastra's model router.
7
+ Merge Gateway aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 199 models through Mastra's model router.
8
8
 
9
9
  Learn more in the [Merge Gateway documentation](https://docs.merge.dev/merge-gateway).
10
10
 
@@ -97,6 +97,7 @@ ANTHROPIC_API_KEY=ant-...
97
97
  | `google/gemini-3.7-flash` |
98
98
  | `google/gemini-3.8-flash` |
99
99
  | `google/gemini-embedding-001` |
100
+ | `google/gemini-embedding-2` |
100
101
  | `google/gemini-flash-latest` |
101
102
  | `google/gemini-flash-lite-latest` |
102
103
  | `google/gemma-3-12b-it` |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # Netlify
6
6
 
7
- Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 270 models through Mastra's model router.
7
+ Netlify AI Gateway provides unified access to multiple providers with built-in caching and observability. Access 274 models through Mastra's model router.
8
8
 
9
9
  Learn more in the [Netlify documentation](https://docs.netlify.com/build/ai-gateway/overview/).
10
10
 
@@ -75,6 +75,10 @@ ANTHROPIC_API_KEY=ant-...
75
75
  | `gemini/gemini-flash-latest` |
76
76
  | `gemini/gemini-flash-lite-latest` |
77
77
  | `gemini/gemini-nano-banana-2.1` |
78
+ | `meta/muse-spark-1.1` |
79
+ | `meta/muse-spark-1.2` |
80
+ | `meta/muse-spark-1.3` |
81
+ | `meta/muse-wonder-1.0` |
78
82
  | `openai/chat-latest` |
79
83
  | `openai/gpt-4.1` |
80
84
  | `openai/gpt-4.1-mini` |
@@ -4,7 +4,7 @@
4
4
 
5
5
  # ![OpenRouter logo](https://models.dev/logos/openrouter.svg)OpenRouter
6
6
 
7
- OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 379 models through Mastra's model router.
7
+ OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 380 models through Mastra's model router.
8
8
 
9
9
  Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
10
10
 
@@ -176,6 +176,7 @@ ANTHROPIC_API_KEY=ant-...
176
176
  | `meta/muse-spark-1.2-contributor` |
177
177
  | `meta/muse-spark-1.3` |
178
178
  | `meta/muse-spark-1.3-contributor` |
179
+ | `meta/muse-wonder` |
179
180
  | `microsoft/phi-4` |
180
181
  | `microsoft/wizardlm-2-8x22b` |
181
182
  | `minimax/minimax-01` |