@mastra/mcp-docs-server 0.0.0-studio-deploy-20260404182525 → 0.0.0-studio-cli-20260504022012

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 (285) hide show
  1. package/.docs/docs/agents/adding-voice.md +18 -17
  2. package/.docs/docs/agents/background-tasks.md +242 -0
  3. package/.docs/docs/agents/channels.md +2 -1
  4. package/.docs/docs/agents/overview.md +4 -0
  5. package/.docs/docs/agents/processors.md +177 -5
  6. package/.docs/docs/agents/structured-output.md +66 -1
  7. package/.docs/docs/agents/supervisor-agents.md +65 -0
  8. package/.docs/docs/agents/using-tools.md +73 -0
  9. package/.docs/docs/browser/agent-browser.md +78 -0
  10. package/.docs/docs/browser/browser-viewer.md +144 -0
  11. package/.docs/docs/browser/overview.md +168 -0
  12. package/.docs/docs/browser/stagehand.md +129 -0
  13. package/.docs/docs/deployment/cloud-providers.md +5 -1
  14. package/.docs/docs/deployment/mastra-server.md +4 -4
  15. package/.docs/docs/deployment/monorepo.md +3 -3
  16. package/.docs/docs/deployment/overview.md +11 -8
  17. package/.docs/docs/editor/overview.md +290 -0
  18. package/.docs/docs/editor/prompts.md +134 -0
  19. package/.docs/docs/editor/tools.md +152 -0
  20. package/.docs/docs/evals/custom-scorers.md +63 -3
  21. package/.docs/docs/evals/datasets/overview.md +1 -1
  22. package/.docs/docs/index.md +2 -2
  23. package/.docs/docs/mastra-platform/configuration.md +36 -0
  24. package/.docs/docs/mastra-platform/overview.md +78 -0
  25. package/.docs/docs/mcp/overview.md +17 -0
  26. package/.docs/docs/memory/memory-processors.md +3 -3
  27. package/.docs/docs/memory/message-history.md +8 -2
  28. package/.docs/docs/memory/observational-memory.md +65 -8
  29. package/.docs/docs/memory/storage.md +1 -2
  30. package/.docs/docs/memory/working-memory.md +2 -2
  31. package/.docs/docs/observability/logging.md +1 -1
  32. package/.docs/docs/observability/metrics/overview.md +2 -2
  33. package/.docs/docs/observability/overview.md +1 -1
  34. package/.docs/docs/observability/tracing/bridges/datadog.md +217 -0
  35. package/.docs/docs/observability/tracing/bridges/otel.md +2 -2
  36. package/.docs/docs/observability/tracing/exporters/arthur.md +163 -0
  37. package/.docs/docs/observability/tracing/exporters/cloud.md +135 -63
  38. package/.docs/docs/observability/tracing/exporters/datadog.md +3 -1
  39. package/.docs/docs/observability/tracing/exporters/default.md +5 -5
  40. package/.docs/docs/observability/tracing/exporters/laminar.md +22 -14
  41. package/.docs/docs/observability/tracing/exporters/langfuse.md +50 -33
  42. package/.docs/docs/observability/tracing/overview.md +87 -20
  43. package/.docs/docs/server/custom-adapters.md +5 -5
  44. package/.docs/docs/server/custom-api-routes.md +3 -3
  45. package/.docs/docs/server/mastra-client.md +2 -2
  46. package/.docs/docs/server/mastra-server.md +1 -1
  47. package/.docs/docs/server/middleware.md +46 -42
  48. package/.docs/docs/server/request-context.md +13 -2
  49. package/.docs/docs/server/server-adapters.md +91 -8
  50. package/.docs/docs/streaming/background-task-streaming.md +80 -0
  51. package/.docs/docs/streaming/overview.md +3 -0
  52. package/.docs/docs/studio/deployment.md +24 -6
  53. package/.docs/docs/studio/observability.md +1 -1
  54. package/.docs/docs/studio/overview.md +4 -4
  55. package/.docs/docs/voice/overview.md +74 -5
  56. package/.docs/docs/voice/speech-to-speech.md +45 -1
  57. package/.docs/docs/voice/speech-to-text.md +7 -7
  58. package/.docs/docs/voice/text-to-speech.md +10 -10
  59. package/.docs/docs/workflows/agents-and-tools.md +1 -1
  60. package/.docs/docs/workflows/overview.md +105 -4
  61. package/.docs/docs/workflows/scheduled-workflows.md +181 -0
  62. package/.docs/docs/workspace/filesystem.md +64 -6
  63. package/.docs/docs/workspace/lsp.md +76 -4
  64. package/.docs/docs/workspace/overview.md +62 -15
  65. package/.docs/docs/workspace/sandbox.md +3 -1
  66. package/.docs/docs/workspace/search.md +41 -2
  67. package/.docs/docs/workspace/skills.md +19 -19
  68. package/.docs/guides/agent-frameworks/ai-sdk.md +4 -4
  69. package/.docs/guides/build-your-ui/ai-sdk-ui.md +56 -9
  70. package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
  71. package/.docs/guides/deployment/mastra-platform.md +191 -0
  72. package/.docs/guides/deployment/netlify.md +16 -1
  73. package/.docs/guides/getting-started/nestjs.md +238 -0
  74. package/.docs/guides/getting-started/next-js.md +0 -4
  75. package/.docs/guides/guide/code-review-bot.md +2 -2
  76. package/.docs/guides/guide/dev-assistant.md +4 -4
  77. package/.docs/{docs/mcp → guides/guide}/publishing-mcp-server.md +21 -1
  78. package/.docs/guides/guide/slack-assistant.md +191 -0
  79. package/.docs/guides/migrations/mastra-cloud.md +368 -0
  80. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
  81. package/.docs/models/embeddings.md +3 -3
  82. package/.docs/models/gateways/azure-openai.md +74 -35
  83. package/.docs/models/gateways/mastra.md +64 -0
  84. package/.docs/models/gateways/netlify.md +7 -3
  85. package/.docs/models/gateways/openrouter.md +28 -12
  86. package/.docs/models/gateways/vercel.md +22 -2
  87. package/.docs/models/gateways.md +1 -0
  88. package/.docs/models/index.md +43 -8
  89. package/.docs/models/providers/302ai.md +37 -4
  90. package/.docs/models/providers/abliteration-ai.md +71 -0
  91. package/.docs/models/providers/alibaba-cn.md +8 -2
  92. package/.docs/models/providers/alibaba-coding-plan-cn.md +3 -2
  93. package/.docs/models/providers/alibaba-coding-plan.md +3 -2
  94. package/.docs/models/providers/alibaba.md +8 -1
  95. package/.docs/models/providers/anthropic.md +18 -5
  96. package/.docs/models/providers/baseten.md +3 -1
  97. package/.docs/models/providers/berget.md +10 -12
  98. package/.docs/models/providers/chutes.md +4 -2
  99. package/.docs/models/providers/cloudflare-workers-ai.md +14 -48
  100. package/.docs/models/providers/cortecs.md +22 -2
  101. package/.docs/models/providers/deepinfra.md +8 -2
  102. package/.docs/models/providers/deepseek.md +6 -4
  103. package/.docs/models/providers/digitalocean.md +133 -0
  104. package/.docs/models/providers/fireworks-ai.md +6 -1
  105. package/.docs/models/providers/firmware.md +12 -10
  106. package/.docs/models/providers/friendli.md +6 -7
  107. package/.docs/models/providers/google.md +9 -3
  108. package/.docs/models/providers/helicone.md +1 -2
  109. package/.docs/models/providers/hpc-ai.md +73 -0
  110. package/.docs/models/providers/huggingface.md +6 -2
  111. package/.docs/models/providers/inception.md +9 -11
  112. package/.docs/models/providers/kilo.md +359 -339
  113. package/.docs/models/providers/kimi-for-coding.md +2 -1
  114. package/.docs/models/providers/llmgateway.md +67 -77
  115. package/.docs/models/providers/mistral.md +3 -2
  116. package/.docs/models/providers/mixlayer.md +75 -0
  117. package/.docs/models/providers/moonshotai-cn.md +3 -2
  118. package/.docs/models/providers/moonshotai.md +3 -2
  119. package/.docs/models/providers/nano-gpt.md +8 -2
  120. package/.docs/models/providers/neuralwatt.md +84 -0
  121. package/.docs/models/providers/novita-ai.md +19 -4
  122. package/.docs/models/providers/nvidia.md +8 -1
  123. package/.docs/models/providers/ollama-cloud.md +7 -2
  124. package/.docs/models/providers/openai.md +7 -2
  125. package/.docs/models/providers/opencode-go.md +21 -13
  126. package/.docs/models/providers/opencode.md +11 -4
  127. package/.docs/models/providers/ovhcloud.md +6 -8
  128. package/.docs/models/providers/poe.md +10 -15
  129. package/.docs/models/providers/regolo-ai.md +83 -0
  130. package/.docs/models/providers/siliconflow-cn.md +5 -2
  131. package/.docs/models/providers/siliconflow.md +6 -3
  132. package/.docs/models/providers/stepfun.md +8 -7
  133. package/.docs/models/providers/synthetic.md +5 -2
  134. package/.docs/models/providers/tencent-token-plan.md +71 -0
  135. package/.docs/models/providers/tencent-tokenhub.md +71 -0
  136. package/.docs/models/providers/togetherai.md +8 -7
  137. package/.docs/models/providers/vivgrid.md +7 -3
  138. package/.docs/models/providers/vultr.md +7 -6
  139. package/.docs/models/providers/wafer.ai.md +73 -0
  140. package/.docs/models/providers/wandb.md +3 -2
  141. package/.docs/models/providers/xai.md +6 -1
  142. package/.docs/models/providers/xiaomi-token-plan-ams.md +75 -0
  143. package/.docs/models/providers/xiaomi-token-plan-cn.md +75 -0
  144. package/.docs/models/providers/xiaomi-token-plan-sgp.md +75 -0
  145. package/.docs/models/providers/xiaomi.md +4 -2
  146. package/.docs/models/providers/zai-coding-plan.md +11 -19
  147. package/.docs/models/providers/zai.md +2 -1
  148. package/.docs/models/providers/zenmux.md +17 -6
  149. package/.docs/models/providers/zhipuai-coding-plan.md +11 -21
  150. package/.docs/models/providers/zhipuai.md +2 -1
  151. package/.docs/models/providers.md +11 -0
  152. package/.docs/reference/agents/agent.md +1 -1
  153. package/.docs/reference/agents/channels.md +3 -3
  154. package/.docs/reference/agents/generate.md +88 -6
  155. package/.docs/reference/agents/generateLegacy.md +1 -1
  156. package/.docs/reference/ai-sdk/chat-route.md +2 -0
  157. package/.docs/reference/ai-sdk/handle-chat-stream.md +19 -0
  158. package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
  159. package/.docs/reference/ai-sdk/network-route.md +2 -0
  160. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +95 -0
  161. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +15 -0
  162. package/.docs/reference/browser/agent-browser.md +375 -0
  163. package/.docs/reference/browser/browser-viewer.md +228 -0
  164. package/.docs/reference/browser/mastra-browser.md +286 -0
  165. package/.docs/reference/browser/stagehand-browser.md +286 -0
  166. package/.docs/reference/cli/mastra.md +703 -0
  167. package/.docs/reference/client-js/agents.md +166 -0
  168. package/.docs/reference/client-js/conversations.md +1 -1
  169. package/.docs/reference/client-js/mastra-client.md +23 -0
  170. package/.docs/reference/client-js/observability.md +2 -2
  171. package/.docs/reference/client-js/responses.md +1 -1
  172. package/.docs/reference/client-js/workflows.md +62 -1
  173. package/.docs/reference/configuration.md +67 -1
  174. package/.docs/reference/core/addGateway.md +5 -5
  175. package/.docs/reference/core/getEditor.md +35 -0
  176. package/.docs/reference/core/getGateway.md +5 -5
  177. package/.docs/reference/core/getGatewayById.md +5 -5
  178. package/.docs/reference/core/getMCPServer.md +2 -2
  179. package/.docs/reference/core/getMCPServerById.md +2 -2
  180. package/.docs/reference/core/getScorer.md +3 -3
  181. package/.docs/reference/core/getScorerById.md +3 -3
  182. package/.docs/reference/core/listGateways.md +5 -5
  183. package/.docs/reference/core/listMCPServers.md +2 -2
  184. package/.docs/reference/core/listScorers.md +3 -3
  185. package/.docs/reference/core/mastra-class.md +11 -1
  186. package/.docs/reference/core/mastra-model-gateway.md +5 -5
  187. package/.docs/reference/datasets/create.md +4 -4
  188. package/.docs/reference/datasets/startExperiment.md +28 -2
  189. package/.docs/reference/datasets/update.md +4 -4
  190. package/.docs/reference/deployer/cloudflare.md +14 -1
  191. package/.docs/reference/deployer/netlify.md +50 -2
  192. package/.docs/reference/editor/mastra-editor.md +168 -0
  193. package/.docs/reference/editor/tool-provider.md +85 -0
  194. package/.docs/reference/evals/context-precision.md +3 -3
  195. package/.docs/reference/evals/context-relevance.md +3 -3
  196. package/.docs/reference/evals/create-scorer.md +5 -3
  197. package/.docs/reference/evals/filter-run.md +117 -0
  198. package/.docs/reference/evals/mastra-scorer.md +4 -4
  199. package/.docs/reference/evals/noise-sensitivity.md +6 -6
  200. package/.docs/reference/evals/prompt-alignment.md +12 -12
  201. package/.docs/reference/evals/run-evals.md +6 -6
  202. package/.docs/reference/evals/scorer-utils.md +3 -3
  203. package/.docs/reference/evals/trajectory-accuracy.md +3 -3
  204. package/.docs/reference/harness/harness-class.md +152 -53
  205. package/.docs/reference/index.md +25 -0
  206. package/.docs/reference/logging/pino-logger.md +0 -2
  207. package/.docs/reference/mastra-platform/api.md +108 -0
  208. package/.docs/reference/memory/clone-utilities.md +4 -2
  209. package/.docs/reference/memory/cloneThread.md +4 -2
  210. package/.docs/reference/memory/observational-memory.md +4 -0
  211. package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
  212. package/.docs/reference/observability/tracing/bridges/datadog.md +211 -0
  213. package/.docs/reference/observability/tracing/bridges/otel.md +3 -3
  214. package/.docs/reference/observability/tracing/configuration.md +18 -11
  215. package/.docs/reference/observability/tracing/exporters/arthur.md +122 -0
  216. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +102 -21
  217. package/.docs/reference/observability/tracing/exporters/console-exporter.md +8 -8
  218. package/.docs/reference/observability/tracing/exporters/datadog.md +3 -1
  219. package/.docs/reference/observability/tracing/exporters/default-exporter.md +8 -8
  220. package/.docs/reference/observability/tracing/exporters/langfuse.md +25 -32
  221. package/.docs/reference/observability/tracing/exporters/otel.md +3 -3
  222. package/.docs/reference/observability/tracing/instances.md +7 -7
  223. package/.docs/reference/observability/tracing/interfaces.md +23 -6
  224. package/.docs/reference/observability/tracing/span-filtering.md +95 -0
  225. package/.docs/reference/observability/tracing/spans.md +6 -6
  226. package/.docs/reference/processors/prefill-error-handler.md +70 -0
  227. package/.docs/reference/processors/processor-interface.md +400 -40
  228. package/.docs/reference/processors/skill-search-processor.md +20 -1
  229. package/.docs/reference/processors/stream-error-retry-processor.md +54 -0
  230. package/.docs/reference/processors/tool-call-filter.md +23 -0
  231. package/.docs/reference/server/create-route.md +3 -3
  232. package/.docs/reference/server/express-adapter.md +4 -4
  233. package/.docs/reference/server/fastify-adapter.md +4 -4
  234. package/.docs/reference/server/hono-adapter.md +4 -4
  235. package/.docs/reference/server/koa-adapter.md +4 -4
  236. package/.docs/reference/server/mastra-server.md +3 -3
  237. package/.docs/reference/server/nestjs-adapter.md +169 -0
  238. package/.docs/reference/server/register-api-route.md +4 -4
  239. package/.docs/reference/server/routes.md +11 -10
  240. package/.docs/reference/storage/clickhouse.md +300 -0
  241. package/.docs/reference/storage/cloudflare-d1.md +42 -42
  242. package/.docs/reference/storage/composite.md +5 -3
  243. package/.docs/reference/storage/duckdb.md +150 -0
  244. package/.docs/reference/storage/overview.md +1 -1
  245. package/.docs/reference/storage/redis.md +266 -0
  246. package/.docs/reference/streaming/ChunkType.md +143 -3
  247. package/.docs/reference/streaming/agents/MastraModelOutput.md +2 -2
  248. package/.docs/reference/streaming/agents/stream.md +10 -2
  249. package/.docs/reference/streaming/agents/streamUntilIdle.md +94 -0
  250. package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
  251. package/.docs/reference/templates/overview.md +88 -14
  252. package/.docs/reference/tools/create-tool.md +107 -5
  253. package/.docs/reference/tools/mcp-client.md +45 -0
  254. package/.docs/reference/tools/mcp-server.md +1 -3
  255. package/.docs/reference/tools/perplexity.md +155 -0
  256. package/.docs/reference/tools/tavily.md +307 -0
  257. package/.docs/reference/vectors/mongodb.md +0 -2
  258. package/.docs/reference/voice/aws-nova-sonic.md +247 -0
  259. package/.docs/reference/voice/cloudflare.md +3 -3
  260. package/.docs/reference/voice/sarvam.md +29 -23
  261. package/.docs/reference/voice/voice.connect.md +4 -4
  262. package/.docs/reference/voice/voice.listen.md +3 -3
  263. package/.docs/reference/workflows/run-methods/resume.md +24 -0
  264. package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
  265. package/.docs/reference/workflows/step.md +88 -7
  266. package/.docs/reference/workflows/workflow-methods/foreach.md +14 -1
  267. package/.docs/reference/workflows/workflow.md +88 -4
  268. package/.docs/reference/workspace/azure-blob-filesystem.md +219 -0
  269. package/.docs/reference/workspace/docker-sandbox.md +196 -0
  270. package/.docs/reference/workspace/gcs-filesystem.md +1 -0
  271. package/.docs/reference/workspace/google-drive-filesystem.md +185 -0
  272. package/.docs/reference/workspace/modal-sandbox.md +168 -0
  273. package/.docs/reference/workspace/process-manager.md +1 -1
  274. package/.docs/reference/workspace/s3-filesystem.md +80 -5
  275. package/.docs/reference/workspace/vercel.md +1 -1
  276. package/.docs/reference/workspace/workspace-class.md +37 -6
  277. package/CHANGELOG.md +500 -4
  278. package/dist/stdio.js.map +1 -1
  279. package/dist/utils.d.ts +1 -4
  280. package/dist/utils.d.ts.map +1 -1
  281. package/package.json +11 -11
  282. package/.docs/docs/mastra-cloud/deployment.md +0 -77
  283. package/.docs/docs/mastra-cloud/observability.md +0 -38
  284. package/.docs/docs/mastra-cloud/overview.md +0 -23
  285. package/.docs/docs/mastra-cloud/setup.md +0 -42
