@mastra/mcp-docs-server 1.1.42-alpha.6 → 1.1.42-alpha.7

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.
@@ -66,6 +66,41 @@ Once registered, you can manage agents through [Studio](https://mastra.ai/docs/s
66
66
 
67
67
  > **Note:** See the [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor) for all configuration options.
68
68
 
69
+ ## Code and database sources
70
+
71
+ The editor stores agent overrides in one of two sources, set with the `source` option on `MastraEditor`:
72
+
73
+ | Source | Where overrides live | Studio actions |
74
+ | -------------- | --------------------------------------------------------- | -------------------------------------------------------- |
75
+ | `db` (default) | The configured storage backend. | Save and publish drafts. |
76
+ | `code` | Per-agent JSON files on disk, tracked in your repository. | Download the override file or save it to the filesystem. |
77
+
78
+ 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.
79
+
80
+ To use the code source, set `source: 'code'`:
81
+
82
+ ```typescript
83
+ import { Mastra } from '@mastra/core'
84
+ import { MastraEditor } from '@mastra/editor'
85
+
86
+ export const mastra = new Mastra({
87
+ agents: {
88
+ /* your existing agents */
89
+ },
90
+ editor: new MastraEditor({
91
+ source: 'code',
92
+ }),
93
+ })
94
+ ```
95
+
96
+ 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.
97
+
98
+ ### Versioning with the code source
99
+
100
+ The code source uses the Git history of each per-agent JSON file as its version history. Each commit that changes a file appears 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.
101
+
102
+ This means versions and rollbacks are managed through Git rather than through draft and publish actions.
103
+
69
104
  ## Studio
70
105
 
71
106
  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.
@@ -114,15 +149,16 @@ The `editor.agent` namespace also exposes `getById`, `list`, `listResolved`, and
114
149
 
115
150
  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
151
 
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. |
152
+ | Method | Path | Description |
153
+ | -------- | -------------------------------------- | ---------------------------------------------------------------- |
154
+ | `GET` | `/stored/agents` | List all stored agents. |
155
+ | `POST` | `/stored/agents` | Create a stored agent. |
156
+ | `GET` | `/stored/agents/:storedAgentId` | Get a stored agent by ID. |
157
+ | `PATCH` | `/stored/agents/:storedAgentId` | Update a stored agent. |
158
+ | `DELETE` | `/stored/agents/:storedAgentId` | Delete a stored agent. |
159
+ | `POST` | `/stored/agents/:storedAgentId/export` | Export a stored agent's override as a deterministic JSON config. |
124
160
 
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.
161
+ 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()`, 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.
126
162
 
127
163
  ### Automated experimentation
128
164
 
@@ -149,6 +185,32 @@ When you edit a code-defined agent through the editor, only specific fields can
149
185
 
150
186
  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
187
 
188
+ ### Controlling what is editable
189
+
190
+ 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:
191
+
192
+ ```typescript
193
+ import { Agent } from '@mastra/core/agent'
194
+
195
+ export const supportAgent = new Agent({
196
+ name: 'support-agent',
197
+ model: 'openai/gpt-5.4',
198
+ editor: { instructions: true, tools: { description: true } },
199
+ })
200
+ ```
201
+
202
+ The `editor` field accepts these shapes:
203
+
204
+ | Value | Result |
205
+ | ---------------------------------- | ---------------------------------------------------------- |
206
+ | Omitted | Instructions and tools are editable. |
207
+ | `false` | Nothing is editable. The agent is locked. |
208
+ | `{ instructions: true }` | Instructions are editable. |
209
+ | `{ tools: true }` | Tool membership and descriptions are editable. |
210
+ | `{ tools: { description: true } }` | Only tool descriptions are editable. Membership is locked. |
211
+
212
+ 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.
213
+
152
214
  ## Versioning
153
215
 
154
216
  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.
@@ -258,6 +258,16 @@ Returns an `AgentThreadSubscription` object with these members:
258
258
 
259
259
  **requestContextSchema** (`StandardJSONSchemaV1`): Standard JSON Schema for validating request context values. When provided, the context is validated at the start of generate() or stream(), throwing a MastraError if validation fails.
260
260
 
261
+ **editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean } }`): Controls which fields the editor can override for this code-defined agent. Omit to allow editing instructions and tools. See Editor overrides below.
262
+
263
+ ## Editor overrides
264
+
265
+ When you register the [`MastraEditor`](https://mastra.ai/reference/editor/mastra-editor), the `editor` field controls which parts of a code-defined agent can be changed through the editor. Fields owned by code are read-only in Studio and are stripped from saved overrides.
266
+
267
+ **editor** (`false | { instructions?: boolean; tools?: boolean | { description?: boolean } }`): Omit to allow editing instructions and tools. Set to \`false\` to lock the agent. Set \`instructions: true\` to allow instruction edits. Set \`tools: true\` to allow tool membership and description edits, or \`tools: { description: true }\` to allow only description edits.
268
+
269
+ The agent's `id`, `name`, and `model` always come from code and can't be overridden through the editor. See the [Editor overview](https://mastra.ai/docs/editor/overview) for usage.
270
+
261
271
  ## Returns
262
272
 
263
273
  **agent** (`Agent<TAgentId, TTools>`): A new Agent instance with the specified configuration.
@@ -43,6 +43,10 @@ export const mastra = new Mastra({
43
43
 
44
44
  **builder** (`AgentBuilderOptions`): Agent Builder configuration. See the AgentBuilderOptions reference. Omit or set \`enabled: false\` to disable the Builder.
45
45
 
46
+ **source** (`'code' | 'db'`): Where agent overrides are stored. With 'db', overrides live in the configured storage backend and Studio shows the save and publish flow. With 'code', overrides live as per-agent JSON files on disk (routed through a local FilesystemStore) and Studio shows filesystem actions. See the Editor overview for the difference. (Default: `'db'`)
47
+
48
+ **codePath** (`string`): Directory used by the 'code' source for per-agent JSON files. Ignored when source is not 'code'. (Default: `'./mastra/editor/'`)
49
+
46
50
  ### Provider interfaces
47
51
 
48
52
  Each provider field above takes a record keyed by provider id. See the per-provider reference pages for the implementation shape:
@@ -209,4 +213,16 @@ Returns all registered sandbox providers.
209
213
 
210
214
  #### `getBlobStoreProviders()`
211
215
 
212
- Returns all registered blob store providers.
216
+ Returns all registered blob store providers.
217
+
218
+ ### Source
219
+
220
+ #### `getSource()`
221
+
222
+ Returns the configured source (`'code'` or `'db'`), or `undefined` when the editor was constructed without an explicit `source`.
223
+
224
+ ```typescript
225
+ const source = mastra.getEditor()?.getSource()
226
+ ```
227
+
228
+ Returns: `'code' | 'db' | undefined`
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.42-alpha.7
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15)]:
8
+ - @mastra/core@1.38.0-alpha.5
9
+
3
10
  ## 1.1.42-alpha.6
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.1.42-alpha.6",
3
+ "version": "1.1.42-alpha.7",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,7 +28,7 @@
28
28
  "jsdom": "^26.1.0",
29
29
  "local-pkg": "^1.1.2",
30
30
  "zod": "^4.4.3",
31
- "@mastra/core": "1.38.0-alpha.4",
31
+ "@mastra/core": "1.38.0-alpha.5",
32
32
  "@mastra/mcp": "^1.9.0-alpha.0"
33
33
  },
34
34
  "devDependencies": {
@@ -45,9 +45,9 @@
45
45
  "tsx": "^4.21.0",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "4.1.5",
48
- "@internal/lint": "0.0.99",
49
48
  "@internal/types-builder": "0.0.74",
50
- "@mastra/core": "1.38.0-alpha.4"
49
+ "@mastra/core": "1.38.0-alpha.5",
50
+ "@internal/lint": "0.0.99"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {