@mastra/mcp-docs-server 1.2.13-alpha.9 → 1.2.13

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 (133) hide show
  1. package/.docs/docs/agents/overview.md +1 -1
  2. package/.docs/docs/agents/supervisor-agents.md +2 -2
  3. package/.docs/docs/agents/using-tools.md +29 -0
  4. package/.docs/docs/capabilities/channels/imessage.md +181 -0
  5. package/.docs/docs/capabilities/channels/overview.md +1 -0
  6. package/.docs/docs/{evals/datasets → datasets}/overview.md +3 -3
  7. package/.docs/docs/{evals/datasets → datasets}/running-experiments.md +59 -2
  8. package/.docs/docs/editor/overview.md +201 -206
  9. package/.docs/docs/evals/evals-with-memory.md +1 -1
  10. package/.docs/docs/getting-started/develop.md +196 -0
  11. package/.docs/docs/index.md +78 -1
  12. package/.docs/docs/mastra-platform/workspaces.md +13 -13
  13. package/.docs/docs/memory/observational-memory.md +23 -0
  14. package/.docs/docs/studio/observability.md +4 -0
  15. package/.docs/docs/studio/overview.md +2 -2
  16. package/.docs/docs/workspace/search.md +1 -1
  17. package/.docs/guides/getting-started/quickstart.md +3 -3
  18. package/.docs/{docs → guides}/rag/chunking-and-embedding.md +1 -1
  19. package/.docs/{docs → guides}/rag/graph-rag.md +1 -1
  20. package/.docs/{docs → guides}/rag/overview.md +2 -2
  21. package/.docs/{docs → guides}/rag/retrieval.md +1 -1
  22. package/.docs/{docs → guides}/voice/overview.md +4 -4
  23. package/.docs/{docs → guides}/voice/realtime-voice.md +2 -2
  24. package/.docs/{docs → guides}/voice/speech-to-speech.md +1 -1
  25. package/.docs/{docs → guides}/voice/speech-to-text.md +1 -1
  26. package/.docs/{docs → guides}/voice/text-to-speech.md +2 -2
  27. package/.docs/models/embeddings.md +63 -65
  28. package/.docs/models/environment-variables.md +5 -1
  29. package/.docs/models/gateways/netlify.md +1 -2
  30. package/.docs/models/gateways/openrouter.md +3 -1
  31. package/.docs/models/gateways/vercel.md +6 -1
  32. package/.docs/models/index.md +1 -1
  33. package/.docs/models/providers/alibaba-cn.md +3 -1
  34. package/.docs/models/providers/alibaba-token-plan-cn.md +27 -25
  35. package/.docs/models/providers/alibaba-token-plan.md +27 -25
  36. package/.docs/models/providers/alibaba.md +2 -1
  37. package/.docs/models/providers/ambient.md +13 -12
  38. package/.docs/models/providers/baseten.md +3 -1
  39. package/.docs/models/providers/chutes.md +6 -8
  40. package/.docs/models/providers/crof.md +2 -1
  41. package/.docs/models/providers/crossmodel.md +4 -1
  42. package/.docs/models/providers/deepinfra.md +9 -2
  43. package/.docs/models/providers/digitalocean.md +34 -27
  44. package/.docs/models/providers/empiriolabs.md +4 -1
  45. package/.docs/models/providers/fireworks-ai.md +20 -19
  46. package/.docs/models/providers/greenpt.md +17 -8
  47. package/.docs/models/providers/groq.md +20 -20
  48. package/.docs/models/providers/huggingface.md +3 -1
  49. package/.docs/models/providers/hyper.md +9 -7
  50. package/.docs/models/providers/impossibl.md +148 -0
  51. package/.docs/models/providers/infomaniak.md +83 -0
  52. package/.docs/models/providers/kilo.md +349 -350
  53. package/.docs/models/providers/llmgateway.md +3 -1
  54. package/.docs/models/providers/mistral.md +5 -2
  55. package/.docs/models/providers/modal.md +5 -4
  56. package/.docs/models/providers/modelis.md +81 -0
  57. package/.docs/models/providers/nano-gpt.md +146 -148
  58. package/.docs/models/providers/neuralwatt.md +2 -1
  59. package/.docs/models/providers/ofox.md +2 -2
  60. package/.docs/models/providers/ollama-cloud.md +23 -22
  61. package/.docs/models/providers/opencode-go.md +3 -2
  62. package/.docs/models/providers/requesty.md +54 -45
  63. package/.docs/models/providers/scx.md +74 -0
  64. package/.docs/models/providers/tensorx.md +97 -0
  65. package/.docs/models/providers/togetherai.md +2 -1
  66. package/.docs/models/providers/umans-ai-coding-plan.md +11 -9
  67. package/.docs/models/providers/umans-ai.md +11 -9
  68. package/.docs/models/providers/wandb.md +2 -2
  69. package/.docs/models/providers/zai-coding-plan.md +7 -7
  70. package/.docs/models/providers/zhipuai-coding-plan.md +9 -9
  71. package/.docs/models/providers.md +5 -1
  72. package/.docs/reference/agents/agent.md +1 -1
  73. package/.docs/reference/agents/generate.md +1 -1
  74. package/.docs/reference/agents/getVoice.md +1 -1
  75. package/.docs/{docs/getting-started → reference}/build-with-ai.md +5 -110
  76. package/.docs/reference/cli/create-mastra.md +2 -0
  77. package/.docs/reference/cli/mastra.md +66 -1
  78. package/.docs/reference/client-js/agents.md +1 -1
  79. package/.docs/reference/configuration.md +2 -2
  80. package/.docs/reference/core/getEditor.md +1 -1
  81. package/.docs/reference/core/getVector.md +2 -2
  82. package/.docs/reference/core/listVectors.md +2 -2
  83. package/.docs/reference/core/mastra-class.md +1 -1
  84. package/.docs/reference/datasets/startExperiment.md +6 -0
  85. package/.docs/reference/datasets/startExperimentAsync.md +4 -0
  86. package/.docs/reference/editor/browser-provider.md +2 -2
  87. package/.docs/reference/editor/filesystem-provider.md +1 -1
  88. package/.docs/reference/editor/mastra-editor.md +31 -18
  89. package/.docs/reference/editor/prompt-blocks.md +137 -0
  90. package/.docs/reference/editor/sandbox-provider.md +1 -1
  91. package/.docs/reference/editor/storage-browser-ref.md +3 -3
  92. package/.docs/reference/editor/storage-workspace-ref.md +3 -3
  93. package/.docs/reference/editor/tool-provider.md +44 -10
  94. package/.docs/reference/editor/tools.md +100 -0
  95. package/.docs/reference/editor/versioning.md +130 -0
  96. package/.docs/reference/evals/mastra-scorer.md +68 -8
  97. package/.docs/reference/file-based-agents/config.md +39 -1
  98. package/.docs/reference/index.md +3 -4
  99. package/.docs/reference/memory/observational-memory.md +3 -1
  100. package/.docs/reference/memory/serialized-memory-config.md +3 -3
  101. package/.docs/reference/observability/tracing/interfaces.md +3 -1
  102. package/.docs/reference/processors/token-limiter-processor.md +15 -1
  103. package/.docs/reference/project-structure.md +1 -1
  104. package/.docs/reference/rag/database-config.md +1 -1
  105. package/.docs/reference/storage/composite.md +2 -0
  106. package/.docs/reference/streaming/agents/stream.md +1 -1
  107. package/.docs/reference/voice/livekit.md +3 -3
  108. package/.docs/reference/workspace/platform-filesystem.md +3 -3
  109. package/.docs/reference/workspace/platform-sandbox.md +5 -5
  110. package/CHANGELOG.md +23 -0
  111. package/README.md +1 -1
  112. package/package.json +6 -6
  113. package/.docs/docs/agent-builder/access-control.md +0 -99
  114. package/.docs/docs/agent-builder/browser.md +0 -63
  115. package/.docs/docs/agent-builder/channels.md +0 -78
  116. package/.docs/docs/agent-builder/configuration.md +0 -132
  117. package/.docs/docs/agent-builder/deploying.md +0 -124
  118. package/.docs/docs/agent-builder/integrations.md +0 -115
  119. package/.docs/docs/agent-builder/memory.md +0 -69
  120. package/.docs/docs/agent-builder/model-policy.md +0 -50
  121. package/.docs/docs/agent-builder/overview.md +0 -114
  122. package/.docs/docs/agent-builder/skill-registries.md +0 -31
  123. package/.docs/docs/agent-builder/workspace.md +0 -62
  124. package/.docs/docs/editor/prompts.md +0 -140
  125. package/.docs/docs/editor/tools.md +0 -148
  126. package/.docs/docs/getting-started/file-based-agents.md +0 -121
  127. package/.docs/docs/what-is-mastra.md +0 -161
  128. package/.docs/reference/client-js/agent-builder.md +0 -163
  129. package/.docs/reference/editor/agent-builder/agent-builder-options.md +0 -76
  130. package/.docs/reference/editor/agent-builder/builder-agent-defaults.md +0 -79
  131. package/.docs/reference/editor/agent-builder/builder-models.md +0 -66
  132. /package/.docs/{docs → guides}/getting-started/manual-install.md +0 -0
  133. /package/.docs/{docs → guides}/rag/vector-databases.md +0 -0
