@mastra/mcp-docs-server 0.0.0-studio-deploy-20260404184540 → 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 (281) 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/middleware.md +46 -42
  46. package/.docs/docs/server/request-context.md +13 -2
  47. package/.docs/docs/server/server-adapters.md +91 -8
  48. package/.docs/docs/streaming/background-task-streaming.md +80 -0
  49. package/.docs/docs/streaming/overview.md +3 -0
  50. package/.docs/docs/studio/deployment.md +24 -6
  51. package/.docs/docs/studio/observability.md +1 -1
  52. package/.docs/docs/studio/overview.md +4 -4
  53. package/.docs/docs/voice/overview.md +74 -5
  54. package/.docs/docs/voice/speech-to-speech.md +45 -1
  55. package/.docs/docs/voice/speech-to-text.md +7 -7
  56. package/.docs/docs/voice/text-to-speech.md +10 -10
  57. package/.docs/docs/workflows/agents-and-tools.md +1 -1
  58. package/.docs/docs/workflows/overview.md +105 -4
  59. package/.docs/docs/workflows/scheduled-workflows.md +181 -0
  60. package/.docs/docs/workspace/filesystem.md +64 -6
  61. package/.docs/docs/workspace/lsp.md +76 -4
  62. package/.docs/docs/workspace/overview.md +27 -8
  63. package/.docs/docs/workspace/sandbox.md +3 -1
  64. package/.docs/docs/workspace/search.md +41 -2
  65. package/.docs/docs/workspace/skills.md +19 -19
  66. package/.docs/guides/agent-frameworks/ai-sdk.md +4 -4
  67. package/.docs/guides/build-your-ui/ai-sdk-ui.md +56 -9
  68. package/.docs/guides/build-your-ui/assistant-ui.md +1 -1
  69. package/.docs/guides/deployment/mastra-platform.md +191 -0
  70. package/.docs/guides/deployment/netlify.md +16 -1
  71. package/.docs/guides/getting-started/nestjs.md +238 -0
  72. package/.docs/guides/getting-started/next-js.md +0 -4
  73. package/.docs/guides/guide/code-review-bot.md +2 -2
  74. package/.docs/guides/guide/dev-assistant.md +4 -4
  75. package/.docs/{docs/mcp → guides/guide}/publishing-mcp-server.md +21 -1
  76. package/.docs/guides/guide/slack-assistant.md +191 -0
  77. package/.docs/guides/migrations/mastra-cloud.md +368 -0
  78. package/.docs/guides/migrations/upgrade-to-v1/tracing.md +1 -1
  79. package/.docs/models/embeddings.md +3 -3
  80. package/.docs/models/gateways/azure-openai.md +74 -35
  81. package/.docs/models/gateways/mastra.md +64 -0
  82. package/.docs/models/gateways/netlify.md +7 -3
  83. package/.docs/models/gateways/openrouter.md +28 -12
  84. package/.docs/models/gateways/vercel.md +16 -1
  85. package/.docs/models/gateways.md +1 -0
  86. package/.docs/models/index.md +43 -8
  87. package/.docs/models/providers/302ai.md +37 -4
  88. package/.docs/models/providers/abliteration-ai.md +71 -0
  89. package/.docs/models/providers/alibaba-cn.md +7 -2
  90. package/.docs/models/providers/alibaba-coding-plan-cn.md +3 -2
  91. package/.docs/models/providers/alibaba-coding-plan.md +3 -2
  92. package/.docs/models/providers/alibaba.md +8 -1
  93. package/.docs/models/providers/anthropic.md +18 -5
  94. package/.docs/models/providers/baseten.md +3 -1
  95. package/.docs/models/providers/berget.md +10 -12
  96. package/.docs/models/providers/chutes.md +4 -2
  97. package/.docs/models/providers/cloudflare-workers-ai.md +14 -48
  98. package/.docs/models/providers/cortecs.md +22 -2
  99. package/.docs/models/providers/deepinfra.md +8 -2
  100. package/.docs/models/providers/deepseek.md +6 -4
  101. package/.docs/models/providers/digitalocean.md +133 -0
  102. package/.docs/models/providers/fireworks-ai.md +6 -1
  103. package/.docs/models/providers/firmware.md +12 -10
  104. package/.docs/models/providers/friendli.md +6 -7
  105. package/.docs/models/providers/google.md +8 -4
  106. package/.docs/models/providers/helicone.md +1 -2
  107. package/.docs/models/providers/hpc-ai.md +73 -0
  108. package/.docs/models/providers/huggingface.md +6 -2
  109. package/.docs/models/providers/inception.md +9 -11
  110. package/.docs/models/providers/kilo.md +359 -339
  111. package/.docs/models/providers/kimi-for-coding.md +2 -1
  112. package/.docs/models/providers/llmgateway.md +67 -77
  113. package/.docs/models/providers/mistral.md +3 -2
  114. package/.docs/models/providers/mixlayer.md +75 -0
  115. package/.docs/models/providers/moonshotai-cn.md +3 -2
  116. package/.docs/models/providers/moonshotai.md +3 -2
  117. package/.docs/models/providers/nano-gpt.md +8 -2
  118. package/.docs/models/providers/neuralwatt.md +84 -0
  119. package/.docs/models/providers/novita-ai.md +19 -4
  120. package/.docs/models/providers/nvidia.md +8 -1
  121. package/.docs/models/providers/ollama-cloud.md +7 -2
  122. package/.docs/models/providers/openai.md +7 -2
  123. package/.docs/models/providers/opencode-go.md +21 -13
  124. package/.docs/models/providers/opencode.md +11 -4
  125. package/.docs/models/providers/ovhcloud.md +6 -8
  126. package/.docs/models/providers/poe.md +10 -15
  127. package/.docs/models/providers/regolo-ai.md +83 -0
  128. package/.docs/models/providers/siliconflow-cn.md +5 -2
  129. package/.docs/models/providers/siliconflow.md +6 -3
  130. package/.docs/models/providers/stepfun.md +8 -7
  131. package/.docs/models/providers/synthetic.md +5 -2
  132. package/.docs/models/providers/tencent-token-plan.md +71 -0
  133. package/.docs/models/providers/tencent-tokenhub.md +71 -0
  134. package/.docs/models/providers/togetherai.md +8 -7
  135. package/.docs/models/providers/vivgrid.md +7 -3
  136. package/.docs/models/providers/vultr.md +7 -6
  137. package/.docs/models/providers/wafer.ai.md +73 -0
  138. package/.docs/models/providers/wandb.md +3 -2
  139. package/.docs/models/providers/xai.md +6 -1
  140. package/.docs/models/providers/xiaomi-token-plan-ams.md +9 -7
  141. package/.docs/models/providers/xiaomi-token-plan-cn.md +9 -7
  142. package/.docs/models/providers/xiaomi-token-plan-sgp.md +9 -7
  143. package/.docs/models/providers/xiaomi.md +4 -2
  144. package/.docs/models/providers/zai-coding-plan.md +11 -19
  145. package/.docs/models/providers/zai.md +2 -1
  146. package/.docs/models/providers/zenmux.md +13 -5
  147. package/.docs/models/providers/zhipuai-coding-plan.md +11 -21
  148. package/.docs/models/providers/zhipuai.md +2 -1
  149. package/.docs/models/providers.md +8 -0
  150. package/.docs/reference/agents/agent.md +1 -1
  151. package/.docs/reference/agents/channels.md +3 -3
  152. package/.docs/reference/agents/generate.md +88 -6
  153. package/.docs/reference/agents/generateLegacy.md +1 -1
  154. package/.docs/reference/ai-sdk/chat-route.md +2 -0
  155. package/.docs/reference/ai-sdk/handle-chat-stream.md +19 -0
  156. package/.docs/reference/ai-sdk/handle-network-stream.md +2 -0
  157. package/.docs/reference/ai-sdk/network-route.md +2 -0
  158. package/.docs/reference/ai-sdk/to-ai-sdk-messages.md +95 -0
  159. package/.docs/reference/ai-sdk/to-ai-sdk-stream.md +15 -0
  160. package/.docs/reference/browser/agent-browser.md +375 -0
  161. package/.docs/reference/browser/browser-viewer.md +228 -0
  162. package/.docs/reference/browser/mastra-browser.md +286 -0
  163. package/.docs/reference/browser/stagehand-browser.md +286 -0
  164. package/.docs/reference/cli/mastra.md +703 -0
  165. package/.docs/reference/client-js/agents.md +166 -0
  166. package/.docs/reference/client-js/mastra-client.md +23 -0
  167. package/.docs/reference/client-js/observability.md +2 -2
  168. package/.docs/reference/client-js/workflows.md +62 -1
  169. package/.docs/reference/configuration.md +67 -1
  170. package/.docs/reference/core/addGateway.md +5 -5
  171. package/.docs/reference/core/getEditor.md +35 -0
  172. package/.docs/reference/core/getGateway.md +5 -5
  173. package/.docs/reference/core/getGatewayById.md +5 -5
  174. package/.docs/reference/core/getMCPServer.md +2 -2
  175. package/.docs/reference/core/getMCPServerById.md +2 -2
  176. package/.docs/reference/core/getScorer.md +3 -3
  177. package/.docs/reference/core/getScorerById.md +3 -3
  178. package/.docs/reference/core/listGateways.md +5 -5
  179. package/.docs/reference/core/listMCPServers.md +2 -2
  180. package/.docs/reference/core/listScorers.md +3 -3
  181. package/.docs/reference/core/mastra-class.md +11 -1
  182. package/.docs/reference/core/mastra-model-gateway.md +5 -5
  183. package/.docs/reference/datasets/create.md +4 -4
  184. package/.docs/reference/datasets/startExperiment.md +28 -2
  185. package/.docs/reference/datasets/update.md +4 -4
  186. package/.docs/reference/deployer/cloudflare.md +14 -1
  187. package/.docs/reference/deployer/netlify.md +50 -2
  188. package/.docs/reference/editor/mastra-editor.md +168 -0
  189. package/.docs/reference/editor/tool-provider.md +85 -0
  190. package/.docs/reference/evals/context-precision.md +3 -3
  191. package/.docs/reference/evals/context-relevance.md +3 -3
  192. package/.docs/reference/evals/create-scorer.md +5 -3
  193. package/.docs/reference/evals/filter-run.md +117 -0
  194. package/.docs/reference/evals/mastra-scorer.md +4 -4
  195. package/.docs/reference/evals/noise-sensitivity.md +6 -6
  196. package/.docs/reference/evals/prompt-alignment.md +12 -12
  197. package/.docs/reference/evals/run-evals.md +6 -6
  198. package/.docs/reference/evals/scorer-utils.md +3 -3
  199. package/.docs/reference/evals/trajectory-accuracy.md +3 -3
  200. package/.docs/reference/harness/harness-class.md +152 -53
  201. package/.docs/reference/index.md +25 -0
  202. package/.docs/reference/logging/pino-logger.md +0 -2
  203. package/.docs/reference/mastra-platform/api.md +108 -0
  204. package/.docs/reference/memory/clone-utilities.md +4 -2
  205. package/.docs/reference/memory/cloneThread.md +4 -2
  206. package/.docs/reference/memory/observational-memory.md +4 -0
  207. package/.docs/reference/observability/metrics/automatic-metrics.md +3 -3
  208. package/.docs/reference/observability/tracing/bridges/datadog.md +211 -0
  209. package/.docs/reference/observability/tracing/bridges/otel.md +3 -3
  210. package/.docs/reference/observability/tracing/configuration.md +18 -11
  211. package/.docs/reference/observability/tracing/exporters/arthur.md +122 -0
  212. package/.docs/reference/observability/tracing/exporters/cloud-exporter.md +102 -21
  213. package/.docs/reference/observability/tracing/exporters/console-exporter.md +8 -8
  214. package/.docs/reference/observability/tracing/exporters/datadog.md +3 -1
  215. package/.docs/reference/observability/tracing/exporters/default-exporter.md +8 -8
  216. package/.docs/reference/observability/tracing/exporters/langfuse.md +25 -32
  217. package/.docs/reference/observability/tracing/exporters/otel.md +3 -3
  218. package/.docs/reference/observability/tracing/instances.md +7 -7
  219. package/.docs/reference/observability/tracing/interfaces.md +23 -6
  220. package/.docs/reference/observability/tracing/span-filtering.md +95 -0
  221. package/.docs/reference/observability/tracing/spans.md +6 -6
  222. package/.docs/reference/processors/prefill-error-handler.md +70 -0
  223. package/.docs/reference/processors/processor-interface.md +400 -40
  224. package/.docs/reference/processors/skill-search-processor.md +20 -1
  225. package/.docs/reference/processors/stream-error-retry-processor.md +54 -0
  226. package/.docs/reference/processors/tool-call-filter.md +23 -0
  227. package/.docs/reference/server/create-route.md +3 -3
  228. package/.docs/reference/server/express-adapter.md +4 -4
  229. package/.docs/reference/server/fastify-adapter.md +4 -4
  230. package/.docs/reference/server/hono-adapter.md +4 -4
  231. package/.docs/reference/server/koa-adapter.md +4 -4
  232. package/.docs/reference/server/mastra-server.md +3 -3
  233. package/.docs/reference/server/nestjs-adapter.md +169 -0
  234. package/.docs/reference/server/register-api-route.md +4 -4
  235. package/.docs/reference/server/routes.md +11 -10
  236. package/.docs/reference/storage/clickhouse.md +300 -0
  237. package/.docs/reference/storage/cloudflare-d1.md +42 -42
  238. package/.docs/reference/storage/composite.md +5 -3
  239. package/.docs/reference/storage/duckdb.md +150 -0
  240. package/.docs/reference/storage/overview.md +1 -1
  241. package/.docs/reference/storage/redis.md +266 -0
  242. package/.docs/reference/streaming/ChunkType.md +143 -3
  243. package/.docs/reference/streaming/agents/MastraModelOutput.md +2 -2
  244. package/.docs/reference/streaming/agents/stream.md +10 -2
  245. package/.docs/reference/streaming/agents/streamUntilIdle.md +94 -0
  246. package/.docs/reference/streaming/workflows/resumeStream.md +2 -0
  247. package/.docs/reference/templates/overview.md +88 -14
  248. package/.docs/reference/tools/create-tool.md +107 -5
  249. package/.docs/reference/tools/mcp-client.md +45 -0
  250. package/.docs/reference/tools/mcp-server.md +1 -3
  251. package/.docs/reference/tools/perplexity.md +155 -0
  252. package/.docs/reference/tools/tavily.md +307 -0
  253. package/.docs/reference/vectors/mongodb.md +0 -2
  254. package/.docs/reference/voice/aws-nova-sonic.md +247 -0
  255. package/.docs/reference/voice/cloudflare.md +3 -3
  256. package/.docs/reference/voice/sarvam.md +29 -23
  257. package/.docs/reference/voice/voice.connect.md +4 -4
  258. package/.docs/reference/voice/voice.listen.md +3 -3
  259. package/.docs/reference/workflows/run-methods/resume.md +24 -0
  260. package/.docs/reference/workflows/run-methods/startAsync.md +1 -1
  261. package/.docs/reference/workflows/step.md +88 -7
  262. package/.docs/reference/workflows/workflow-methods/foreach.md +14 -1
  263. package/.docs/reference/workflows/workflow.md +88 -4
  264. package/.docs/reference/workspace/azure-blob-filesystem.md +219 -0
  265. package/.docs/reference/workspace/docker-sandbox.md +196 -0
  266. package/.docs/reference/workspace/gcs-filesystem.md +1 -0
  267. package/.docs/reference/workspace/google-drive-filesystem.md +185 -0
  268. package/.docs/reference/workspace/modal-sandbox.md +168 -0
  269. package/.docs/reference/workspace/process-manager.md +1 -1
  270. package/.docs/reference/workspace/s3-filesystem.md +80 -5
  271. package/.docs/reference/workspace/vercel.md +1 -1
  272. package/.docs/reference/workspace/workspace-class.md +37 -6
  273. package/CHANGELOG.md +486 -4
  274. package/dist/stdio.js.map +1 -1
  275. package/dist/utils.d.ts +1 -4
  276. package/dist/utils.d.ts.map +1 -1
  277. package/package.json +11 -11
  278. package/.docs/docs/mastra-cloud/deployment.md +0 -77
  279. package/.docs/docs/mastra-cloud/observability.md +0 -38
  280. package/.docs/docs/mastra-cloud/overview.md +0 -23
  281. package/.docs/docs/mastra-cloud/setup.md +0 -42
@@ -116,7 +116,7 @@ NODE_OPTIONS="--max-old-space-size=4096" mastra build
116
116
 
117
117
  ## Related
118
118
 
119
- - [Server Overview](https://mastra.ai/docs/server/mastra-server) - Configure server behavior, middleware, and authentication
120
- - [Server Adapters](https://mastra.ai/docs/server/server-adapters) - Use Express or Hono instead of `mastra build`
121
- - [Custom API Routes](https://mastra.ai/docs/server/custom-api-routes) - Add custom HTTP endpoints
122
- - [Configuration Reference](https://mastra.ai/reference/configuration) - Full configuration options
119
+ - [Server Overview](https://mastra.ai/docs/server/mastra-server): Configure server behavior, middleware, and authentication
120
+ - [Server Adapters](https://mastra.ai/docs/server/server-adapters): Use Express or Hono instead of `mastra build`
121
+ - [Custom API Routes](https://mastra.ai/docs/server/custom-api-routes): Add custom HTTP endpoints
122
+ - [Configuration Reference](https://mastra.ai/reference/configuration): Full configuration options
@@ -131,6 +131,6 @@ If you see type errors from uncompiled workspace packages, either:
131
131
 
132
132
  ## Related
133
133
 
134
- - [Deploy a Mastra Server](https://mastra.ai/docs/deployment/mastra-server) - Core build and deployment guide
135
- - [Configuration Reference](https://mastra.ai/reference/configuration) - `bundler.transpilePackages` and other options
136
- - [CLI Reference](https://mastra.ai/reference/cli/mastra) - Build command flags
134
+ - [Deploy a Mastra Server](https://mastra.ai/docs/deployment/mastra-server): Core build and deployment guide
135
+ - [Configuration Reference](https://mastra.ai/reference/configuration): `bundler.transpilePackages` and other options
136
+ - [CLI Reference](https://mastra.ai/reference/cli/mastra): Build command flags
@@ -1,6 +1,6 @@
1
1
  # Deployment overview
2
2
 
3
- Mastra applications can be deployed to any Node.js-compatible environment. You can deploy a Mastra server, integrate with an existing web framework, deploy to cloud providers, or use Mastra Cloud for managed hosting.
3
+ Mastra applications can be deployed to any Node.js-compatible environment. You can deploy a Mastra server, integrate with an existing web framework, deploy to cloud providers, or use [Mastra platform](https://mastra.ai/docs/mastra-platform/overview) for Studio and server deployment.
4
4
 
5
5
  ## Runtime support
6
6
 
@@ -13,7 +13,7 @@ Mastra can run against any of these runtime environments:
13
13
 
14
14
  ## Deployment options
15
15
 
16
- ### Mastra Server
16
+ ### Mastra server
17
17
 
18
18
  Mastra provides a [server](https://mastra.ai/docs/server/mastra-server) powered by Hono that can be deployed independently. Use the `mastra build` command to build your application and deploy the output to your preferred VM, container, or PaaS platform.
19
19
 
@@ -25,6 +25,15 @@ Deploy a Mastra server as part of a monorepo setup, following the same approach
25
25
 
26
26
  Read about [monorepo deployment](https://mastra.ai/docs/deployment/monorepo).
27
27
 
28
+ ### Mastra platform
29
+
30
+ The [Mastra platform](https://mastra.ai/docs/mastra-platform/overview) provides two products for deploying and managing AI applications built with the Mastra framework:
31
+
32
+ - **Studio**: A hosted visual environment for testing agents, running workflows, and inspecting traces
33
+ - **Server**: A production deployment target that runs your Mastra application as an API server
34
+
35
+ Learn more in the [Studio deployment guide](https://mastra.ai/docs/studio/deployment) and [Server deployment guide](https://mastra.ai/guides/deployment/mastra-platform).
36
+
28
37
  ### Cloud Providers
29
38
 
30
39
  Mastra applications can be deployed to cloud providers and serverless platforms. Mastra includes optional built-in deployers for Vercel, Netlify, and Cloudflare to automate the build and deployment process.
@@ -49,12 +58,6 @@ Use these guides when adding Mastra to an existing Next.js or Astro application.
49
58
  - [With Astro on Vercel](https://mastra.ai/docs/deployment/web-framework)
50
59
  - [With Astro on Netlify](https://mastra.ai/docs/deployment/web-framework)
51
60
 
52
- ### Mastra Cloud
53
-
54
- We're building Mastra Cloud to be the easiest place to deploy and observe your Mastra agents. It's currently in beta.
55
-
56
- Learn more in the [Mastra Cloud docs](https://mastra.ai/docs/mastra-cloud/overview).
57
-
58
61
  ## Workflow runners
59
62
 
60
63
  Mastra workflows run using the built-in execution engine by default. For production workloads requiring managed infrastructure, workflows can also be deployed to specialized platforms like [Inngest](https://www.inngest.com) that provide step memoization, automatic retries, and real-time monitoring.
@@ -0,0 +1,290 @@
1
+ # Editor overview
2
+
3
+ The editor is a CMS-style system that separates agent configuration from code. Subject-matter experts, prompt engineers, and product teams can iterate on agents directly while developers keep the codebase stable.
4
+
5
+ The editor manages two types of resources alongside agents:
6
+
7
+ - [**Prompts**](https://mastra.ai/docs/editor/prompts): Reusable, versioned instruction templates with template variables and display conditions.
8
+ - [**Tools**](https://mastra.ai/docs/editor/tools): Add tools from integration providers, MCP servers, and override tool descriptions at runtime.
9
+
10
+ ## When to use the editor
11
+
12
+ Use the editor when you want to:
13
+
14
+ - **Let non-developers iterate**: Give subject-matter experts and prompt engineers a way to tune agent behavior without touching code or waiting for deploys.
15
+ - **Version everything**: Every save creates a snapshot so you can compare changes, roll back instantly, and audit what changed and when.
16
+ - **Run experiments**: Route different users or requests to different agent versions for A/B testing, canary rollouts, or prompt experimentation.
17
+ - **Target specific versions**: Pin a version per request, per user, or per environment so production stays stable while new versions are tested.
18
+ - **Manage tools at runtime**: Add integration tools from Composio or Arcade, or connect MCP servers, without updating code.
19
+ - **Override code agents**: Change the instructions, tools, or variables of a code-defined agent while keeping the original code as the baseline.
20
+
21
+ For building agents entirely in code, see the [Agents overview](https://mastra.ai/docs/agents/overview).
22
+
23
+ ## Quickstart
24
+
25
+ Add `@mastra/editor` to your project:
26
+
27
+ **npm**:
28
+
29
+ ```bash
30
+ npm install @mastra/editor
31
+ ```
32
+
33
+ **pnpm**:
34
+
35
+ ```bash
36
+ pnpm add @mastra/editor
37
+ ```
38
+
39
+ **Yarn**:
40
+
41
+ ```bash
42
+ yarn add @mastra/editor
43
+ ```
44
+
45
+ **Bun**:
46
+
47
+ ```bash
48
+ bun add @mastra/editor
49
+ ```
50
+
51
+ Pass a `MastraEditor` instance to your Mastra configuration with your existing agents:
52
+
53
+ ```typescript
54
+ import { Mastra } from '@mastra/core'
55
+ import { MastraEditor } from '@mastra/editor'
56
+
57
+ export const mastra = new Mastra({
58
+ agents: {
59
+ /* your existing agents */
60
+ },
61
+ editor: new MastraEditor(),
62
+ })
63
+ ```
64
+
65
+ Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK.
66
+
67
+ > **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
68
+
69
+ ## Studio
70
+
71
+ Go to the **Agents** tab in Studio and select an agent to edit. Select the **Editor** tab. You'll be taken to the editor interface, where you can modify the agent's instructions, tools, and variables.
72
+
73
+ Modify the system prompt and save a new draft version. Afterwards, publish the draft to make it the active version.
74
+
75
+ ## Programmatic control
76
+
77
+ Everything you can do in Studio is also available programmatically through [`mastra.getEditor()`](https://mastra.ai/reference/core/getEditor). This is useful for scripting bulk updates, seeding stored configurations from code, or building automation that tunes agents based on evaluation results.
78
+
79
+ Call `mastra.getEditor()` from anywhere you have access to the `Mastra` instance. It returns the `MastraEditor` instance you registered, with namespaces for each resource type:
80
+
81
+ ```typescript
82
+ import { mastra } from '../mastra'
83
+
84
+ const editor = mastra.getEditor()
85
+ if (!editor) throw new Error('Editor is not registered on Mastra')
86
+
87
+ // Create a stored agent override for an existing code-defined agent
88
+ await editor.agent.create({
89
+ id: 'support-agent',
90
+ instructions: 'You are a friendly support agent for Acme Inc.',
91
+ tools: {
92
+ search_kb: { description: 'Search the Acme knowledge base' },
93
+ },
94
+ })
95
+ ```
96
+
97
+ Use `editor.agent.update()` to change an existing stored configuration. Every update creates a new draft version automatically:
98
+
99
+ ```typescript
100
+ import { mastra } from '../mastra'
101
+
102
+ const editor = mastra.getEditor()!
103
+
104
+ await editor.agent.update({
105
+ id: 'support-agent',
106
+ instructions:
107
+ "You are a friendly support agent for Acme Inc. Always respond in the user's language.",
108
+ })
109
+ ```
110
+
111
+ The `editor.agent` namespace also exposes `getById`, `list`, `listResolved`, and `delete`. The `editor.prompt` namespace exposes the same CRUD methods for prompt blocks. See [Prompts](https://mastra.ai/docs/editor/prompts) for examples.
112
+
113
+ ### Server endpoints
114
+
115
+ The same operations are available over HTTP through the Mastra server. Use these when you want to manage stored agents from a separate service or from a non-TypeScript client:
116
+
117
+ | Method | Path | Description |
118
+ | -------- | ------------------------------- | ------------------------- |
119
+ | `GET` | `/stored/agents` | List all stored agents. |
120
+ | `POST` | `/stored/agents` | Create a stored agent. |
121
+ | `GET` | `/stored/agents/:storedAgentId` | Get a stored agent by ID. |
122
+ | `PATCH` | `/stored/agents/:storedAgentId` | Update a stored agent. |
123
+ | `DELETE` | `/stored/agents/:storedAgentId` | Delete a stored agent. |
124
+
125
+ The Client SDK wraps these endpoints with `client.listStoredAgents()`, `client.createStoredAgent()`, and `client.getStoredAgent()`. Version management endpoints live under `/stored/agents/:storedAgentId/versions`, see [version management](https://mastra.ai/reference/client-js/agents) for the full list.
126
+
127
+ ### Automated experimentation
128
+
129
+ Because stored agents are just data, you can build automation loops that tune agents without human involvement. A common pattern is to pair the editor API with [datasets](https://mastra.ai/docs/evals/datasets/overview) and [experiments](https://mastra.ai/docs/evals/datasets/running-experiments):
130
+
131
+ - Run a dataset through the current version of an agent and score the results.
132
+ - Have another agent read the failing cases and propose changes to the instructions or tools.
133
+ - Apply those changes with `editor.agent.update()` to create a new draft.
134
+ - Re-run the experiment against the draft and compare scores to the baseline.
135
+ - Promote the draft to the published version when the scores improve.
136
+
137
+ This turns agent tuning into a closed feedback loop. One agent owns the production configuration, another agent iterates on it, and every change is versioned so you can roll back if a round of automated edits makes things worse. Combine this with [version targeting](#version-targeting-and-experimentation) to keep production traffic on the published version while the draft is being tested.
138
+
139
+ > **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
140
+
141
+ ## What can be overridden
142
+
143
+ When you edit a code-defined agent through the editor, only specific fields can be changed:
144
+
145
+ | Field | Description |
146
+ | ------------ | ------------------------------------------------------------------------------------------------------------- |
147
+ | Instructions | Replace or extend the agent's system prompt using [prompt blocks](https://mastra.ai/docs/editor/prompts). |
148
+ | Tools | Add tools from the tool registry, integration providers, or MCP clients. Code-defined tools remain available. |
149
+
150
+ Fields like the agent's `id`, `name`, and `model` come from your code and can't be changed through the editor for code-defined agents. The variables are also read-only.
151
+
152
+ ## Versioning
153
+
154
+ Every time you save changes to an agent or prompt block, a new version snapshot is created. Versions give you a full history of your agent's configuration. You can roll back to any previous state, compare what changed between two snapshots, and target specific versions per request for A/B testing or gradual rollouts.
155
+
156
+ Version management is available through the server Studio, REST API, the Client SDK, and the React SDK. See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for endpoints, SDK methods, and code examples.
157
+
158
+ ### Version lifecycle
159
+
160
+ Each version has one of three statuses:
161
+
162
+ | Status | Description |
163
+ | --------- | ----------------------------------------------------------------------------------- |
164
+ | Draft | The latest working copy. Every save creates a new draft version. |
165
+ | Published | The active version used in production. Only one version can be published at a time. |
166
+ | Archived | A previous version that is no longer active. You can restore any archived version. |
167
+
168
+ The typical flow is: Edit the draft, test it, then activate it to make it the published version. The previously published version becomes archived so you can restore it if needed. You can do this through Studio or programmatically through the API.
169
+
170
+ This lifecycle makes it safe to experiment. Non-technical team members can iterate on a draft without affecting production traffic, then publish when ready. If something goes wrong, restoring a previous version is a single API call.
171
+
172
+ ### Version targeting and experimentation
173
+
174
+ Because every version has a unique ID, you can route different requests to different agent configurations. This opens up several patterns:
175
+
176
+ - **A/B testing**: Split traffic between two published versions and compare performance metrics.
177
+ - **Canary rollouts**: Send a small percentage of requests to a new version before promoting it.
178
+ - **Per-user targeting**: Pin specific users or accounts to a version while others use the default.
179
+ - **Environment separation**: Use the draft version in staging and the published version in production.
180
+
181
+ Pass a `versionId` or `status` when calling the agent through the Client SDK, server query parameters, or React SDK `requestContext`, and the correct version is loaded automatically.
182
+
183
+ ### Version selection
184
+
185
+ By default, [`mastra.getAgentById()`](https://mastra.ai/reference/core/getAgentById) loads the published (active) version of the stored override. You can request a specific version, which is useful for testing a draft before publishing, running A/B experiments, or pinning a user to a known-good configuration:
186
+
187
+ ```typescript
188
+ // Load the published version (default)
189
+ const agent = mastra.getAgentById('support-agent')
190
+
191
+ // Load the latest draft
192
+ const agent = mastra.getAgentById('support-agent', {
193
+ status: 'draft',
194
+ })
195
+
196
+ // Load a specific version
197
+ const agent = mastra.getAgentById('support-agent', {
198
+ versionId: 'abc-123',
199
+ })
200
+ ```
201
+
202
+ When calling the agent through the Mastra server, pass version parameters as query strings:
203
+
204
+ ```bash
205
+ # Published version (default)
206
+ curl http://localhost:4111/agents/support-agent
207
+
208
+ # Latest draft
209
+ curl http://localhost:4111/agents/support-agent?status=draft
210
+
211
+ # Specific version
212
+ curl http://localhost:4111/agents/support-agent?versionId=abc-123
213
+ ```
214
+
215
+ See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for API methods.
216
+
217
+ ### Sub-agent versioning
218
+
219
+ When a [supervisor agent](https://mastra.ai/docs/agents/supervisor-agents) delegates to sub-agents, version overrides determine which stored version of each sub-agent to use instead of the code-defined default. This lets you iterate on sub-agent prompts and tools through the editor without redeploying the supervisor.
220
+
221
+ Set version overrides at three levels, with later levels taking priority:
222
+
223
+ 1. **Mastra instance config** — global defaults that apply to every `generate()` and `stream()` call.
224
+ 2. **Per-invocation options** — overrides passed directly to `generate()` or `stream()`.
225
+ 3. **Server request body** — overrides sent in the `versions` field of an API request.
226
+
227
+ Resolution order: **per-invocation > request body > Mastra instance defaults > code-defined agent**.
228
+
229
+ #### Mastra instance config
230
+
231
+ Set global defaults when creating the `Mastra` instance. Every supervisor call inherits these overrides:
232
+
233
+ ```typescript
234
+ import { Mastra } from '@mastra/core'
235
+ import { MastraEditor } from '@mastra/editor'
236
+
237
+ export const mastra = new Mastra({
238
+ agents: { supervisor, researchAgent, writerAgent },
239
+ editor: new MastraEditor(),
240
+ versions: {
241
+ agents: {
242
+ 'research-agent': { status: 'published' },
243
+ 'writer-agent': { versionId: 'abc-123' },
244
+ },
245
+ },
246
+ })
247
+ ```
248
+
249
+ #### Per-invocation overrides
250
+
251
+ Override versions for a single call to `generate()` or `stream()`. These take priority over Mastra instance defaults:
252
+
253
+ ```typescript
254
+ const result = await supervisor.generate('Research and write an article about AI safety', {
255
+ versions: {
256
+ agents: {
257
+ 'research-agent': { versionId: 'draft-456' },
258
+ },
259
+ },
260
+ })
261
+ ```
262
+
263
+ #### Server request body
264
+
265
+ When calling agents through the Mastra server, pass version overrides in the request body:
266
+
267
+ ```bash
268
+ curl -X POST http://localhost:4111/agents/supervisor/generate \
269
+ -H "Content-Type: application/json" \
270
+ -d '{
271
+ "messages": [{ "role": "user", "content": "Research AI safety" }],
272
+ "versions": {
273
+ "agents": {
274
+ "research-agent": { "versionId": "draft-456" }
275
+ }
276
+ }
277
+ }'
278
+ ```
279
+
280
+ #### How propagation works
281
+
282
+ Version overrides propagate automatically through sub-agent delegation via `requestContext`. When a supervisor delegates to a sub-agent, the framework checks if a version override exists for that sub-agent's ID. If one is found, it resolves the stored version from the editor and uses it instead of the code-defined default.
283
+
284
+ If version resolution fails (for example, when the editor is not configured or the version ID doesn't exist), the framework logs a warning and falls back to the code-defined agent.
285
+
286
+ ## Next steps
287
+
288
+ - Set up [prompts](https://mastra.ai/docs/editor/prompts) to build reusable instruction templates.
289
+ - Add [tools](https://mastra.ai/docs/editor/tools) from integration providers and MCP servers.
290
+ - Explore the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
@@ -0,0 +1,134 @@
1
+ # Prompts
2
+
3
+ Prompt blocks are reusable instruction templates that you compose into an agent's system prompt. Each block can contain plain text, template variables, and display conditions. Non-technical team members can edit prompt content, test different phrasings, and publish changes. Every edit is versioned, so you can compare prompt variations, roll back, and track what changed over time. You can create and manage prompt blocks through the Studio UI or programmatically through the server API, then reference them across multiple agents.
4
+
5
+ ## Quickstart
6
+
7
+ 1. Go to the **Prompts** tab in Studio.
8
+ 2. Select **Create prompt** and enter a name and your instruction text.
9
+ 3. Save the prompt block and publish it.
10
+ 4. Open an agent's **Instructions** section and select **Add block**.
11
+ 5. Pick the saved prompt block from the block picker dialog.
12
+
13
+ The block appears as a reference in the agent's instruction list. Changes to the original prompt block update every agent that references it.
14
+
15
+ ## Block types
16
+
17
+ An agent's instructions are made up of an ordered list of blocks. Each block is one of three types:
18
+
19
+ | Type | Description |
20
+ | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
21
+ | Inline text | Free-form text written directly in the agent's instruction list. Lives only on that agent. |
22
+ | Prompt block | A standalone block with its own content, stored in the agent snapshot. You can save an inline block as a prompt block to reuse it. |
23
+ | Prompt block reference | A pointer to a saved prompt block. The content is resolved at runtime from the referenced block. |
24
+
25
+ To turn an inline block into a reusable prompt block, open the block's menu and select **Save as prompt block**. To reference an existing prompt block, select **Add block** and pick one from the dialog.
26
+
27
+ ## Template variables
28
+
29
+ Prompt blocks support `{{variable}}` syntax for dynamic content. Variables are resolved at runtime from the agent's variables and request context.
30
+
31
+ ```text
32
+ You are helping {{userName}} with their {{task || 'request'}}.
33
+ ```
34
+
35
+ | Syntax | Behavior |
36
+ | ----------------------------- | ------------------------------------------------------------------------------------------- |
37
+ | `{{variableName}}` | Replaced with the variable value. Left as-is if not found. |
38
+ | `{{nested.path.value}}` | Resolves dot-notation paths in the context object. |
39
+ | `{{variable \|\| 'default'}}` | Uses the fallback value when the variable is missing. Single or double quotes are accepted. |
40
+
41
+ Variables are passed through the agent's `variables` configuration or through [request context](https://mastra.ai/docs/server/request-context).
42
+
43
+ ## Display conditions
44
+
45
+ Each block can have a **display condition**. A rule group that controls whether the block is included in the final prompt. Conditions are evaluated at runtime against the agent's variables and request context.
46
+
47
+ A rule group uses **AND** or **OR** logic with one or more conditions. Each condition checks a context field against a value using an operator:
48
+
49
+ | Operator | Description |
50
+ | ---------------------------------------------- | ------------------------------------- |
51
+ | `equals` / `not_equals` | Exact match comparison. |
52
+ | `contains` / `not_contains` | String inclusion or array membership. |
53
+ | `greater_than` / `less_than` | Numeric comparison. |
54
+ | `greater_than_or_equal` / `less_than_or_equal` | Numeric comparison with equality. |
55
+ | `in` / `not_in` | Checks if a value is in an array. |
56
+ | `exists` / `not_exists` | Checks if the field is present. |
57
+
58
+ Rule groups can be nested, so you can combine AND and OR conditions for complex logic.
59
+
60
+ In the Studio, open a block's **Display conditions** panel to set up rules visually. You can also configure conditions programmatically through the API. Blocks without conditions are always included.
61
+
62
+ ## Programmatic control
63
+
64
+ Prompt blocks can be managed from code through [`mastra.getEditor().prompt`](https://mastra.ai/reference/editor/mastra-editor). This is useful for seeding a set of starter prompts, syncing blocks between environments, or generating prompt variants from a script.
65
+
66
+ Create a new prompt block with `editor.prompt.create()`:
67
+
68
+ ```typescript
69
+ import { mastra } from '../mastra'
70
+
71
+ const editor = mastra.getEditor()!
72
+
73
+ await editor.prompt.create({
74
+ id: 'brand-voice',
75
+ name: 'Brand voice',
76
+ description: 'Acme Inc. tone and style guidelines',
77
+ content:
78
+ 'You write in a friendly, concise tone. Always address the user as {{userName || "there"}}.',
79
+ })
80
+ ```
81
+
82
+ Update an existing block with `editor.prompt.update()`. Each update creates a new draft version:
83
+
84
+ ```typescript
85
+ import { mastra } from '../mastra'
86
+
87
+ const editor = mastra.getEditor()!
88
+
89
+ await editor.prompt.update({
90
+ id: 'brand-voice',
91
+ content: 'You write in a friendly, concise tone. Always greet the user by name when available.',
92
+ })
93
+ ```
94
+
95
+ Use `editor.prompt.list()` to paginate through stored blocks or `editor.prompt.getById()` to fetch a specific block. To preview an agent's full instructions with a set of prompt blocks applied, call `editor.prompt.preview()` with the draft content.
96
+
97
+ The same operations are available over HTTP through the Mastra server:
98
+
99
+ | Method | Path | Description |
100
+ | -------- | -------------------------------------------- | -------------------------------- |
101
+ | `GET` | `/stored/prompt-blocks` | List all stored prompt blocks. |
102
+ | `POST` | `/stored/prompt-blocks` | Create a stored prompt block. |
103
+ | `GET` | `/stored/prompt-blocks/:storedPromptBlockId` | Get a stored prompt block by ID. |
104
+ | `PATCH` | `/stored/prompt-blocks/:storedPromptBlockId` | Update a stored prompt block. |
105
+ | `DELETE` | `/stored/prompt-blocks/:storedPromptBlockId` | Delete a stored prompt block. |
106
+
107
+ Once a prompt block is created, reference it from an agent's `instructions` field as a `prompt_block_ref`:
108
+
109
+ ```typescript
110
+ import { mastra } from '../mastra'
111
+
112
+ const editor = mastra.getEditor()!
113
+
114
+ await editor.agent.update({
115
+ id: 'support-agent',
116
+ instructions: [
117
+ { type: 'prompt_block_ref', id: 'brand-voice' },
118
+ { type: 'text', content: 'Answer only questions about Acme products.' },
119
+ ],
120
+ })
121
+ ```
122
+
123
+ > **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full `editor.prompt` API.
124
+
125
+ ## Versioning
126
+
127
+ Prompt blocks follow the same [versioning lifecycle](https://mastra.ai/docs/editor/overview) as agents. Each prompt block has a draft that you can edit and publish as a versioned snapshot. This means prompt content can be versioned and rolled back independently from the agent that uses it.
128
+
129
+ When an agent references a prompt block, the resolved content comes from the block's active published version by default. During editing, draft content is used for previews. This separation makes it safe for non-technical team members to experiment with prompt wording. The published version stays stable until they explicitly activate a new one.
130
+
131
+ ## Related
132
+
133
+ - [Editor overview](https://mastra.ai/docs/editor/overview): Setup and versioning.
134
+ - [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor): Full configuration options for the editor.
@@ -0,0 +1,152 @@
1
+ # Tools
2
+
3
+ The editor gives you three ways to add tools to agents:
4
+
5
+ - **Code tools**: Tools already registered in your Mastra instance.
6
+ - **Integration providers**: Third-party tool platforms like Composio and Arcade.
7
+ - **MCP clients**: Tools from MCP servers, configured as reusable client definitions.
8
+
9
+ You can manage all three sources through the Studio UI or programmatically through the server API. Non-technical team members can browse tool catalogs, add tools to agents, and test different tool combinations without code changes. Tool configurations are versioned alongside the rest of the agent, so you can roll back tool changes, compare versions, and experiment safely.
10
+
11
+ ## Description overrides
12
+
13
+ Every tool, regardless of source, can have its description overridden at the agent level. This changes the description the agent sees during tool selection without modifying the original tool definition.
14
+
15
+ This is useful when you want to:
16
+
17
+ - Tailor a generic tool's purpose for a specific agent's context.
18
+ - Add instructions about when or how to use a tool.
19
+ - Clarify ambiguous tool descriptions.
20
+
21
+ In the Studio, select a tool in the agent's tool list and edit the **Description** field. The override applies only to that agent.
22
+
23
+ ## Display conditions
24
+
25
+ Each tool in an agent can have display conditions — rule groups that control whether the tool is available at runtime. This uses the same rule system as [prompt blocks](https://mastra.ai/docs/editor/prompts).
26
+
27
+ When a request comes in, the editor evaluates each tool's rules against the current context (agent variables and request context). Tools whose conditions are not met are excluded from that run.
28
+
29
+ Use display conditions to:
30
+
31
+ - Restrict expensive tools to specific users or roles.
32
+ - Enable tools based on feature flags or environment variables.
33
+ - Conditionally include tools based on the conversation context.
34
+
35
+ Tools without display conditions are always available.
36
+
37
+ ## Studio
38
+
39
+ Go to the **Agents** tab in Studio and select an agent to edit. Select the **Editor** tab. Scroll to the **Tools** section.
40
+
41
+ Here you are able to add tools and configure MCP clients.
42
+
43
+ Once you've made the changes, be sure to save the agent configuration.
44
+
45
+ ## Integration providers
46
+
47
+ Integration providers connect external tool platforms to the editor. Once registered, you can browse available tools in the Studio and add them to any agent.
48
+
49
+ ### Composio
50
+
51
+ [Composio](https://composio.dev) gives access to hundreds of integration tools organized into toolkits (GitHub, Slack, Gmail, and others).
52
+
53
+ 1. Get an API key from your Composio dashboard.
54
+
55
+ 2. Register the provider in your Editor configuration:
56
+
57
+ ```typescript
58
+ import { Mastra } from '@mastra/core'
59
+ import { MastraEditor } from '@mastra/editor'
60
+ import { ComposioToolProvider } from '@mastra/editor/composio'
61
+
62
+ export const mastra = new Mastra({
63
+ agents: {
64
+ /* your agents */
65
+ },
66
+ editor: new MastraEditor({
67
+ toolProviders: {
68
+ composio: new ComposioToolProvider({
69
+ apiKey: process.env.COMPOSIO_API_KEY!,
70
+ }),
71
+ },
72
+ }),
73
+ })
74
+ ```
75
+
76
+ Composio tool slugs use a format like `GITHUB_CREATE_ISSUE`. Tool calls are scoped to a `userId` passed through request context for per-user authentication.
77
+
78
+ ### Arcade
79
+
80
+ [Arcade](https://arcade.dev) provides a curated catalog of tools with built-in authentication handling.
81
+
82
+ 1. Get an API key from your Arcade dashboard.
83
+
84
+ 2. Register the provider in your Editor configuration:
85
+
86
+ ```typescript
87
+ import { Mastra } from '@mastra/core'
88
+ import { MastraEditor } from '@mastra/editor'
89
+ import { ArcadeToolProvider } from '@mastra/editor/arcade'
90
+
91
+ export const mastra = new Mastra({
92
+ agents: {
93
+ /* your agents */
94
+ },
95
+ editor: new MastraEditor({
96
+ toolProviders: {
97
+ arcade: new ArcadeToolProvider({
98
+ apiKey: process.env.ARCADE_API_KEY!,
99
+ }),
100
+ },
101
+ }),
102
+ })
103
+ ```
104
+
105
+ Arcade tools use a `Toolkit.ToolName` format (for example, `Github.GetRepository`). The provider pre-seeds common toolkits to reduce API calls during browsing.
106
+
107
+ ## MCP clients
108
+
109
+ The editor lets you create stored MCP client configurations that connect to MCP servers. Once created, you can reference these clients in any agent to give it access to the server's tools.
110
+
111
+ ### Transport types
112
+
113
+ Stored MCP clients support two transport types:
114
+
115
+ | Transport | Description |
116
+ | --------- | ----------------------------------------------------------------------------------------------------------------- |
117
+ | **stdio** | Launches a local process and communicates over standard I/O. Specify the `command` and optional `args` and `env`. |
118
+ | **HTTP** | Connects to a remote MCP server over HTTP. Specify the server `url` and optional `headers`. |
119
+
120
+ ### Tool filtering
121
+
122
+ You can filter MCP tools at two levels:
123
+
124
+ 1. **Client level**: On the MCP client itself, specify which tools from the server to include or exclude. This applies to every agent that references the client.
125
+ 2. **Agent level**: On the agent's MCP client reference, further limit which tools are available. This lets you use the same MCP client in multiple agents while exposing different tool subsets.
126
+
127
+ ### Tool namespacing
128
+
129
+ Tools from MCP servers are namespaced as `serverName_toolName` to avoid conflicts. For example, a tool called `search` from a server named `docs` becomes `docs_search`.
130
+
131
+ ### Conditional activation
132
+
133
+ MCP client references in an agent can have display conditions, just like [prompt blocks](https://mastra.ai/docs/editor/prompts). This lets you conditionally include MCP tools based on request context or agent variables.
134
+
135
+ ## How tools are merged
136
+
137
+ When an agent runs, tools from all sources are merged in this order:
138
+
139
+ 1. Code tools
140
+ 2. Integration tools
141
+ 3. MCP tools
142
+
143
+ If a tool ID exists in multiple sources, later sources take precedence. Description overrides set at the agent level always take priority over the original tool description.
144
+
145
+ > **Note:** See the [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider) for the full provider API.
146
+
147
+ ## Related
148
+
149
+ - [Editor overview](https://mastra.ai/docs/editor/overview): Setup and versioning.
150
+ - [Prompts](https://mastra.ai/docs/editor/prompts): Display conditions reference for prompt blocks.
151
+ - [ToolProvider reference](https://mastra.ai/reference/editor/tool-provider): Composio and Arcade API details.
152
+ - [MCP overview](https://mastra.ai/docs/mcp/overview): General MCP documentation.