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

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.
@@ -233,9 +233,24 @@ Existing stored signal rows and older clients continue to load through the compa
233
233
 
234
234
  > **Note:** Visit [Agent signals reference](https://mastra.ai/reference/agents/agent) for the full message, signal, and subscription types.
235
235
 
236
+ ## Approve tool calls
237
+
238
+ When a subscribed run pauses for tool approval, approve or decline the tool call with the subscription-native methods. The call returns a JSON acknowledgement. The resumed chunks arrive through the existing thread subscription.
239
+
240
+ ```typescript
241
+ await agent.sendToolApproval({
242
+ resourceId: 'user_123',
243
+ threadId: 'thread_456',
244
+ toolCallId: 'tool-call_456',
245
+ approved: true,
246
+ })
247
+ ```
248
+
249
+ Pass `approved: false` to decline the same pending tool call. Use the older `approveToolCall()` and `declineToolCall()` methods only when you are rendering the separate continuation stream directly.
250
+
236
251
  ## Use HTTP routes
237
252
 
238
- If you call Mastra over HTTP directly, use `POST /api/agents/:agentId/send-message` for immediate messages and `POST /api/agents/:agentId/queue-message` for next-turn messages. See [Server routes reference](https://mastra.ai/reference/server/routes) for request and response schemas.
253
+ If you call Mastra over HTTP directly, use `POST /api/agents/:agentId/send-message` for immediate messages and `POST /api/agents/:agentId/queue-message` for next-turn messages. For subscription-native tool approval, use `POST /api/agents/:agentId/send-tool-approval`. See [Server routes reference](https://mastra.ai/reference/server/routes) for request and response schemas.
239
254
 
240
255
  ## Use the client SDK
241
256
 
@@ -294,4 +309,5 @@ Use heartbeats together with client-side reconnect logic. Heartbeats reduce idle
294
309
  - [`Agent.subscribeToThread()`](https://mastra.ai/reference/agents/agent)
295
310
  - [Server agent routes](https://mastra.ai/reference/server/routes)
296
311
  - [`client.getAgent().sendSignal()`](https://mastra.ai/reference/client-js/agents)
297
- - [`client.getAgent().subscribeToThread()`](https://mastra.ai/reference/client-js/agents)
312
+ - [`client.getAgent().subscribeToThread()`](https://mastra.ai/reference/client-js/agents)
313
+ - [`client.getAgent().sendToolApproval()`](https://mastra.ai/reference/client-js/agents)
@@ -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.
@@ -326,7 +326,7 @@ response.processDataStream({
326
326
 
327
327
  ### `approveToolCall()`
328
328
 
329
- Approve a pending tool call that requires human confirmation:
329
+ Approve a pending tool call and return a continuation stream. Use this when you are rendering the resumed chunks from the approval response.
330
330
 
331
331
  ```typescript
332
332
  const response = await agent.approveToolCall({
@@ -341,9 +341,26 @@ response.processDataStream({
341
341
  })
342
342
  ```
343
343
 
344
+ ### `sendToolApproval()`
345
+
346
+ Approve or decline a pending tool call for a subscribed thread. Use this with `subscribeToThread()` when the resumed chunks should arrive through the existing thread subscription instead of a separate continuation stream.
347
+
348
+ ```typescript
349
+ const result = await agent.sendToolApproval({
350
+ resourceId: 'user-123',
351
+ threadId: 'thread-456',
352
+ toolCallId: 'tool-call-456',
353
+ approved: true,
354
+ })
355
+
356
+ console.log(result.accepted)
357
+ ```
358
+
359
+ Returns `{ accepted: true, runId: string, toolCallId?: string }`.
360
+
344
361
  ### `declineToolCall()`
345
362
 
346
- Decline a pending tool call that requires human confirmation:
363
+ Decline a pending tool call and return a continuation stream. Use this when you are rendering the resumed chunks from the decline response.
347
364
 
348
365
  ```typescript
349
366
  const response = await agent.declineToolCall({
@@ -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`
@@ -4,19 +4,20 @@ Server adapters register these routes when you call `server.init()`. All routes
4
4
 
5
5
  ## Agents
6
6
 
7
- | Method | Path | Description |
8
- | ------ | -------------------------------------------- | ----------------------------------------------------- |
9
- | `GET` | `/api/agents` | List all agents |
10
- | `GET` | `/api/agents/:agentId` | Get agent by ID (supports version query params) |
11
- | `POST` | `/api/agents/:agentId/generate` | Generate agent response |
12
- | `POST` | `/api/agents/:agentId/stream` | Stream agent response |
13
- | `POST` | `/api/agents/:agentId/send-message` | Send a user message to an active or idle thread |
14
- | `POST` | `/api/agents/:agentId/queue-message` | Queue a user message for the next thread turn |
15
- | `POST` | `/api/agents/:agentId/signals` | Send a lower-level signal to an active or idle thread |
16
- | `POST` | `/api/agents/:agentId/subscribe-thread` | Subscribe to a thread stream |
17
- | `POST` | `/api/agents/:agentId/resume-stream` | Resume a suspended agent stream with custom data |
18
- | `GET` | `/api/agents/:agentId/tools` | List agent tools |
19
- | `POST` | `/api/agents/:agentId/tools/:toolId/execute` | Execute agent tool |
7
+ | Method | Path | Description |
8
+ | ------ | -------------------------------------------- | ----------------------------------------------------------------------- |
9
+ | `GET` | `/api/agents` | List all agents |
10
+ | `GET` | `/api/agents/:agentId` | Get agent by ID (supports version query params) |
11
+ | `POST` | `/api/agents/:agentId/generate` | Generate agent response |
12
+ | `POST` | `/api/agents/:agentId/stream` | Stream agent response |
13
+ | `POST` | `/api/agents/:agentId/send-message` | Send a user message to an active or idle thread |
14
+ | `POST` | `/api/agents/:agentId/queue-message` | Queue a user message for the next thread turn |
15
+ | `POST` | `/api/agents/:agentId/signals` | Send a lower-level signal to an active or idle thread |
16
+ | `POST` | `/api/agents/:agentId/threads/subscribe` | Subscribe to a thread stream |
17
+ | `POST` | `/api/agents/:agentId/send-tool-approval` | Approve or decline a tool call and resume through a thread subscription |
18
+ | `POST` | `/api/agents/:agentId/resume-stream` | Resume a suspended agent stream with custom data |
19
+ | `GET` | `/api/agents/:agentId/tools` | List agent tools |
20
+ | `POST` | `/api/agents/:agentId/tools/:toolId/execute` | Execute agent tool |
20
21
 
21
22
  ### Get agent query parameters
22
23
 
@@ -140,6 +141,32 @@ Both routes return:
140
141
  }
141
142
  ```
142
143
 
144
+ ### Subscription tool approval routes
145
+
146
+ Use `POST /api/agents/:agentId/send-tool-approval` when the client already has an active thread subscription. The route resumes the run and returns a JSON acknowledgement. Resumed stream chunks are delivered through `POST /api/agents/:agentId/threads/subscribe`.
147
+
148
+ The route accepts this request body:
149
+
150
+ ```typescript
151
+ {
152
+ resourceId: string;
153
+ threadId: string;
154
+ toolCallId: string;
155
+ approved: boolean;
156
+ requestContext?: Record<string, unknown>;
157
+ }
158
+ ```
159
+
160
+ The route returns:
161
+
162
+ ```typescript
163
+ {
164
+ accepted: true;
165
+ runId: string;
166
+ toolCallId?: string;
167
+ }
168
+ ```
169
+
143
170
  ## Workflows
144
171
 
145
172
  | Method | Path | Description |
@@ -242,7 +242,9 @@ The GeminiLiveVoice class emits the following events:
242
242
 
243
243
  **speaking** (`event`): Emitted with audio metadata. Callback receives { audioData?: Int16Array, sampleRate?: number }.
244
244
 
245
- **writing** (`event`): Emitted when transcribed text is available. Callback receives { text: string, role: 'assistant' | 'user' }.
245
+ **writing** (`event`): Emitted when transcribed text is available. Callback receives { text: string, role: 'assistant' | 'user' }. On native-audio models the assistant transcript is driven by the server's \`output\_audio\_transcription\` channel rather than \`modelTurn.parts.text\`.
246
+
247
+ **thinking** (`event`): Emitted on native-audio models with the model's chain-of-thought / reasoning text from \`modelTurn.parts.text\`. Callback receives { text: string }. Does not fire on non-native-audio models, where \`modelTurn.parts.text\` is the spoken response and is emitted as \`writing\` instead.
246
248
 
247
249
  **session** (`event`): Emitted on session state changes. Callback receives { state: 'connecting' | 'connected' | 'disconnected' | 'disconnecting' | 'updated', config?: object }.
248
250
 
@@ -254,7 +256,18 @@ The GeminiLiveVoice class emits the following events:
254
256
 
255
257
  **error** (`event`): Emitted when an error occurs. Callback receives { message: string, code?: string, details?: unknown }.
256
258
 
257
- **interrupt** (`event`): Interrupt events. Callback receives { type: 'user' | 'model', timestamp: number }.
259
+ **interrupt** (`event`): Emitted on barge-in when the user starts speaking over an in-flight model response. The server cancels any further audio for the current turn. Callback receives { type: 'user', timestamp: number }.
260
+
261
+ ## Native-audio behavior
262
+
263
+ Native-audio Gemini Live models — any model whose ID contains `native-audio`, such as `gemini-2.5-flash-native-audio-preview-12-2025` — split text output across two channels:
264
+
265
+ - The model's spoken reply is delivered as audio plus an `output_audio_transcription` transcript and surfaced as `writing` with `role: 'assistant'`.
266
+ - The model's internal reasoning is delivered as `modelTurn.parts.text` and surfaced as `thinking`.
267
+
268
+ On non-native-audio models there is no `output_audio_transcription` channel, so `modelTurn.parts.text` is the spoken response itself and is emitted as `writing`; the `thinking` event does not fire.
269
+
270
+ Input transcription, output transcription, and barge-in detection (`realtime_input_config.activity_handling = 'START_OF_ACTIVITY_INTERRUPTS'`) are enabled automatically in the setup payload — no extra configuration is required.
258
271
 
259
272
  ## Available models
260
273
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.42-alpha.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`19a8658`](https://github.com/mastra-ai/mastra/commit/19a86589c788ef48bb6c1b0612cc82a201857379), [`a659a77`](https://github.com/mastra-ai/mastra/commit/a659a779bdebe3a52a518c56d2260592d0240fe0), [`3332be9`](https://github.com/mastra-ai/mastra/commit/3332be9701ecd77aba840959d9a1d1ce7aef02d3)]:
8
+ - @mastra/core@1.38.0-alpha.6
9
+
10
+ ## 1.1.42-alpha.7
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`a18775a`](https://github.com/mastra-ai/mastra/commit/a18775a693172546ee2378d39b67d4e32895b251), [`1baf2d1`](https://github.com/mastra-ai/mastra/commit/1baf2d152c6881338ff8f114633d5316fe13dd15)]:
15
+ - @mastra/core@1.38.0-alpha.5
16
+
3
17
  ## 1.1.42-alpha.6
4
18
 
5
19
  ### 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.8",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -28,8 +28,8 @@
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",
32
- "@mastra/mcp": "^1.9.0-alpha.0"
31
+ "@mastra/mcp": "^1.9.0-alpha.0",
32
+ "@mastra/core": "1.38.0-alpha.6"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^1.19.11",
@@ -47,7 +47,7 @@
47
47
  "vitest": "4.1.5",
48
48
  "@internal/lint": "0.0.99",
49
49
  "@internal/types-builder": "0.0.74",
50
- "@mastra/core": "1.38.0-alpha.4"
50
+ "@mastra/core": "1.38.0-alpha.6"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {