@mastra/mcp-docs-server 1.2.23-alpha.1 → 1.2.23-alpha.11

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 (169) hide show
  1. package/.docs/docs/agents/code-mode.md +1 -1
  2. package/.docs/docs/agents/human-in-the-loop.md +1 -1
  3. package/.docs/docs/agents/networks.md +1 -1
  4. package/.docs/docs/agents/processors.md +1 -1
  5. package/.docs/docs/agents/structured-output.md +1 -1
  6. package/.docs/docs/auth/fga.md +16 -16
  7. package/.docs/docs/channels.md +2 -2
  8. package/.docs/docs/connections/mcp.md +1 -1
  9. package/.docs/docs/datasets/running-experiments.md +1 -1
  10. package/.docs/docs/deployment/sandbox.md +2 -2
  11. package/.docs/docs/deployment/workers.md +2 -2
  12. package/.docs/docs/evals/custom-scorers.md +3 -4
  13. package/.docs/docs/evals/multi-turn.md +1 -1
  14. package/.docs/docs/evals/overview.md +11 -11
  15. package/.docs/docs/evals/quick-checks.md +1 -1
  16. package/.docs/docs/evals/vitest-integration.md +136 -0
  17. package/.docs/docs/guides/context-engineering.md +1 -1
  18. package/.docs/docs/guides/multi-agent-systems.md +1 -1
  19. package/.docs/docs/guides/streaming.md +72 -52
  20. package/.docs/docs/harness/agent-controller.md +49 -1
  21. package/.docs/docs/harness/background-tasks.md +1 -1
  22. package/.docs/docs/harness/durable-agents.md +1 -1
  23. package/.docs/docs/harness/overview.md +10 -11
  24. package/.docs/docs/harness/schedules.md +1 -1
  25. package/.docs/docs/harness/signal-providers.md +1 -1
  26. package/.docs/docs/harness/signals.md +1 -1
  27. package/.docs/docs/index.md +1 -1
  28. package/.docs/docs/mastra-platform/deploy.md +15 -15
  29. package/.docs/docs/mastra-platform/environments.md +2 -2
  30. package/.docs/docs/mastra-platform/github.md +2 -2
  31. package/.docs/docs/mastra-platform/regions.md +1 -1
  32. package/.docs/docs/mastra-platform/server.md +4 -4
  33. package/.docs/docs/mastra-platform/studio.md +1 -1
  34. package/.docs/docs/mastra-platform/trace-intelligence.md +1 -1
  35. package/.docs/docs/mastra-platform/workspaces.md +1 -1
  36. package/.docs/docs/memory/message-history.md +3 -3
  37. package/.docs/docs/memory/observational-memory.md +18 -18
  38. package/.docs/docs/memory/overview.md +1 -1
  39. package/.docs/docs/memory/semantic-recall.md +0 -2
  40. package/.docs/docs/memory/working-memory.md +1 -1
  41. package/.docs/docs/observability/feedback.md +2 -2
  42. package/.docs/docs/observability/integrations/exporters/mastra-storage.md +1 -1
  43. package/.docs/docs/observability/logging.md +1 -1
  44. package/.docs/docs/observability/metrics/overview.md +1 -1
  45. package/.docs/docs/observability/overview.md +13 -11
  46. package/.docs/docs/observability/tracing/overview.md +13 -13
  47. package/.docs/docs/sandbox/lsp.md +1 -1
  48. package/.docs/docs/sandbox/overview.md +1 -1
  49. package/.docs/docs/server/mastra-client.md +1 -1
  50. package/.docs/docs/server/overview.md +1 -1
  51. package/.docs/docs/server/pubsub.md +1 -1
  52. package/.docs/docs/server/request-context.md +2 -2
  53. package/.docs/docs/server/server-adapters.md +1 -1
  54. package/.docs/docs/skills.md +1 -1
  55. package/.docs/docs/studio/deployment.md +1 -1
  56. package/.docs/docs/studio/editor.md +1 -1
  57. package/.docs/docs/studio/observability.md +2 -2
  58. package/.docs/docs/studio/overview.md +1 -1
  59. package/.docs/docs/subagents.md +2 -2
  60. package/.docs/docs/workflows/agents-and-tools.md +0 -4
  61. package/.docs/docs/workflows/control-flow.md +1 -3
  62. package/.docs/docs/workflows/overview.md +1 -1
  63. package/.docs/docs/workflows/scheduled-workflows.md +1 -1
  64. package/.docs/docs/workflows/suspend-and-resume.md +2 -2
  65. package/.docs/integrations/sandboxes/agentcore.md +2 -0
  66. package/.docs/integrations/sandboxes/apple-container.md +5 -3
  67. package/.docs/integrations/sandboxes/blaxel.md +2 -0
  68. package/.docs/integrations/sandboxes/cloudflare-sandbox.md +1 -1
  69. package/.docs/integrations/sandboxes/daytona.md +2 -0
  70. package/.docs/integrations/sandboxes/docker.md +3 -1
  71. package/.docs/integrations/sandboxes/e2b.md +4 -0
  72. package/.docs/integrations/sandboxes/modal.md +3 -1
  73. package/.docs/integrations/sandboxes/railway.md +2 -0
  74. package/.docs/integrations/sandboxes/vercel.md +4 -0
  75. package/.docs/integrations/voice/livekit.md +51 -1
  76. package/.docs/models/environment-variables.md +5 -0
  77. package/.docs/models/gateways/merge-gateway.md +2 -1
  78. package/.docs/models/gateways/netlify.md +6 -2
  79. package/.docs/models/gateways/openrouter.md +3 -5
  80. package/.docs/models/gateways/vercel.md +4 -1
  81. package/.docs/models/index.md +1 -1
  82. package/.docs/models/providers/abliteration-ai.md +7 -6
  83. package/.docs/models/providers/above.md +83 -0
  84. package/.docs/models/providers/aiand.md +4 -2
  85. package/.docs/models/providers/anthropic.md +2 -1
  86. package/.docs/models/providers/berget.md +4 -2
  87. package/.docs/models/providers/bothub.md +76 -0
  88. package/.docs/models/providers/chutes.md +1 -1
  89. package/.docs/models/providers/coralbricks.md +4 -4
  90. package/.docs/models/providers/cortecs.md +3 -3
  91. package/.docs/models/providers/crossmodel.md +4 -3
  92. package/.docs/models/providers/edenai.md +8 -6
  93. package/.docs/models/providers/empiriolabs.md +1 -2
  94. package/.docs/models/providers/fireworks-ai.md +2 -1
  95. package/.docs/models/providers/friendli.md +3 -2
  96. package/.docs/models/providers/google.md +1 -2
  97. package/.docs/models/providers/groq.md +2 -1
  98. package/.docs/models/providers/hyper.md +8 -6
  99. package/.docs/models/providers/iteracompute.md +8 -7
  100. package/.docs/models/providers/kilo.md +29 -32
  101. package/.docs/models/providers/klokintegration.md +77 -0
  102. package/.docs/models/providers/llmgateway-providers.md +2 -26
  103. package/.docs/models/providers/llmgateway.md +3 -14
  104. package/.docs/models/providers/nano-gpt.md +75 -92
  105. package/.docs/models/providers/neuralwatt.md +2 -1
  106. package/.docs/models/providers/ollama-cloud.md +2 -1
  107. package/.docs/models/providers/opencode-go.md +1 -1
  108. package/.docs/models/providers/opencode.md +2 -2
  109. package/.docs/models/providers/orcarouter.md +3 -2
  110. package/.docs/models/providers/requesty.md +5 -7
  111. package/.docs/models/providers/sensenova.md +77 -0
  112. package/.docs/models/providers/synthetic.md +3 -2
  113. package/.docs/models/providers/tokenrouter.md +75 -0
  114. package/.docs/models/providers/trustedrouter.md +13 -13
  115. package/.docs/models/providers/vancine.md +13 -11
  116. package/.docs/models/providers.md +5 -0
  117. package/.docs/reference/agent-controller/agent-controller-class.md +2 -2
  118. package/.docs/reference/agent-controller/session.md +3 -3
  119. package/.docs/reference/agents/durable-agent.md +77 -9
  120. package/.docs/reference/agents/getDefaultGenerateOptions.md +1 -1
  121. package/.docs/reference/agents/listSuspendedRuns.md +2 -2
  122. package/.docs/reference/ai-sdk/chat-route.md +1 -1
  123. package/.docs/reference/ai-sdk/network-route.md +1 -1
  124. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  125. package/.docs/reference/browser/browser-viewer.md +1 -1
  126. package/.docs/reference/cli/mastra.md +4 -4
  127. package/.docs/reference/core/mastra-class.md +1 -1
  128. package/.docs/reference/datasets/createExperiment.md +1 -1
  129. package/.docs/reference/editor/tool-provider.md +1 -1
  130. package/.docs/reference/editor/versioning.md +1 -1
  131. package/.docs/reference/evals/multi-turn-judge.md +1 -1
  132. package/.docs/reference/evals/rubric.md +1 -1
  133. package/.docs/reference/file-based-agents/schedules.md +2 -2
  134. package/.docs/reference/file-based-agents/workspace.md +1 -1
  135. package/.docs/reference/manual-install.md +3 -3
  136. package/.docs/reference/memory/observational-memory.md +4 -4
  137. package/.docs/reference/memory/settled.md +1 -1
  138. package/.docs/reference/migrations/mastra-cloud.md +9 -9
  139. package/.docs/reference/migrations/upgrade-to-v1/overview.md +1 -1
  140. package/.docs/reference/observability/tracing/configuration.md +2 -2
  141. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +1 -1
  142. package/.docs/reference/processors/processor-interface.md +1 -1
  143. package/.docs/reference/processors/regex-filter-processor.md +3 -3
  144. package/.docs/reference/processors/token-cost-control.md +2 -2
  145. package/.docs/reference/processors/token-limiter-processor.md +1 -1
  146. package/.docs/reference/processors/tool-search-processor.md +1 -1
  147. package/.docs/reference/processors/working-memory-processor.md +1 -1
  148. package/.docs/reference/pubsub/base.md +2 -2
  149. package/.docs/reference/pubsub/lease-provider.md +2 -2
  150. package/.docs/reference/rag/vector-databases.md +33 -33
  151. package/.docs/reference/server/create-route.md +1 -1
  152. package/.docs/reference/signals/task-signal-provider.md +1 -1
  153. package/.docs/reference/storage/composite.md +1 -1
  154. package/.docs/reference/storage/retention.md +4 -4
  155. package/.docs/reference/streaming/ChunkType.md +1 -1
  156. package/.docs/reference/tools/isolated-vm-transport.md +1 -1
  157. package/.docs/reference/tools/mcp-client.md +2 -2
  158. package/.docs/reference/vectors/couchbase.md +1 -1
  159. package/.docs/reference/vectors/mongodb.md +2 -2
  160. package/.docs/reference/voice/overview.md +1 -1
  161. package/.docs/reference/workflows/workflow-methods/agent.md +4 -4
  162. package/.docs/reference/workflows/workflow-methods/foreach.md +1 -1
  163. package/.docs/reference/workflows/workflow-methods/tool.md +2 -2
  164. package/.docs/reference/workspace/platform-sandbox.md +6 -2
  165. package/.docs/reference/workspace/process-manager.md +1 -1
  166. package/.docs/reference/workspace/sandbox.md +20 -3
  167. package/.docs/reference/workspace/workspace-class.md +3 -3
  168. package/package.json +5 -6
  169. package/CHANGELOG.md +0 -5929
@@ -38,7 +38,7 @@ bun add @mastra/isolated-vm
38
38
 
39
39
  `isolated-vm` is a native addon. It provides prebuilt binaries for common platforms, so installation usually needs no extra setup. A C++ toolchain is only needed on platforms without a matching prebuild, where it falls back to compiling from source.
40
40
 
41
- On Node.js 20 and later, the host process must be started with the `--no-node-snapshot` flag, otherwise creating an isolate crashes the process. The constructor throws an error when the flag is missing. Pass the flag when starting your server, or set it through `NODE_OPTIONS`:
41
+ On Node.js 20 and later, creating an isolate crashes unless the host process starts with `--no-node-snapshot`. The constructor reports the missing flag as an error. Pass it when starting the server or through `NODE_OPTIONS`:
42
42
 
43
43
  ```bash
44
44
  NODE_OPTIONS=--no-node-snapshot npm run dev
@@ -349,7 +349,7 @@ console.log(instructionsByServer.db)
349
349
 
350
350
  ### `authenticate()`
351
351
 
352
- Runs the interactive OAuth authorization-code flow for a server configured with an `MCPOAuthClientProvider` whose redirect URL points at a loopback address. Starts a local callback server, delivers the authorization URL through the provider's `onRedirectToAuthorization` callback, waits for the browser to return the authorization code, exchanges it for tokens, and reconnects. See [Interactive browser authentication](#interactive-browser-authentication).
352
+ Runs the interactive OAuth authorization-code flow for a server whose `MCPOAuthClientProvider` uses a loopback redirect URL. A local callback server passes the authorization URL to the provider's `onRedirectToAuthorization` callback and waits for the browser to return the code. It then exchanges the code for tokens and reconnects. See [Interactive browser authentication](#interactive-browser-authentication).
353
353
 
354
354
  The optional `timeoutMs` bounds how long the flow waits for the browser to return the authorization code before rejecting, and defaults to 5 minutes.
355
355
 
@@ -1056,7 +1056,7 @@ try {
1056
1056
 
1057
1057
  Concurrent `authenticate()` calls for the same server join the pending flow. Different servers authenticate independently. With valid stored tokens the call reconnects without opening a browser.
1058
1058
 
1059
- Hosts that drive the flow themselves can capture the authorization code with the exported `createOAuthCallbackServer` helper, which binds a one-shot loopback server and validates the OAuth `state` parameter before resolving with the code. It creates a plain HTTP server, so it's only for local loopback redirects. Web applications that use an HTTPS redirect URL must host their own callback endpoint and drive the provider directly rather than using this helper:
1059
+ Hosts that drive the flow can capture the authorization code with the exported `createOAuthCallbackServer` helper. It creates a one-shot loopback server that validates the OAuth `state` parameter before resolving with the code. Because the server uses plain HTTP, use it only for local loopback redirects. Web applications with an HTTPS redirect URL must host their own callback endpoint and drive the provider directly:
1060
1060
 
1061
1061
  ```typescript
1062
1062
  import { createOAuthCallbackServer, getCallbackUrlCandidates } from '@mastra/mcp'
@@ -216,7 +216,7 @@ try {
216
216
 
217
217
  - **Index Deletion Caveat:** Deleting a Search index doesn't delete the vectors/documents in the associated Couchbase collection. Data remains unless explicitly removed.
218
218
  - **Required Permissions:** The Couchbase user must have permissions to connect, read/write documents in the target collection (`kv` role), and manage Search Indexes (`search_admin` role on the relevant bucket/scope).
219
- - **Index Definition Details & Document Structure:** The `createIndex` method constructs a Search Index definition that indexes the `embedding` field (as type `vector`) and the `content` field (as type `text`), targeting documents within the specified `scopeName.collectionName`. Each document stores the vector in the `embedding` field and metadata in the `metadata` field. If `metadata` contains a `text` property, its value is also copied to a top-level `content` field, which is indexed for text search.
219
+ - **Index Definition Details & Document Structure:** The `createIndex` method builds a Search Index definition for documents in `scopeName.collectionName`. It indexes the `embedding` field as a vector and the `content` field as text. Each document stores its vector in `embedding`, with metadata kept in `metadata`. A `text` property within `metadata` is also copied to the top-level `content` field for text search.
220
220
  - **Replication & Durability:** Consider using Couchbase's built-in replication and persistence features for data durability. Monitor index statistics regularly to ensure efficient search.
221
221
 
222
222
  ## Limitations
@@ -222,7 +222,7 @@ const results = await store.textQuery({
222
222
 
223
223
  ### `hybridQuery()`
224
224
 
225
- Runs a hybrid search that fuses vector similarity and full-text results using MongoDB's server-side `$rankFusion`. It requires MongoDB >= 8.0 and is generally available from 8.1. On 8.0.x, it may require a MongoDB support case for enablement. It runs where enabled, including MongoDB Atlas 8.0.x. A full-text search index must exist: it's auto-created for managed indexes, but for a bring-your-own collection you must call `createSearchIndex()` first (opt-in).
225
+ Runs a hybrid search that fuses vector similarity with full-text results through MongoDB's server-side `$rankFusion`. The feature requires MongoDB 8.0 or later and is generally available from 8.1. MongoDB Atlas 8.0.x supports it where enabled, although enablement may require a support case. A full-text search index must exist. Managed indexes create one automatically, while bring-your-own collections require an explicit `createSearchIndex()` call.
226
226
 
227
227
  **indexName** (`string`): Name of the Mastra index to search
228
228
 
@@ -255,7 +255,7 @@ const results = await store.hybridQuery({
255
255
  })
256
256
  ```
257
257
 
258
- `hybridQuery()` requires MongoDB >= 8.0 for the `$rankFusion` stage. The stage is generally available from 8.1. On 8.0.x, it may need a MongoDB support case to enable and runs where enabled, such as MongoDB Atlas 8.0.x. If you're running an older version, or `$rankFusion` isn't enabled on your 8.0.x deployment, use `query()` and `textQuery()` separately and merge the results client-side.
258
+ `hybridQuery()` requires MongoDB 8.0 or later for the `$rankFusion` stage, which is generally available from 8.1. On 8.0.x, the stage runs where enabled, including MongoDB Atlas, but enablement may require a support case. If your deployment is older or lacks `$rankFusion`, run `query()` and `textQuery()` separately before merging the results client-side.
259
259
 
260
260
  ### `describeIndex()`
261
261
 
@@ -1090,7 +1090,7 @@ const voice = new CompositeVoice({
1090
1090
  output: elevenlabs.speech('eleven_turbo_v2'), // AI SDK speech
1091
1091
  })
1092
1092
 
1093
- // Works seamlessly with your agent
1093
+ // Works directly with your agent
1094
1094
  const voiceAgent = new Agent({
1095
1095
  id: 'aisdk-voice-agent',
1096
1096
  name: 'AI SDK Voice Agent',
@@ -12,9 +12,9 @@ Unlike wrapping an agent with `createStep()`, `.agent()` records a declarative e
12
12
 
13
13
  ```typescript
14
14
  workflow
15
- .map({ prompt: mapVariable({ initData: workflow, path: "topic" }) })
15
+ .map({ prompt: mapVariable({ initData: workflow, path: 'topic' }) })
16
16
  .agent(testAgent)
17
- .commit();
17
+ .commit()
18
18
  ```
19
19
 
20
20
  ## Parameters
@@ -42,7 +42,7 @@ workflow
42
42
  }),
43
43
  },
44
44
  })
45
- .commit();
45
+ .commit()
46
46
  ```
47
47
 
48
48
  ## Referencing an agent by ID
@@ -50,7 +50,7 @@ workflow
50
50
  Pass a string to reference a registered agent without importing it. The agent must be registered on the Mastra instance when the workflow runs:
51
51
 
52
52
  ```typescript
53
- workflow.agent("test-agent", { maxSteps: 3 }).commit();
53
+ workflow.agent('test-agent', { maxSteps: 3 }).commit()
54
54
  ```
55
55
 
56
56
  ## Persisting agent steps
@@ -26,7 +26,7 @@ workflow.foreach(step1, { concurrency: 2 })
26
26
 
27
27
  ### Execution and waiting
28
28
 
29
- The `.foreach()` method processes all items before the next step executes. The step following `.foreach()` only runs after every iteration has completed, regardless of concurrency settings. With `concurrency: 1` (default), items process sequentially. With higher concurrency, items process in parallel batches, but the next step still waits for all batches to finish.
29
+ The `.foreach()` method processes every item before the next step executes, regardless of concurrency settings. The default `concurrency: 1` processes items sequentially. Higher values use parallel batches, but the next step still waits for every batch to finish.
30
30
 
31
31
  If you need to run multiple operations per item, use a nested workflow as the step. This keeps all operations for each item together and is cleaner than chaining multiple `.foreach()` calls. See [Nested workflows inside foreach](https://mastra.ai/docs/workflows/control-flow) for examples.
32
32
 
@@ -11,7 +11,7 @@ Unlike wrapping a tool with `createStep()`, `.tool()` records a declarative entr
11
11
  ## Usage example
12
12
 
13
13
  ```typescript
14
- workflow.tool(testTool).commit();
14
+ workflow.tool(testTool).commit()
15
15
  ```
16
16
 
17
17
  ## Parameters
@@ -31,7 +31,7 @@ workflow.tool(testTool).commit();
31
31
  Pass a string to reference a registered tool without importing it. The tool must be registered on the Mastra instance when the workflow runs:
32
32
 
33
33
  ```typescript
34
- workflow.tool("lookup-customer", { retries: 2 }).commit();
34
+ workflow.tool('lookup-customer', { retries: 2 }).commit()
35
35
  ```
36
36
 
37
37
  ## Persisting tool steps
@@ -175,9 +175,11 @@ await sandbox.start()
175
175
 
176
176
  `createRepoTemplate()` accepts the same `cpuCount` and `memoryMB` sizing as the `Template()` builder methods, as plain options. They carry the identity and stale-fallback semantics described above. Omit them for the provider defaults.
177
177
 
178
- `getRepositoryAccess` mirrors the resolver a Factory sandbox context carries, so a host can pass its context straight through; when it's absent, `createRepoTemplate()` returns `undefined` and the sandbox boots the provider default. The resolver doesn't run when `PlatformSandbox` reattaches to an existing `sandboxId`. It resolves the repository's default-branch head at fresh-start time, then Platform starts or reuses the corresponding template build. If the repository head can't be resolved or the provider build fails, sandbox creation continues with the provider's default template so runtime setup can perform a cold checkout. For private repositories, the short-lived authorization token is sent as an ephemeral build environment value that stays out of the serialized definition and the persisted template record. It has no effect on content identity.
178
+ `setupCommand` also accepts an array. Each entry runs as its own cached build step. `workingDirectory` sets the cwd for the build and the sandbox, and the repository is cloned to `<workingDirectory>/<repo>`. `buildEnv` passes environment variables to the build steps only. They never enter the serialized definition.
179
179
 
180
- `createRepoTemplate()` also attaches a commit-independent `family` key (`repo:<cloneUrl>:<workdir>`, with the workdir derived from the clone URL) to the definition. `family` groups successive builds of the "same thing", so every commit of the same repository belongs to the same family. Platform uses it to find a prior ready build in the same family and boot the new commit on that warm filesystem while the exact commit template builds in the background. For E2B, stale lookup is also partitioned by the effective CPU and memory settings so a fallback can't silently change the requested machine size. Callers using the raw `Template()` builder can attach their own family key with `.withFamily(key)` (any non-empty string up to 200 characters). Omit it to opt out of family fallback. The family key never influences the content-addressed template identity: two definitions that differ only in `family` share the same cache slot.
180
+ `getRepositoryAccess` mirrors the resolver a Factory sandbox context carries, so a host can pass its context straight through; when it's absent, `createRepoTemplate()` returns `undefined` and the sandbox boots the provider default. The resolver skips reattachment to an existing `sandboxId`; on a fresh start, it resolves the repository's default-branch head before Platform starts or reuses the corresponding template build. If the repository head can't be resolved or the provider build fails, sandbox creation continues with the provider's default template so runtime setup can perform a cold checkout. For private repositories, the short-lived authorization token is sent as an ephemeral build environment value that stays out of the serialized definition and the persisted template record. It has no effect on content identity.
181
+
182
+ `createRepoTemplate()` also attaches a commit-independent `family` key (`repo:<cloneUrl>:<workingDirectory>/<repo>`) to the definition. `family` groups successive builds of the "same thing", so every commit of the same repository belongs to the same family. Platform uses it to find a prior ready build in the same family and boot the new commit on that warm filesystem while the exact commit template builds in the background. For E2B, stale lookup is also partitioned by the effective CPU and memory settings so a fallback can't silently change the requested machine size. Callers using the raw `Template()` builder can attach their own family key with `.withFamily(key)` (any non-empty string up to 200 characters). Omit it to opt out of family fallback. The family key never influences the content-addressed template identity: two definitions that differ only in `family` share the same cache slot.
181
183
 
182
184
  Platform stores build state under the definition's server-derived content hash within the selected environment and provider.
183
185
 
@@ -289,6 +291,8 @@ console.log(result.exitCode)
289
291
 
290
292
  **env** (`Record<string, string>`): Environment variables baked into the sandbox at creation time. Per-command environment variables can also be passed to executeCommand.
291
293
 
294
+ **workingDirectory** (`string`): Default directory for command execution when no per-command cwd is given. A per-command cwd always wins. Use an absolute path.
295
+
292
296
  **timeout** (`number`): Default command execution timeout in milliseconds. Overridable per call via ExecuteCommandOptions.timeout.
293
297
 
294
298
  **instructions** (`string | ((opts: { defaultInstructions: string; requestContext?: RequestContext }) => string)`): Custom instructions returned by getInstructions(). A string fully replaces the defaults; a function receives the defaults and can extend or customize them per-request.
@@ -60,7 +60,7 @@ const handle = await sandbox.processes.spawn('npm run dev', {
60
60
 
61
61
  **options.env** (`NodeJS.ProcessEnv`): Environment variables for the process.
62
62
 
63
- **options.cwd** (`string`): Working directory for the process.
63
+ **options.cwd** (`string`): Working directory for the process. Defaults to the sandbox's configured workingDirectory, then the provider default.
64
64
 
65
65
  **options.onStdout** (`(data: string) => void`): Callback for stdout chunks. Called as data arrives.
66
66
 
@@ -41,7 +41,7 @@ Provider implementations plug into the start lifecycle at one of three rungs; th
41
41
  2. **`start()` override returning `SandboxStartResult`**: for providers whose API is a fused get-or-create where decomposition would add round-trips (`PlatformSandbox`, `RailwaySandbox`).
42
42
  3. **`start()` override returning `void`**: legacy providers, where the outcome is unknown.
43
43
 
44
- Concurrent `start()` calls on one instance coalesce onto a single in-flight attempt, and joined callers share that attempt's result (all observe `outcome: 'created'` when the shared attempt created the VM). The in-flight slot is cleared when the attempt settles, so a failed start can be retried. While the sandbox is already `running`, `start()` resolves `{ outcome: 'connected' }` without re-invoking the provider.
44
+ Concurrent `start()` calls on one instance coalesce onto a single in-flight attempt, and joined callers share that attempt's result (all observe `outcome: 'created'` when the shared attempt created the VM). The in-flight slot is cleared when the attempt settles, so a failed start can be retried. For a sandbox already in the `running` state, `start()` resolves `{ outcome: 'connected' }` without re-invoking the provider.
45
45
 
46
46
  The result is also forwarded to the `onStart` lifecycle hook as `{ sandbox, outcome }`.
47
47
 
@@ -94,6 +94,23 @@ Semantics:
94
94
  - Each call wraps the current hook, so attach once per sandbox instance. Attaching on a path that runs per request stacks duplicate work on every start.
95
95
  - Only starts that begin after the call see the new hook.
96
96
 
97
+ ### `workingDirectory` (constructor option)
98
+
99
+ Sets the default directory for command execution and process spawns. When a command provides no per-command `cwd`, the sandbox runs it from this directory. A per-command `cwd` always wins. When neither is provided, each provider keeps its own default (E2B home, Docker `/workspace`, Vercel serverless `/tmp`, and so on).
100
+
101
+ ```typescript
102
+ const sandbox = new E2BSandbox({ workingDirectory: '/home/user/my-repo' })
103
+ await sandbox.executeCommand('pwd') // /home/user/my-repo
104
+ await sandbox.executeCommand('pwd', [], { cwd: '/tmp' }) // /tmp
105
+ ```
106
+
107
+ The effective value is readable through the `sandbox.workingDirectory` getter. Providers that compute their value, such as Daytona's automatic probe or Docker's `/workspace` default, report the effective directory through the same getter.
108
+
109
+ Semantics:
110
+
111
+ - The value passes to the provider as-is, and the sandbox doesn't create the directory. Absolute paths are recommended: `~`-prefixed paths only work where the provider documents expansion.
112
+ - Some providers keep earlier option names as deprecated aliases feeding the same field: `workingDir` on Docker and Apple container, `workdir` on Modal. When both the alias and `workingDirectory` are set, `workingDirectory` wins.
113
+
97
114
  ### `stop()`
98
115
 
99
116
  Stop the sandbox.
@@ -139,7 +156,7 @@ const result = await sandbox.executeCommand('npm', ['install', 'lodash'])
139
156
 
140
157
  **options.timeout** (`number`): Execution timeout in milliseconds
141
158
 
142
- **options.cwd** (`string`): Working directory for the command
159
+ **options.cwd** (`string`): Working directory for this command. Defaults to the sandbox's configured workingDirectory, then the provider default.
143
160
 
144
161
  **options.env** (`Record<string, string>`): Additional environment variables for this command. These take precedence over the sandbox environment for this command execution only.
145
162
 
@@ -167,7 +184,7 @@ The runtime environment applies to commands executed through the sandbox rather
167
184
 
168
185
  ### `getEnv()`
169
186
 
170
- Returns a copy of the sandbox's current runtime environment. Mutating the returned object doesn't change the sandbox, so use `setEnv()` for updates.
187
+ Returns a copy of the sandbox's current runtime environment; because mutations to the returned object don't change the sandbox, use `setEnv()` for updates.
171
188
 
172
189
  ```typescript
173
190
  const token = sandbox.getEnv().GH_TOKEN
@@ -243,7 +243,7 @@ Stop the workspace's live resources without destroying them.
243
243
  await workspace.stop()
244
244
  ```
245
245
 
246
- `stop()` shuts down language servers and closes the browser, then stops the sandbox provider. Remote sandbox providers suspend or pause the sandbox so it can resume later. `LocalSandbox` kills its background processes and unmounts filesystems. Stopping isn't a teardown. The filesystem, search index, and skills keep working, and the next sandbox operation starts the sandbox again.
246
+ `stop()` shuts down language servers and the browser before stopping the sandbox provider. Remote providers suspend or pause the sandbox for later resumption, while `LocalSandbox` kills background processes and unmounts filesystems. Stopping isn't a teardown. The filesystem and search index remain available along with skills, and the next sandbox operation starts the sandbox again.
247
247
 
248
248
  `mastra.shutdown()` calls `stop()` for registered workspaces, so a process restart suspends remote sandboxes instead of deleting them. To fully tear a workspace down, call `destroy()` or `mastra.removeWorkspace(id, { destroy: true })` explicitly.
249
249
 
@@ -390,7 +390,7 @@ if (workspace.hasFilesystemConfig()) {
390
390
 
391
391
  #### `resolveFilesystem({ requestContext })`
392
392
 
393
- Resolve the filesystem for a request context. When a resolver function is configured, calls it with the provided `requestContext`. When a static filesystem is configured, returns it directly. Returns `undefined` if no filesystem is configured.
393
+ Resolve the filesystem for a request context by calling a configured resolver with `requestContext` or returning a configured static filesystem directly. Returns `undefined` when no filesystem is configured.
394
394
 
395
395
  ```typescript
396
396
  import { RequestContext } from '@mastra/core/request-context'
@@ -421,7 +421,7 @@ if (workspace.hasSandboxConfig()) {
421
421
 
422
422
  #### `resolveSandbox({ requestContext })`
423
423
 
424
- Resolve the sandbox for a request context. When a resolver function is configured, calls it with the provided `requestContext`. When a static sandbox is configured, returns it directly. Returns `undefined` if no sandbox is configured.
424
+ Resolve the sandbox for a request context by calling a configured resolver with `requestContext` or returning a configured static sandbox directly. Returns `undefined` when no sandbox is configured.
425
425
 
426
426
  ```typescript
427
427
  import { RequestContext } from '@mastra/core/request-context'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.23-alpha.1",
3
+ "version": "1.2.23-alpha.11",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -8,8 +8,7 @@
8
8
  "files": [
9
9
  "dist",
10
10
  ".docs",
11
- "README.md",
12
- "CHANGELOG.md"
11
+ "README.md"
13
12
  ],
14
13
  "exports": {
15
14
  ".": {
@@ -28,8 +27,8 @@
28
27
  "jsdom": "^26.1.0",
29
28
  "local-pkg": "^1.1.2",
30
29
  "zod": "^4.4.3",
31
- "@mastra/core": "1.63.3-alpha.0",
32
- "@mastra/mcp": "^1.17.2"
30
+ "@mastra/core": "1.64.0-alpha.5",
31
+ "@mastra/mcp": "^1.17.3-alpha.1"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@hono/node-server": "^2.0.0",
@@ -45,8 +44,8 @@
45
44
  "tsx": "^4.23.1",
46
45
  "typescript": "^7.0.2",
47
46
  "vitest": "4.1.10",
48
- "@mastra/core": "1.63.3-alpha.0",
49
47
  "@internal/lint": "0.0.129",
48
+ "@mastra/core": "1.64.0-alpha.5",
50
49
  "@internal/types-builder": "0.0.104"
51
50
  },
52
51
  "homepage": "https://mastra.ai",