@@ -1,354 +1,349 @@
1
1
  > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
2
 
3
- # Editor overview
3
+ # Editor
4
4
 
5
- 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.
5
+ Editor works like a CMS for Mastra agents. Collaborators can change an agent's instructions and tools in Studio without accessing the codebase or writing code. They can test changes before making them live.
6
6
 
7
- The editor manages two types of resources alongside agents:
7
+ TypeScript defines the agent's default values. Editor saves changes separately instead of updating the source code, so collaborators can improve the agent while developers retain control over its model, identity, and runtime.
8
8
 
9
- - [**Prompts**](https://mastra.ai/docs/editor/prompts): Reusable, versioned instruction templates with template variables and display conditions.
10
- - [**Tools**](https://mastra.ai/docs/editor/tools): Add tools from integration providers, MCP servers, and override tool descriptions at runtime.
9
+ A [deployed Studio](https://mastra.ai/docs/studio/deployment) makes Editor available to collaborators outside local development.
11
10
 
12
- ## When to use the editor
11
+ > **📹 Watch:** Watch the [Mastra Editor workshop](https://www.youtube.com/watch?v=XTjuRoI7t_k\&pp=ygUWbWFzdHJhIGVkaXRvciB3b3Jrc2hvcA%3D%3D) for a guided walkthrough.
13
12
 
14
- Use the editor when you want to:
13
+ ## When to use Editor
15
14
 
16
- - **Let non-developers iterate**: Give subject-matter experts and prompt engineers a way to tune agent behavior without touching code or waiting for deploys.
17
- - **Version everything**: Every save creates a snapshot so you can compare changes and roll back instantly, plus audit what changed and when.
18
- - **Run experiments**: Route different users or requests to different agent versions for A/B testing or canary rollouts, or alternatively prompt experimentation.
19
- - **Target specific versions**: Pin a version per request or per user, or alternatively per environment so production stays stable while new versions are tested.
20
- - **Manage tools at runtime**: Add integration tools from Composio or Arcade, or connect MCP servers, without updating code.
21
- - **Override code agents**: Change the instructions, tools, or variables of a code-defined agent while keeping the original code as the baseline.
22
-
23
- For building agents entirely in code, see the [Agents overview](https://mastra.ai/docs/agents/overview).
15
+ Use Editor when an agent is defined in code but the people responsible for its behavior shouldn't edit the codebase. It works well when instructions or tools change often and need testing before they reach users. If developers own every change and release agent configuration with the application, keep the [agent configuration in code](https://mastra.ai/docs/agents/overview) instead.
24
16
 
25
17
  ## Quickstart
26
18
 
27
- Add `@mastra/editor` to your project:
19
+ Install `@mastra/editor`. This quickstart uses LibSQL to store Editor changes:
28
20
 
29
21
  **npm**:
30
22
 
31
23
  ```bash
32
- npm install @mastra/editor
24
+ npm install @mastra/editor @mastra/libsql
33
25
  ```
34
26
 
35
27
  **pnpm**:
36
28
 
37
29
  ```bash
38
- pnpm add @mastra/editor
30
+ pnpm add @mastra/editor @mastra/libsql
39
31
  ```
40
32
 
41
33
  **Yarn**:
42
34
 
43
35
  ```bash
44
- yarn add @mastra/editor
36
+ yarn add @mastra/editor @mastra/libsql
45
37
  ```
46
38
 
47
39
  **Bun**:
48
40
 
49
41
  ```bash
50
- bun add @mastra/editor
42
+ bun add @mastra/editor @mastra/libsql
51
43
  ```
52
44
 
53
- Pass a `MastraEditor` instance to your Mastra configuration with your existing agents:
45
+ Add `MastraEditor` and storage to the `Mastra` instance. Existing storage can be reused instead of adding the LibSQL store shown here.
54
46
 
55
47
  ```typescript
56
48
  import { Mastra } from '@mastra/core'
57
49
  import { MastraEditor } from '@mastra/editor'
50
+ import { LibSQLStore } from '@mastra/libsql'
58
51
 
59
52
  export const mastra = new Mastra({
60
- agents: {/* your existing agents */},
53
+ agents: {/* existing agents */},
54
+ storage: new LibSQLStore({
55
+ id: 'mastra-storage',
56
+ url: 'file:./mastra.db',
57
+ }),
61
58
  editor: new MastraEditor(),
62
59
  })
63
60
  ```
64
61
 
65
- Once registered, you can manage agents through [Studio](https://mastra.ai/docs/studio/overview) or programmatically through the server API and Client SDK. See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
62
+ ## Use Editor in Studio
66
63
 
67
- ## Code and database sources
64
+ In [Studio](https://mastra.ai/docs/studio/overview), open **Agents**, select an agent, then select **Editor**. Collaborators can update the agent's instructions and tools based on its Editor permissions.
68
65
 
69
- The editor stores agent overrides in one of two sources, set with the `source` option on `MastraEditor`:
66
+ With database storage, save changes as a draft to test them without affecting the live agent. Publish the draft when it's ready to use.
70
67
 
71
- | Source | Where overrides live | Studio actions |
72
- | -------------- | --------------------------------------------------------- | -------------------------------------------------------- |
73
- | `db` (default) | The configured storage backend. | Save and publish drafts. |
74
- | `code` | Per-agent JSON files on disk, tracked in your repository. | Download the override file or save it to the filesystem. |
68
+ ## Instructions
75
69
 
76
- The default `db` source is best when non-developers iterate through Studio and you want versioning, drafts, and runtime version targeting. The `code` source is best when overrides should live in your repository alongside the rest of your code, reviewed through pull requests and deployed with your application.
70
+ The **Instructions** section shows the agent's system prompt defined in code. Collaborators can override it or add instruction blocks.
77
71
 
78
- To use the code source, set `source: 'code'`:
72
+ An instruction block can include values from the current request. For example, `{{userName}}` inserts a name supplied through [request context](https://mastra.ai/docs/server/request-context). A [display condition](https://mastra.ai/reference/editor/prompt-blocks) can show a block only for a customer, role, or feature flag.
79
73
 
80
- ```typescript
81
- import { Mastra } from '@mastra/core'
82
- import { MastraEditor } from '@mastra/editor'
83
-
84
- export const mastra = new Mastra({
85
- agents: {/* your existing agents */},
86
- editor: new MastraEditor({
87
- source: 'code',
88
- }),
89
- })
90
- ```
74
+ ### Prompt blocks
91
75
 
92
- When `source` is `'code'`, the editor writes each override to a deterministic JSON file under `./mastra/editor/agents/<agentId>.json`. Set `codePath` to change the directory. Because the files are deterministic, every save produces a clean diff you can commit and review.
76
+ A prompt block is a saved piece of instruction text that can be used by more than one agent. Create one under **Prompts**, publish it, then open an agent's **Instructions** section and select **Add block**.
93
77
 
94
- ### Versioning with the code source
78
+ For example, agents for support, returns, and order status may all need the same refund policy. Save the policy as a prompt block and add it to each agent. When the policy changes, update and publish the block once instead of editing three agents.
95
79
 
96
- The code source uses the Git history of each per-agent JSON file as its version history. Each commit that changes a file is shown as a read-only version in Studio, labeled with the commit message. Saving in Studio updates the working file in place rather than creating a database draft, so the version dropdown reflects your actual commit history.
80
+ When a prompt block changes, every agent that references its published version receives the update. Draft changes are used only while previewing, so they don't affect the live agents until the block is published.
97
81
 
98
- As a result, versions and rollbacks are managed through Git rather than through draft and publish actions.
82
+ See the [prompt blocks reference](https://mastra.ai/reference/editor/prompt-blocks) for template syntax, conditions, versions, and APIs.
99
83
 
100
- ## Studio
84
+ ## Tools
101
85
 
102
- 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.
86
+ Tools let an agent take actions. Collaborators choose from the tools available to Editor, but they can't implement new tools in Studio. How tools become available depends on their source:
103
87
 
104
- Modify the system prompt and save a new draft version. Afterwards, publish the draft to make it the active version.
88
+ - **Project tools** must be implemented and registered in the Mastra project by a developer.
89
+ - **Integration tools** become available after a developer registers a provider such as Composio or Arcade. Collaborators can then browse the provider's catalog and add tools without each tool being added in code first.
90
+ - **MCP tools** become available when an MCP client is configured. A collaborator with access can create the client in Studio, then choose from the tools exposed by its servers.
105
91
 
106
- ## Programmatic control
92
+ In the agent's **Tools** section, collaborators can add the tools it needs or rewrite a tool's description for that agent. A more specific description helps the agent understand when to use the tool without changing the tool itself.
107
93
 
108
- 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 or seeding stored configurations from code, or alternatively building automation that tunes agents based on evaluation results.
94
+ ### Project tools
109
95
 
110
- 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:
96
+ Developers can register a project tool on the `Mastra` instance to make it available in Editor:
111
97
 
112
98
  ```typescript
113
- import { mastra } from '../mastra'
114
-
115
- const editor = mastra.getEditor()
116
- if (!editor) throw new Error('Editor is not registered on Mastra')
99
+ import { Mastra } from '@mastra/core'
100
+ import { MastraEditor } from '@mastra/editor'
101
+ import { searchOrders } from './tools/search-orders'
117
102
 
118
- // Create a stored agent override for an existing code-defined agent
119
- await editor.agent.create({
120
- id: 'support-agent',
121
- instructions: 'You are a friendly support agent for Acme Inc.',
103
+ export const mastra = new Mastra({
122
104
  tools: {
123
- search_kb: { description: 'Search the Acme knowledge base' },
105
+ searchOrders,
124
106
  },
107
+ agents: {/* agents */},
108
+ editor: new MastraEditor(),
125
109
  })
126
110
  ```
127
111
 
128
- Use `editor.agent.update()` to change an existing stored configuration. Every update creates a new draft version automatically:
112
+ The Studio tool picker lists the tool. A collaborator can add it to an agent when that agent allows tool editing. The agent's Editor view also lists tools attached in code.
129
113
 
130
- ```typescript
131
- import { mastra } from '../mastra'
114
+ ### Composio
132
115
 
133
- const editor = mastra.getEditor()!
116
+ [Composio](https://composio.dev) provides tools for services such as GitHub, Slack, and Gmail. Register the provider with a Composio API key to make its tool catalog available in Editor:
134
117
 
135
- await editor.agent.update({
136
- id: 'support-agent',
137
- instructions:
138
- "You are a friendly support agent for Acme Inc. Always respond in the user's language.",
118
+ ```typescript
119
+ import { Mastra } from '@mastra/core'
120
+ import { MastraEditor } from '@mastra/editor'
121
+ import { ComposioToolProvider } from '@mastra/editor/composio'
122
+
123
+ export const mastra = new Mastra({
124
+ agents: {/* agents */},
125
+ editor: new MastraEditor({
126
+ toolProviders: {
127
+ composio: new ComposioToolProvider({
128
+ apiKey: process.env.COMPOSIO_API_KEY!,
129
+ }),
130
+ },
131
+ }),
139
132
  })
140
133
  ```
141
134
 
142
- 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.
143
-
144
- ### Server endpoints
145
-
146
- 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:
135
+ Composio tool IDs look like `GITHUB_CREATE_ISSUE`. By default, a selected tool uses the connection associated with the agent's author. See [connection scope](https://agent-builder.mastra.ai/tool-providers#connection-scope) to use each caller's connection instead.
147
136
 
148
- | Method | Path | Description |
149
- | -------- | ------------------------------------------ | ---------------------------------------------------------------- |
150
- | `GET` | `/stored/agents` | List all stored agents. |
151
- | `POST` | `/stored/agents` | Create a stored agent. |
152
- | `GET` | `/stored/agents/:storedAgentId` | Get a stored agent by ID. |
153
- | `PATCH` | `/stored/agents/:storedAgentId` | Update a stored agent. |
154
- | `DELETE` | `/stored/agents/:storedAgentId` | Delete a stored agent. |
155
- | `GET` | `/stored/agents/:storedAgentId/dependents` | List agents that reference this agent as a sub-agent. |
156
- | `POST` | `/stored/agents/:storedAgentId/export` | Export a stored agent's override as a deterministic JSON config. |
137
+ ### Arcade
157
138
 
158
- The dependents endpoint helps warn before deleting or unsharing an agent that other agents depend on: `dependents` lists caller-readable agents by `id` and `name`, while `hiddenCount` aggregates cross-workspace references the caller can't read (surfaced only when the target is public). The export endpoint returns only the fields the agent's [`editor` config](https://mastra.ai/reference/agents/agent) allows, so the output matches the per-agent file the code source writes to disk. The Client SDK wraps these endpoints with `client.listStoredAgents()`, `client.createStoredAgent()`, `client.getStoredAgent()`, `client.getStoredAgent(id).dependents()`, and `client.getStoredAgent(id).export()`. Version management endpoints live under `/stored/agents/:storedAgentId/versions`, see [version management](https://mastra.ai/reference/client-js/agents) for the full list.
139
+ [Arcade](https://arcade.dev) provides another catalog of tools with built-in authentication. Register it with an Arcade API key:
159
140
 
160
- ### Automated experimentation
161
-
162
- Because stored agents are 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):
141
+ ```typescript
142
+ import { Mastra } from '@mastra/core'
143
+ import { MastraEditor } from '@mastra/editor'
144
+ import { ArcadeToolProvider } from '@mastra/editor/arcade'
163
145
 
164
- - Run a dataset through the current version of an agent and score the results.
165
- - Have another agent read the failing cases and propose changes to the instructions or tools.
166
- - Apply those changes with `editor.agent.update()` to create a new draft.
167
- - Re-run the experiment against the draft and compare scores to the baseline.
168
- - Promote the draft to the published version when the scores improve.
146
+ export const mastra = new Mastra({
147
+ agents: {/* agents */},
148
+ editor: new MastraEditor({
149
+ toolProviders: {
150
+ arcade: new ArcadeToolProvider({
151
+ apiKey: process.env.ARCADE_API_KEY!,
152
+ }),
153
+ },
154
+ }),
155
+ })
156
+ ```
169
157
 
170
- This turns agent tuning into a closed feedback loop. One agent owns the production configuration and another agent iterates on it, plus 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. See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for the full namespace API.
158
+ Arcade tool IDs use `Toolkit.ToolName` format, such as `Github.GetRepository`.
171
159
 
172
- ## What can be overridden
160
+ ### MCP clients
173
161
 
174
- When you edit a code-defined agent through the editor, only specific fields can be changed:
162
+ Collaborators can also create a reusable MCP client in Studio and add its tools to an agent. Stored clients can start a local `stdio` server or connect to a remote HTTP server. Tool filters let each agent use only the tools it needs from that server.
175
163
 
176
- | Field | Description |
177
- | ------------ | ------------------------------------------------------------------------------------------------------------- |
178
- | Instructions | Replace or extend the agent's system prompt using [prompt blocks](https://mastra.ai/docs/editor/prompts). |
179
- | Tools | Add tools from the tool registry, integration providers, or MCP clients. Code-defined tools remain available. |
164
+ See the [Editor tools reference](https://mastra.ai/reference/editor/tools) for MCP configuration, conditions, filtering, and resolution order. See [`ToolProvider`](https://mastra.ai/reference/editor/tool-provider) for provider options.
180
165
 
181
- 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.
166
+ ## Decide what collaborators can edit
182
167
 
183
- ### Controlling what's editable
168
+ By default, collaborators can change an agent's instructions and manage its tools, including their descriptions. The agent's `id`, `name`, and `model` always come from code.
184
169
 
185
- Use the `editor` field on a code-defined agent to control which fields the editor can override. This lets you keep some fields code-owned while allowing edits to others:
170
+ Use the agent's `editor` field to limit what can be changed:
186
171
 
187
172
  ```typescript
188
173
  import { Agent } from '@mastra/core/agent'
189
174
 
190
175
  export const supportAgent = new Agent({
191
176
  id: 'support-agent',
192
- name: 'support-agent',
177
+ name: 'Support agent',
178
+ instructions: 'Help customers with Acme products.',
193
179
  model: 'openai/gpt-5.6-sol',
194
- editor: { instructions: true, tools: { description: true } },
180
+ editor: {
181
+ instructions: true,
182
+ tools: {
183
+ description: true,
184
+ },
185
+ },
195
186
  })
196
187
  ```
197
188
 
198
- The `editor` field accepts these shapes:
189
+ This agent lets collaborators change its instructions and improve the descriptions of tools already attached to it. They can't add or remove tools.
199
190
 
200
- | Value | Result |
201
- | ---------------------------------- | ---------------------------------------------------------- |
202
- | Omitted | Instructions and tools are editable. |
203
- | `false` | Nothing is editable. The agent is locked. |
204
- | `{ instructions: true }` | Instructions are editable. |
205
- | `{ tools: true }` | Tool membership and descriptions are editable. |
206
- | `{ tools: { description: true } }` | Only tool descriptions are editable. Membership is locked. |
191
+ | `editor` value | What collaborators can change |
192
+ | ---------------------------------- | ------------------------------------------- |
193
+ | Omitted | Instructions, tools, and tool descriptions |
194
+ | `false` | Nothing |
195
+ | `{ instructions: true }` | Instructions |
196
+ | `{ tools: true }` | Tools and tool descriptions |
197
+ | `{ tools: { description: true } }` | Descriptions of tools already added in code |
207
198
 
208
- When a field is owned by code, Studio shows it as read-only and the server strips it from saved overrides, so the stored config only contains the fields you allow. See the [`editor` overrides reference](https://mastra.ai/reference/agents/agent) for the full type.
199
+ Studio shows everything else as read-only. See [editor overrides](https://mastra.ai/reference/agents/agent) for the complete configuration.
209
200
 
210
- ## Versioning
201
+ ## Choose where changes are stored
202
+
203
+ Editor can save changes in the configured database or as files in the repository.
204
+
205
+ ### Database storage
206
+
207
+ The database option is the default. Editor uses the storage configured on the `Mastra` instance, so the application and Editor can share the same backend.
208
+
209
+ To use a separate backend for Editor data, set the `editor` option on [`MastraCompositeStore`](https://mastra.ai/reference/storage/composite). Storage domains without an explicit route continue to use its `default` store.
210
+
211
+ The following example keeps application and Editor data in separate LibSQL files:
212
+
213
+ ```typescript
214
+ import { Mastra } from '@mastra/core'
215
+ import { MastraCompositeStore } from '@mastra/core/storage'
216
+ import { MastraEditor } from '@mastra/editor'
217
+ import { LibSQLStore } from '@mastra/libsql'
211
218
 
212
- 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 and compare what changed between two snapshots, plus target specific versions per request for A/B testing or gradual rollouts.
219
+ export const mastra = new Mastra({
220
+ agents: {/* existing agents */},
221
+ storage: new MastraCompositeStore({
222
+ id: 'mastra-storage',
223
+ default: new LibSQLStore({
224
+ id: 'app-storage',
225
+ url: 'file:./mastra.db',
226
+ }),
227
+ editor: new LibSQLStore({
228
+ id: 'editor-storage',
229
+ url: 'file:./editor.db',
230
+ }),
231
+ }),
232
+ editor: new MastraEditor(),
233
+ })
234
+ ```
213
235
 
214
- 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.
236
+ ### Repository files
215
237
 
216
- ### Version lifecycle
238
+ Use the code source to keep overrides alongside application code. Developers can review the files in pull requests and deploy them with the application:
217
239
 
218
- Version snapshots don't store a lifecycle status. Instead, the agent or prompt block stores an `activeVersionId` that identifies its published version.
240
+ ```typescript
241
+ import { Mastra } from '@mastra/core'
242
+ import { MastraEditor } from '@mastra/editor'
219
243
 
220
- | Term | Description |
221
- | ---------- | ----------------------------------------------------------------------------------------------------------------------------------- |
222
- | Latest | The most recently saved version snapshot. |
223
- | Published | The version whose ID matches `activeVersionId`. Only one version can be active at a time. |
224
- | Draft | The latest version when it differs from the active version. If `activeVersionId` isn't set, the latest version remains unpublished. |
225
- | Historical | Any other saved version. Historical versions remain available for comparison, direct selection, and restoration. |
244
+ export const mastra = new Mastra({
245
+ agents: {/* existing agents */},
246
+ editor: new MastraEditor({
247
+ source: 'code',
248
+ codePath: './mastra/editor',
249
+ }),
250
+ })
251
+ ```
226
252
 
227
- Saving a database-backed resource creates a new latest version. If an active version already exists, it continues to handle requests until you publish the new version. Publishing sets `activeVersionId` to the selected version without deleting or changing the previous active version.
253
+ In this mode, each edited agent has one JSON override file. Editor doesn't generate TypeScript or change the file where the agent was created. By default, an agent with the ID `support-agent` gets this file:
228
254
 
229
- Restoring a historical version copies its configuration into a new draft that remains inactive until you publish it.
255
+ ```text
256
+ mastra/editor/agents/support-agent.json
257
+ ```
230
258
 
231
- ### Version targeting and experimentation
259
+ The file contains only the parts managed by Editor. For example:
232
260
 
233
- Because every version has a unique ID, you can route different requests to different agent configurations. This supports several patterns:
261
+ ```json
262
+ {
263
+ "instructions": "Help customers with Acme products and answer in their language.",
264
+ "tools": {
265
+ "searchOrders": {
266
+ "description": "Look up an order by its number"
267
+ }
268
+ }
269
+ }
270
+ ```
234
271
 
235
- - **A/B testing**: Split traffic between specific version IDs and compare performance metrics.
236
- - **Canary rollouts**: Send a small percentage of requests to a draft or historical version before publishing it.
237
- - **Per-user targeting**: Pin specific users or accounts to a version while others use the active version.
238
- - **Environment separation**: Use the latest version in staging and the active version in production.
272
+ The agent's model, name, and other code-owned fields stay in its TypeScript file. Mastra reads the JSON and applies these values when the agent runs.
239
273
 
240
- Pass a `versionId` or `status` when calling the agent through the Client SDK, server query parameters, or React SDK `requestContext`. A `versionId` selects that exact snapshot, `status: 'draft'` selects the latest snapshot, and `status: 'published'` selects the active snapshot.
274
+ When a collaborator saves in Studio, they can write the file to the local filesystem or download it. With a source-control integration, Studio can open a pull request instead. Git then provides the review and version history.
241
275
 
242
- ### Version selection
276
+ See [`MastraEditor`](https://mastra.ai/reference/editor/mastra-editor) for file locations and source options.
243
277
 
244
- Calling [`mastra.getAgentById()`](https://mastra.ai/reference/core/getAgentById) without a version selector returns the registered code-defined agent. Pass a selector to apply a published, draft, or specific stored override:
278
+ ## Versioning
245
279
 
246
- ```typescript
247
- // Load the registered code-defined agent without stored overrides
248
- const codeAgent = mastra.getAgentById('support-agent')
280
+ Database-backed agents and prompt blocks use draft and published versions. Saving creates a draft while the live agent continues using the published version. Publishing makes the draft live. Restoring an older version creates a draft that collaborators can test before publishing.
281
+
282
+ Code-backed agent overrides use JSON files and Git history.
283
+
284
+ ### Select a version
249
285
 
250
- // Load the active published override
286
+ An application can choose a stored version for each request by passing a status (`published` or `draft`) or an exact version ID:
287
+
288
+ ```typescript
251
289
  const publishedAgent = await mastra.getAgentById('support-agent', {
252
290
  status: 'published',
253
291
  })
254
292
 
255
- // Load the latest override
256
293
  const draftAgent = await mastra.getAgentById('support-agent', {
257
294
  status: 'draft',
258
295
  })
259
296
 
260
- // Load a specific version
261
297
  const versionedAgent = await mastra.getAgentById('support-agent', {
262
298
  versionId: 'abc-123',
263
299
  })
264
300
  ```
265
301
 
266
- When calling the agent through the Mastra server, pass version parameters as query strings:
302
+ Version selection supports:
267
303
 
268
- ```bash
269
- # Published version (default)
270
- curl http://localhost:4111/agents/support-agent
304
+ - Compare two versions in an A/B test.
305
+ - Give a draft to a small group before publishing it for everyone.
306
+ - Keep production on the published version while staging uses the latest draft.
307
+ - Pin a customer to a particular version.
271
308
 
272
- # Latest draft
273
- curl http://localhost:4111/agents/support-agent?status=draft
309
+ The same version controls work when a supervisor calls sub-agents. Developers can test a draft sub-agent without changing the rest of the system.
274
310
 
275
- # Specific version
276
- curl http://localhost:4111/agents/support-agent?versionId=abc-123
277
- ```
278
-
279
- See the [Client SDK agents reference](https://mastra.ai/reference/client-js/agents) for API methods.
280
-
281
- ### Sub-agent versioning
282
-
283
- 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.
311
+ See the [Editor versioning reference](https://mastra.ai/reference/editor/versioning) for version selection, sub-agent behavior, REST endpoints, and SDK methods.
284
312
 
285
- Set version overrides at three levels, with later levels taking priority:
313
+ ## Programmatic access
286
314
 
287
- 1. **Mastra instance config**: global defaults that apply to every `generate()` and `stream()` call.
288
- 2. **Per-invocation options**: overrides passed directly to `generate()` or `stream()`.
289
- 3. **Server request body**: overrides sent in the `versions` field of an API request.
315
+ Everything available in Studio is also available programmatically through [`mastra.getEditor()`](https://mastra.ai/reference/core/getEditor), the REST API, or the Client SDK. Use it to script bulk updates or seed stored configurations from code. It can also power automation that tunes agents based on [evaluation results](https://mastra.ai/docs/datasets/running-experiments).
290
316
 
291
- Resolution order: **per-invocation > request body > Mastra instance defaults > code-defined agent**.
292
-
293
- #### Mastra instance config
294
-
295
- Set global defaults when creating the `Mastra` instance. Every supervisor call inherits these overrides:
317
+ Call `mastra.getEditor()` when application code has access to the Mastra instance:
296
318
 
297
319
  ```typescript
298
- import { Mastra } from '@mastra/core'
299
- import { MastraEditor } from '@mastra/editor'
300
-
301
- export const mastra = new Mastra({
302
- agents: { supervisor, researchAgent, writerAgent },
303
- editor: new MastraEditor(),
304
- versions: {
305
- agents: {
306
- 'research-agent': { status: 'published' },
307
- 'writer-agent': { versionId: 'abc-123' },
308
- },
309
- },
310
- })
311
- ```
312
-
313
- #### Per-invocation overrides
320
+ import { mastra } from '../mastra'
314
321
 
315
- Override versions for a single call to `generate()` or `stream()`. These take priority over Mastra instance defaults:
322
+ const editor = mastra.getEditor()!
316
323
 
317
- ```typescript
318
- const result = await supervisor.generate('Research and write an article about AI safety', {
319
- versions: {
320
- agents: {
321
- 'research-agent': { versionId: 'draft-456' },
322
- },
323
- },
324
+ await editor.agent.update({
325
+ id: 'support-agent',
326
+ instructions: 'Help customers with Acme products. Reply in their language.',
324
327
  })
325
328
  ```
326
329
 
327
- #### Server request body
328
-
329
- When calling agents through the Mastra server, pass version overrides in the request body:
330
+ The direct `editor.agent.update()` method activates the new version immediately. To create a draft without changing the live agent, use the stored-agent REST API or Client SDK instead:
330
331
 
331
332
  ```bash
332
- curl -X POST http://localhost:4111/agents/supervisor/generate \
333
+ curl -X PATCH http://localhost:4111/api/stored/agents/support-agent \
333
334
  -H "Content-Type: application/json" \
334
335
  -d '{
335
- "messages": [{ "role": "user", "content": "Research AI safety" }],
336
- "versions": {
337
- "agents": {
338
- "research-agent": { "versionId": "draft-456" }
339
- }
340
- }
336
+ "instructions": "Help customers with Acme products. Reply in their language."
341
337
  }'
342
338
  ```
343
339
 
344
- #### How propagation works
345
-
346
- 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.
340
+ The default server prefix is `/api`. Developers can set a custom prefix in the server configuration.
347
341
 
348
- If version resolution fails (for example, when the editor isn't configured or the version ID doesn't exist), the framework logs a warning and falls back to the code-defined agent.
342
+ See the [`MastraEditor` namespaces](https://mastra.ai/reference/editor/mastra-editor) and [Client SDK agents API](https://mastra.ai/reference/client-js/agents) for available operations.
349
343
 
350
344
  ## Next steps
351
345
 
352
- - Set up [prompts](https://mastra.ai/docs/editor/prompts) to build reusable instruction templates.
353
- - Add [tools](https://mastra.ai/docs/editor/tools) from integration providers and MCP servers.
354
- - Explore the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
346
+ - [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor)
347
+ - [Prompt blocks reference](https://mastra.ai/reference/editor/prompt-blocks)
348
+ - [Editor tools reference](https://mastra.ai/reference/editor/tools)
349
+ - [Editor versioning reference](https://mastra.ai/reference/editor/versioning)
@@ -141,6 +141,6 @@ The inline `task` receives the item's `metadata`, so each row can drive its own
141
141
  ## Related
142
142
 
143
143
  - [Running scorers in CI](https://mastra.ai/docs/evals/running-in-ci)
144
- - [Running experiments](https://mastra.ai/docs/evals/datasets/running-experiments)
144
+ - [Running experiments](https://mastra.ai/docs/datasets/running-experiments)
145
145
  - [Observational memory](https://mastra.ai/docs/memory/observational-memory)
146
146
  - [runEvals API reference](https://mastra.ai/reference/evals/run-evals)