@@ -179,6 +179,10 @@ The port of the Mastra API server to connect to. Defaults to `4111`.
179
179
 
180
180
  The protocol of the Mastra API server to connect to. Defaults to `http`.
181
181
 
182
+ #### `--server-api-prefix`
183
+
184
+ The API route prefix of the Mastra API server. Defaults to `/api`.
185
+
182
186
  #### `--request-context-presets`
183
187
 
184
188
  Path to a JSON file containing named [request context](https://mastra.ai/docs/server/request-context) presets. Works the same as the [`mastra dev` flag](#--request-context-presets).
@@ -187,6 +191,241 @@ Path to a JSON file containing named [request context](https://mastra.ai/docs/se
187
191
  mastra studio --request-context-presets ./presets.json
188
192
  ```
189
193
 
194
+ ## `mastra studio deploy`
195
+
196
+ Builds and deploys your project to Mastra platform. Requires authentication via [`mastra auth login`](#mastra-auth-login) or a `MASTRA_API_TOKEN` environment variable.
197
+
198
+ ```bash
199
+ mastra studio deploy
200
+ ```
201
+
202
+ The command runs `mastra build`, zips the output, reads environment variables from `.env`, `.env.local`, and `.env.production`, and uploads everything to the platform. After uploading, it polls the deploy status and streams build logs until the deploy reaches a terminal state.
203
+
204
+ Organization and project are resolved in order from: Environment variable flag, `.mastra-project.json` config file, current org from credentials, and lastly interactive prompt. On first deploy, the CLI saves the resolved IDs to `.mastra-project.json` so subsequent deploys skip the prompts.
205
+
206
+ ### Arguments
207
+
208
+ #### `[dir]`
209
+
210
+ Project directory. Defaults to the current directory.
211
+
212
+ ### Flags
213
+
214
+ #### `--org`
215
+
216
+ Organization ID. Can also be set via the `MASTRA_ORG_ID` environment variable.
217
+
218
+ #### `--project`
219
+
220
+ Project ID or slug. Can also be set via the `MASTRA_PROJECT_ID` environment variable.
221
+
222
+ #### `-y, --yes`
223
+
224
+ Auto-accept defaults without confirmation prompts.
225
+
226
+ #### `-c, --config`
227
+
228
+ Path to the project config file. Defaults to `.mastra-project.json`.
229
+
230
+ #### `--skip-build`
231
+
232
+ Skip the build step and deploy the existing `.mastra/output` directory.
233
+
234
+ #### `--debug`
235
+
236
+ Enable debug logs during the build step.
237
+
238
+ ### CI/CD usage
239
+
240
+ Set `MASTRA_API_TOKEN`, `MASTRA_ORG_ID`, and `MASTRA_PROJECT_ID` as environment variables for headless deploys. Interactive prompts are skipped automatically when `MASTRA_API_TOKEN` is set.
241
+
242
+ ### `mastra studio deploy list`
243
+
244
+ Lists all projects with their latest deploy status and URL.
245
+
246
+ ### `mastra studio deploy status`
247
+
248
+ Shows the status of a specific deploy.
249
+
250
+ ```bash
251
+ mastra studio deploy status <deploy-id>
252
+ ```
253
+
254
+ #### `--watch, -w`
255
+
256
+ Poll for status changes until the deploy reaches a terminal state.
257
+
258
+ ### `mastra studio deploy logs`
259
+
260
+ Shows logs for a specific deploy.
261
+
262
+ ```bash
263
+ mastra studio deploy logs <deploy-id>
264
+ ```
265
+
266
+ #### `--follow, -f`
267
+
268
+ Stream logs in real time.
269
+
270
+ #### `--tail`
271
+
272
+ Number of recent log lines to show.
273
+
274
+ ### `mastra studio projects`
275
+
276
+ Lists all projects in the current organization.
277
+
278
+ ### `mastra studio projects create`
279
+
280
+ Creates a new project through an interactive prompt.
281
+
282
+ ## `mastra server deploy`
283
+
284
+ Builds and deploys your project to Server on Mastra platform. Works the same as [`mastra studio deploy`](#mastra-studio-deploy) with the same flags, arguments, and resolution logic.
285
+
286
+ ```bash
287
+ mastra server deploy [dir]
288
+ ```
289
+
290
+ ## `mastra server pause`
291
+
292
+ Pauses the running server instance for the linked project. Organization and project resolution work the same as [`mastra server deploy`](#mastra-server-deploy).
293
+
294
+ ```bash
295
+ mastra server pause
296
+ ```
297
+
298
+ ### Flags
299
+
300
+ #### `--org`
301
+
302
+ Organization ID. Can also be set via the `MASTRA_ORG_ID` environment variable.
303
+
304
+ #### `--project`
305
+
306
+ Project ID or slug when `MASTRA_PROJECT_ID` is not set. Slugs are resolved against projects in the current organization.
307
+
308
+ #### `-c, --config`
309
+
310
+ Path to the project config file. Defaults to `.mastra-project.json`.
311
+
312
+ Fails if the instance is not running.
313
+
314
+ ## `mastra server restart`
315
+
316
+ Restarts a paused or stopped server instance for the linked project. After the platform accepts the restart, the CLI resolves the deploy id (from the API response or by polling project and deploy metadata when the response omits an id), then streams build and deploy logs the same way as [`mastra server deploy`](#mastra-server-deploy) until the deploy reaches a terminal state.
317
+
318
+ ### Flags
319
+
320
+ Same flags as [`mastra server pause`](#mastra-server-pause): **`--org`**, **`--project`**, and **`-c` / `--config`**, with the same defaults and behavior.
321
+
322
+ ```bash
323
+ mastra server restart
324
+ ```
325
+
326
+ Fails if a deployment is still active for this project (running, building, deploying, etc.); that is a platform restriction so you cannot restart while another deploy is in progress.
327
+
328
+ ## `mastra server env`
329
+
330
+ Manages environment variables for the linked server deployment. Organization and project resolution work the same as [`mastra server deploy`](#mastra-server-deploy).
331
+
332
+ Every subcommand accepts `-c` / `--config` for the project config file path (defaults to `.mastra-project.json`).
333
+
334
+ ### `mastra server env list`
335
+
336
+ Lists all environment variables for the linked project. Values are partially masked in the output.
337
+
338
+ ### `mastra server env set`
339
+
340
+ Sets an environment variable. The CLI reads the current map, applies the change, and uploads the result.
341
+
342
+ ```bash
343
+ mastra server env set <key> <value>
344
+ ```
345
+
346
+ ### `mastra server env unset`
347
+
348
+ Removes an environment variable.
349
+
350
+ ```bash
351
+ mastra server env unset <key>
352
+ ```
353
+
354
+ ### `mastra server env import`
355
+
356
+ Imports variables from a file (for example a `.env` file) and merges them into the existing map. New values override keys that already exist on the server.
357
+
358
+ ```bash
359
+ mastra server env import <file>
360
+ ```
361
+
362
+ ### `mastra server env pull`
363
+
364
+ Downloads environment variables from the linked project and writes them to a local file. This is the inverse of [`mastra server env import`](#mastra-server-env-import).
365
+
366
+ ```bash
367
+ mastra server env pull [file]
368
+ ```
369
+
370
+ The file defaults to `.env` when no argument is given. All values are double-quoted and escaped for safe shell sourcing. Keys that aren't valid shell identifiers are skipped. The output file is created with restrictive permissions (`0600`) since it contains secrets.
371
+
372
+ #### `--project`
373
+
374
+ Project ID or slug. Overrides the linked project when `MASTRA_PROJECT_ID` isn't set.
375
+
376
+ #### CI usage
377
+
378
+ In a continuous-integration pipeline, authenticate with `MASTRA_API_TOKEN` and pull the environment before running your app:
379
+
380
+ ```bash
381
+ export MASTRA_API_TOKEN="..."
382
+ mastra server env pull .env.production --project my-project
383
+ ```
384
+
385
+ ## `mastra auth`
386
+
387
+ Manages authentication for Mastra platform. Credentials are stored in `~/.mastra/credentials.json`. You can also set the `MASTRA_API_TOKEN` environment variable as an alternative to interactive login.
388
+
389
+ ### `mastra auth login`
390
+
391
+ Opens a browser for login and stores the credentials locally.
392
+
393
+ ### `mastra auth logout`
394
+
395
+ Removes stored credentials. If `MASTRA_API_TOKEN` is still set in the environment, the CLI warns that it will continue to be used.
396
+
397
+ ### `mastra auth whoami`
398
+
399
+ Shows the current user email, user ID, and active organization.
400
+
401
+ ### `mastra auth orgs`
402
+
403
+ Lists all organizations with your role in each. The current organization is marked.
404
+
405
+ #### `mastra auth orgs switch`
406
+
407
+ Switches the active organization through an interactive prompt. Cannot be used when `MASTRA_API_TOKEN` or `MASTRA_ORG_ID` environment variables are set.
408
+
409
+ ### `mastra auth tokens`
410
+
411
+ Lists all API tokens with their last-used date.
412
+
413
+ #### `mastra auth tokens create`
414
+
415
+ Creates a new API token. The secret is displayed once and cannot be retrieved again.
416
+
417
+ ```bash
418
+ mastra auth tokens create <name>
419
+ ```
420
+
421
+ #### `mastra auth tokens revoke`
422
+
423
+ Revokes an API token.
424
+
425
+ ```bash
426
+ mastra auth tokens revoke <token-id>
427
+ ```
428
+
190
429
  ## `mastra lint`
191
430
 
192
431
  The `mastra lint` command validates the structure and code of your Mastra project to ensure it follows best practices and is error-free.
@@ -275,6 +514,470 @@ See the [Storage migration guide](https://mastra.ai/guides/migrations/upgrade-to
275
514
 
276
515
  It accepts [common flags](#common-flags).
277
516
 
517
+ ## `mastra api`
518
+
519
+ Calls a Mastra runtime server with JSON input and JSON output. Use it for local development servers, deployed Mastra Platform projects, or self-hosted Mastra servers.
520
+
521
+ ```bash
522
+ mastra api agent list --pretty
523
+ mastra api agent run weather-agent '{"messages":"What is the weather in London?"}'
524
+ mastra api tool execute get-weather '{"location":"San Francisco"}'
525
+ ```
526
+
527
+ Use `mastra api <resource> <action> --help` to see examples for a command.
528
+
529
+ ### Output
530
+
531
+ Success responses are written to `stdout` as JSON. Single-resource commands return:
532
+
533
+ ```json
534
+ { "data": {} }
535
+ ```
536
+
537
+ List commands return a `data` array and pagination metadata:
538
+
539
+ ```json
540
+ { "data": [], "page": { "total": 0, "page": 0, "perPage": 0, "hasMore": false } }
541
+ ```
542
+
543
+ Errors are written to `stderr` as JSON and return a non-zero exit code:
544
+
545
+ ```json
546
+ {
547
+ "error": {
548
+ "code": "SERVER_UNREACHABLE",
549
+ "message": "Could not connect to target server",
550
+ "details": {}
551
+ }
552
+ }
553
+ ```
554
+
555
+ ### Target resolution
556
+
557
+ The command resolves the target server in this order:
558
+
559
+ 1. `--url <url>` for an explicit remote or self-hosted server.
560
+ 2. `http://localhost:4111` for a local `mastra dev` server.
561
+ 3. `.mastra-project.json` for a Mastra Platform project.
562
+
563
+ Localhost requests do not send auth headers. Platform requests use the saved Mastra credentials or `MASTRA_API_TOKEN`. Explicit `--url` requests only send headers provided with `--header`.
564
+
565
+ ### Flags
566
+
567
+ #### `--url <url>`
568
+
569
+ Target a specific Mastra server URL.
570
+
571
+ ```bash
572
+ mastra api --url https://example.com agent list
573
+ ```
574
+
575
+ #### `--header <"Key: Value">`
576
+
577
+ Send a custom HTTP header. Repeat the flag to send multiple headers.
578
+
579
+ ```bash
580
+ mastra api --url https://example.com --header "Authorization: Bearer $TOKEN" agent list
581
+ ```
582
+
583
+ #### `--timeout <ms>`
584
+
585
+ Set the request timeout in milliseconds. Defaults to `30000`. Workflow run start and resume commands default to `120000`.
586
+
587
+ #### `--pretty`
588
+
589
+ Pretty-print JSON output. Defaults to `false`.
590
+
591
+ #### `--schema`
592
+
593
+ Print the CLI-oriented request schema for a command that accepts JSON input. The schema comes from the target server's route contracts and includes the command shape, positionals, examples, request schemas, and response shape.
594
+
595
+ `--schema` is available on leaf commands that accept JSON input. It is not available as a top-level `mastra api` flag.
596
+
597
+ ```bash
598
+ mastra api agent run --schema --pretty
599
+ mastra api tool execute --schema --pretty
600
+ ```
601
+
602
+ ### Input model
603
+
604
+ Commands that accept input take one inline JSON argument. Do not pass file paths or stdin.
605
+
606
+ ```bash
607
+ mastra api workflow run start data-pipeline '{"inputData":{"source":"s3://bucket/data.csv"}}'
608
+ ```
609
+
610
+ Use positional arguments for stable IDs and JSON for filters or payloads. For routes that require both query parameters and a request body, pass one JSON object. The CLI splits the input according to the server route schema.
611
+
612
+ ```bash
613
+ mastra api thread create '{"agentId":"weather-agent","resourceId":"user_123","threadId":"thread_abc123","title":"Support conversation"}'
614
+ ```
615
+
616
+ List commands accept `page` and `perPage` in the JSON input when the target route supports pagination:
617
+
618
+ ```bash
619
+ mastra api score list '{"page":0,"perPage":50}'
620
+ ```
621
+
622
+ ### Get command-specific help
623
+
624
+ Each `mastra api` leaf command includes command-specific examples in its help output. Use `--help` on the exact command you want to call:
625
+
626
+ ```bash
627
+ mastra api agent run --help
628
+ mastra api tool execute --help
629
+ mastra api memory current update --help
630
+ mastra api workflow run resume --help
631
+ ```
632
+
633
+ Use `--schema` on commands that accept JSON input to inspect the request shape returned by the target server:
634
+
635
+ ```bash
636
+ mastra api agent run --schema --pretty
637
+ mastra api thread create --schema --pretty
638
+ mastra api score create --schema --pretty
639
+ ```
640
+
641
+ Some commands have important runtime requirements. For example, `mastra api memory current update` requires working memory to be enabled for the memory instance, and `mastra api workflow run resume` only works for suspended workflow runs.
642
+
643
+ ### Commands
644
+
645
+ #### `mastra api agent list`
646
+
647
+ Lists the agents registered on the target server. Pass optional JSON input for route-supported filters.
648
+
649
+ ```bash
650
+ mastra api agent list [input]
651
+ ```
652
+
653
+ #### `mastra api agent get`
654
+
655
+ Gets metadata for one registered agent.
656
+
657
+ ```bash
658
+ mastra api agent get <agentId>
659
+ ```
660
+
661
+ #### `mastra api agent run`
662
+
663
+ Runs an agent with JSON input. Use command help to see examples for text prompts, chat messages, and memory thread options.
664
+
665
+ ```bash
666
+ mastra api agent run <agentId> <input>
667
+ ```
668
+
669
+ #### `mastra api workflow list`
670
+
671
+ Lists workflows registered on the target server. Pass optional JSON input for route-supported filters.
672
+
673
+ ```bash
674
+ mastra api workflow list [input]
675
+ ```
676
+
677
+ #### `mastra api workflow get`
678
+
679
+ Gets metadata for one registered workflow.
680
+
681
+ ```bash
682
+ mastra api workflow get <workflowId>
683
+ ```
684
+
685
+ #### `mastra api workflow run start`
686
+
687
+ Starts a workflow run with JSON input. Workflow start commands use a longer default timeout than most commands because runs can take longer to complete.
688
+
689
+ ```bash
690
+ mastra api workflow run start <workflowId> <input>
691
+ ```
692
+
693
+ #### `mastra api workflow run list`
694
+
695
+ Lists runs for a workflow. Pass optional JSON input for route-supported filters or pagination.
696
+
697
+ ```bash
698
+ mastra api workflow run list <workflowId> [input]
699
+ ```
700
+
701
+ #### `mastra api workflow run get`
702
+
703
+ Gets one workflow run by ID.
704
+
705
+ ```bash
706
+ mastra api workflow run get <workflowId> <runId>
707
+ ```
708
+
709
+ #### `mastra api workflow run resume`
710
+
711
+ Resumes a suspended workflow run with JSON input. The run must be in a suspended state.
712
+
713
+ ```bash
714
+ mastra api workflow run resume <workflowId> <runId> <input>
715
+ ```
716
+
717
+ #### `mastra api workflow run cancel`
718
+
719
+ Cancels a workflow run.
720
+
721
+ ```bash
722
+ mastra api workflow run cancel <workflowId> <runId>
723
+ ```
724
+
725
+ #### `mastra api tool list`
726
+
727
+ Lists tools registered on the target server. Pass optional JSON input for route-supported filters.
728
+
729
+ ```bash
730
+ mastra api tool list [input]
731
+ ```
732
+
733
+ #### `mastra api tool get`
734
+
735
+ Gets metadata and schemas for one tool.
736
+
737
+ ```bash
738
+ mastra api tool get <toolId>
739
+ ```
740
+
741
+ #### `mastra api tool execute`
742
+
743
+ Executes a tool with JSON input. Raw tool input is wrapped as the route `data` field unless you pass an explicit `data` object.
744
+
745
+ ```bash
746
+ mastra api tool execute <toolId> <input>
747
+ ```
748
+
749
+ #### `mastra api mcp list`
750
+
751
+ Lists Model Context Protocol (MCP) servers registered on the target server. Pass optional JSON input for route-supported filters.
752
+
753
+ ```bash
754
+ mastra api mcp list [input]
755
+ ```
756
+
757
+ #### `mastra api mcp get`
758
+
759
+ Gets metadata for one MCP server.
760
+
761
+ ```bash
762
+ mastra api mcp get <id>
763
+ ```
764
+
765
+ #### `mastra api mcp tool list`
766
+
767
+ Lists tools exposed by an MCP server. Pass optional JSON input for route-supported filters.
768
+
769
+ ```bash
770
+ mastra api mcp tool list <serverId> [input]
771
+ ```
772
+
773
+ #### `mastra api mcp tool get`
774
+
775
+ Gets metadata and schemas for one MCP tool.
776
+
777
+ ```bash
778
+ mastra api mcp tool get <serverId> <toolId>
779
+ ```
780
+
781
+ #### `mastra api mcp tool execute`
782
+
783
+ Executes an MCP tool with JSON input. Raw tool input is wrapped as the route `data` field unless you pass an explicit `data` object.
784
+
785
+ ```bash
786
+ mastra api mcp tool execute <serverId> <toolId> <input>
787
+ ```
788
+
789
+ #### `mastra api thread list`
790
+
791
+ Lists memory threads. Pass optional JSON input for route-supported filters.
792
+
793
+ ```bash
794
+ mastra api thread list [input]
795
+ ```
796
+
797
+ #### `mastra api thread get`
798
+
799
+ Gets one memory thread by ID.
800
+
801
+ ```bash
802
+ mastra api thread get <threadId>
803
+ ```
804
+
805
+ #### `mastra api thread create`
806
+
807
+ Creates a memory thread. Pass one JSON input object; the CLI splits fields such as `agentId` into query parameters when required by the server route.
808
+
809
+ ```bash
810
+ mastra api thread create <input>
811
+ ```
812
+
813
+ #### `mastra api thread update`
814
+
815
+ Updates a memory thread. Pass one JSON input object for fields such as `agentId`, `resourceId`, `title`, or `metadata`.
816
+
817
+ ```bash
818
+ mastra api thread update <threadId> <input>
819
+ ```
820
+
821
+ #### `mastra api thread delete`
822
+
823
+ Deletes a memory thread. Pass JSON input for route-required query parameters such as `agentId` and `resourceId`.
824
+
825
+ ```bash
826
+ mastra api thread delete <threadId> <input>
827
+ ```
828
+
829
+ #### `mastra api thread messages`
830
+
831
+ Lists messages for a memory thread. Pass optional JSON input for route-supported filters or pagination.
832
+
833
+ ```bash
834
+ mastra api thread messages <threadId> [input]
835
+ ```
836
+
837
+ #### `mastra api memory search`
838
+
839
+ Searches long-term memory. Use `--help` or `--schema` to inspect required fields such as `agentId`, `resourceId`, and `searchQuery`.
840
+
841
+ ```bash
842
+ mastra api memory search <input>
843
+ ```
844
+
845
+ #### `mastra api memory current get`
846
+
847
+ Reads current working memory for a thread.
848
+
849
+ ```bash
850
+ mastra api memory current get <input>
851
+ ```
852
+
853
+ #### `mastra api memory current update`
854
+
855
+ Updates current working memory for a thread. Working memory must be enabled for the memory instance.
856
+
857
+ ```bash
858
+ mastra api memory current update <input>
859
+ ```
860
+
861
+ #### `mastra api memory status`
862
+
863
+ Gets memory status for an agent and optional thread or resource context.
864
+
865
+ ```bash
866
+ mastra api memory status <input>
867
+ ```
868
+
869
+ #### `mastra api trace list`
870
+
871
+ Lists observability traces. Pass optional JSON input for route-supported filters or pagination.
872
+
873
+ ```bash
874
+ mastra api trace list [input]
875
+ ```
876
+
877
+ #### `mastra api trace get`
878
+
879
+ Gets one observability trace by ID.
880
+
881
+ ```bash
882
+ mastra api trace get <traceId>
883
+ ```
884
+
885
+ #### `mastra api log list`
886
+
887
+ Lists observability logs. Pass optional JSON input for route-supported filters or pagination.
888
+
889
+ ```bash
890
+ mastra api log list [input]
891
+ ```
892
+
893
+ #### `mastra api score create`
894
+
895
+ Creates an observability score. The input uses the server score body shape; inspect it with `--schema`.
896
+
897
+ ```bash
898
+ mastra api score create <input>
899
+ ```
900
+
901
+ #### `mastra api score list`
902
+
903
+ Lists observability scores. Pass optional JSON input for filters such as run ID or pagination.
904
+
905
+ ```bash
906
+ mastra api score list [input]
907
+ ```
908
+
909
+ #### `mastra api score get`
910
+
911
+ Gets one observability score by ID.
912
+
913
+ ```bash
914
+ mastra api score get <scoreId>
915
+ ```
916
+
917
+ #### `mastra api dataset list`
918
+
919
+ Lists datasets. Pass optional JSON input for route-supported filters or pagination.
920
+
921
+ ```bash
922
+ mastra api dataset list [input]
923
+ ```
924
+
925
+ #### `mastra api dataset get`
926
+
927
+ Gets one dataset by ID.
928
+
929
+ ```bash
930
+ mastra api dataset get <datasetId>
931
+ ```
932
+
933
+ #### `mastra api dataset create`
934
+
935
+ Creates a dataset with JSON input.
936
+
937
+ ```bash
938
+ mastra api dataset create <input>
939
+ ```
940
+
941
+ #### `mastra api dataset items`
942
+
943
+ Lists items in a dataset. Pass optional JSON input for route-supported filters or pagination.
944
+
945
+ ```bash
946
+ mastra api dataset items <datasetId> [input]
947
+ ```
948
+
949
+ #### `mastra api experiment list`
950
+
951
+ Lists experiments for a dataset. Pass optional JSON input for route-supported filters or pagination.
952
+
953
+ ```bash
954
+ mastra api experiment list <datasetId> [input]
955
+ ```
956
+
957
+ #### `mastra api experiment get`
958
+
959
+ Gets one experiment by ID.
960
+
961
+ ```bash
962
+ mastra api experiment get <datasetId> <experimentId>
963
+ ```
964
+
965
+ #### `mastra api experiment run`
966
+
967
+ Starts an experiment for a dataset with JSON input.
968
+
969
+ ```bash
970
+ mastra api experiment run <datasetId> <input>
971
+ ```
972
+
973
+ #### `mastra api experiment results`
974
+
975
+ Lists results for an experiment. Pass optional JSON input for route-supported filters or pagination.
976
+
977
+ ```bash
978
+ mastra api experiment results <datasetId> <experimentId> [input]
979
+ ```
980
+
278
981
  ## Common flags
279
982
 
280
983
  ### `--dir`