@mastra/mcp-docs-server 1.2.1-alpha.2 → 1.2.1-alpha.5

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 (45) hide show
  1. package/.docs/docs/agent-builder/overview.md +2 -0
  2. package/.docs/docs/agents/background-tasks.md +89 -14
  3. package/.docs/docs/agents/durable-agents.md +231 -0
  4. package/.docs/docs/agents/skills.md +186 -0
  5. package/.docs/docs/agents/using-tools.md +52 -0
  6. package/.docs/docs/evals/datasets/running-experiments.md +76 -0
  7. package/.docs/docs/getting-started/build-with-ai.md +273 -8
  8. package/.docs/docs/server/pubsub.md +2 -2
  9. package/.docs/docs/workflows/overview.md +71 -0
  10. package/.docs/docs/workspace/skills.md +9 -1
  11. package/.docs/guides/build-your-ui/ai-sdk-ui.md +3 -3
  12. package/.docs/guides/concepts/streaming.md +317 -0
  13. package/.docs/guides/getting-started/quickstart.md +1 -1
  14. package/.docs/models/gateways/openrouter.md +2 -2
  15. package/.docs/models/gateways/vercel.md +10 -1
  16. package/.docs/models/index.md +1 -1
  17. package/.docs/models/providers/baseten.md +1 -1
  18. package/.docs/models/providers/friendli.md +3 -2
  19. package/.docs/models/providers/lilac.md +7 -7
  20. package/.docs/models/providers/opencode.md +2 -1
  21. package/.docs/models/providers/siliconflow-cn.md +2 -1
  22. package/.docs/models/providers/wafer.ai.md +2 -1
  23. package/.docs/reference/agents/createSkill.md +78 -0
  24. package/.docs/reference/agents/durable-agent.md +30 -1
  25. package/.docs/reference/agents/getDefaultOptions.md +1 -1
  26. package/.docs/reference/agents/getDefaultStreamOptions.md +1 -1
  27. package/.docs/reference/agents/getSkill.md +58 -0
  28. package/.docs/reference/agents/inngest-agent.md +339 -0
  29. package/.docs/reference/agents/listSkills.md +53 -0
  30. package/.docs/reference/ai-sdk/handle-workflow-stream.md +1 -1
  31. package/.docs/reference/ai-sdk/workflow-route.md +1 -1
  32. package/.docs/reference/index.md +4 -0
  33. package/.docs/reference/processors/stream-error-retry-processor.md +32 -0
  34. package/.docs/reference/streaming/workflows/timeTravelStream.md +1 -1
  35. package/.docs/reference/tools/create-tool.md +1 -1
  36. package/.docs/reference/workflows/run.md +1 -1
  37. package/CHANGELOG.md +14 -0
  38. package/package.json +4 -4
  39. package/.docs/docs/build-with-ai/mcp-docs-server.md +0 -238
  40. package/.docs/docs/build-with-ai/skills.md +0 -63
  41. package/.docs/docs/streaming/background-task-streaming.md +0 -80
  42. package/.docs/docs/streaming/events.md +0 -148
  43. package/.docs/docs/streaming/overview.md +0 -136
  44. package/.docs/docs/streaming/tool-streaming.md +0 -189
  45. package/.docs/docs/streaming/workflow-streaming.md +0 -109
@@ -0,0 +1,58 @@
1
+ # `.getSkill()`
2
+
3
+ Retrieves a specific skill by name from the agent's configured skills (both agent-level and workspace skills).
4
+
5
+ ## Usage example
6
+
7
+ ```typescript
8
+ import { agent } from '../mastra/agents'
9
+
10
+ const skill = await agent.getSkill('code-review')
11
+
12
+ if (skill) {
13
+ console.log(skill.name) // "code-review"
14
+ console.log(skill.description) // "Use when reviewing code changes."
15
+ console.log(skill.instructions) // Full markdown instructions
16
+ }
17
+ ```
18
+
19
+ ## Parameters
20
+
21
+ **skillName** (`string`): The name of the skill to retrieve.
22
+
23
+ **options** (`object`): Options for skill resolution.
24
+
25
+ **options.requestContext** (`RequestContext`): Request context passed to dynamic skill resolvers.
26
+
27
+ ## Return value
28
+
29
+ Returns `Promise<Skill | null>`.
30
+
31
+ Returns the `Skill` object if found, or `null` if no skill with that name exists.
32
+
33
+ ```typescript
34
+ interface Skill {
35
+ name: string
36
+ description: string
37
+ instructions: string
38
+ path: string
39
+ source: { type: string; projectPath: string }
40
+ references: string[]
41
+ scripts: string[]
42
+ assets: string[]
43
+ license?: string
44
+ compatibility?: string[]
45
+ 'user-invocable'?: boolean
46
+ metadata?: Record<string, unknown>
47
+ }
48
+ ```
49
+
50
+ ## Merging behavior
51
+
52
+ When both agent-level skills and workspace skills are configured, `.getSkill()` searches the merged set. Agent-level skills take precedence on name conflicts.
53
+
54
+ ## Related
55
+
56
+ - [Agent skills](https://mastra.ai/docs/agents/skills)
57
+ - [`.listSkills()` reference](https://mastra.ai/reference/agents/listSkills)
58
+ - [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
@@ -0,0 +1,339 @@
1
+ # `createInngestAgent()`
2
+
3
+ `createInngestAgent()` wraps an existing [`Agent`](https://mastra.ai/reference/agents/agent) with [Inngest](https://www.inngest.com/docs)-powered durable execution. Like [`createDurableAgent()`](https://mastra.ai/reference/agents/durable-agent), it streams events over [PubSub](https://mastra.ai/docs/server/pubsub) and supports resumable streams, but runs the agentic loop on Inngest's execution engine instead of in-process. Use it when a run must survive process restarts or run in a distributed environment.
4
+
5
+ For in-process durable execution, use [`createDurableAgent()`](https://mastra.ai/reference/agents/durable-agent). For fire-and-forget execution on the built-in workflow engine, use [`createEventedAgent()`](https://mastra.ai/reference/agents/durable-agent).
6
+
7
+ ## Usage example
8
+
9
+ Set up the Inngest client, wrap an agent, register it with Mastra, and expose the Inngest serve endpoint:
10
+
11
+ ```typescript
12
+ import { Mastra } from '@mastra/core'
13
+ import { Agent } from '@mastra/core/agent'
14
+ import { createInngestAgent, serve as inngestServe } from '@mastra/inngest'
15
+ import { Inngest } from 'inngest'
16
+
17
+ const inngest = new Inngest({ id: 'my-app' })
18
+
19
+ const agent = new Agent({
20
+ id: 'my-agent',
21
+ name: 'My Agent',
22
+ instructions: 'You are a helpful assistant',
23
+ model: 'openai/gpt-5.5',
24
+ })
25
+
26
+ const durableAgent = createInngestAgent({ agent, inngest })
27
+
28
+ export const mastra = new Mastra({
29
+ agents: { myAgent: durableAgent },
30
+ server: {
31
+ apiRoutes: [
32
+ {
33
+ path: '/inngest/api',
34
+ method: 'ALL',
35
+ createHandler: async ({ mastra }) => inngestServe({ mastra, inngest }),
36
+ },
37
+ ],
38
+ },
39
+ })
40
+ ```
41
+
42
+ Stream a response and read the result:
43
+
44
+ ```typescript
45
+ const { output, runId, cleanup } = await durableAgent.stream('Hello!')
46
+
47
+ const text = await output.text
48
+
49
+ cleanup()
50
+ ```
51
+
52
+ ## `createInngestAgent(options)`
53
+
54
+ Wraps an `Agent` with Inngest-powered durable execution and resumable streams.
55
+
56
+ ```typescript
57
+ import { createInngestAgent } from '@mastra/inngest'
58
+
59
+ const durableAgent = createInngestAgent({ agent, inngest })
60
+ ```
61
+
62
+ Returns: [`InngestAgent`](#inngestagent-interface)
63
+
64
+ ### Parameters
65
+
66
+ **agent** (`Agent`): The Agent to wrap with Inngest durable execution. Agent methods (e.g., \`generate()\`, \`listTools()\`, \`getMemory()\`) delegate to this agent via a Proxy.
67
+
68
+ **inngest** (`Inngest`): The Inngest client instance. Used to send workflow events and, in SDK v4, publish realtime stream events.
69
+
70
+ **id** (`string`): ID override. (Default: `agent.id`)
71
+
72
+ **name** (`string`): Name override. (Default: `agent.name`)
73
+
74
+ **pubsub** (`PubSub`): PubSub instance for streaming events. The default \`InngestPubSub\` uses Inngest Realtime, which works across processes. (Default: `InngestPubSub`)
75
+
76
+ **cache** (`MastraServerCache`): Cache for stored stream events, which enables resumable streams. When provided, the PubSub is automatically wrapped with \`CachingPubSub\`. If omitted, the agent inherits the cache from the Mastra instance.
77
+
78
+ **mastra** (`Mastra`): Mastra instance for observability. Set automatically when the agent is registered with Mastra.
79
+
80
+ ## `InngestAgent` interface
81
+
82
+ The object returned by `createInngestAgent()`. It implements the full `Agent` interface via a Proxy: any property or method not explicitly defined (e.g., `generate()`, `listTools()`, `getMemory()`) is forwarded to the underlying agent.
83
+
84
+ ### Properties
85
+
86
+ **id** (`string`): The agent ID.
87
+
88
+ **name** (`string`): The agent name.
89
+
90
+ **agent** (`Agent`): The underlying Mastra Agent.
91
+
92
+ **inngest** (`Inngest`): The Inngest client.
93
+
94
+ **cache** (`MastraServerCache | undefined`): The resolved cache instance, if resumable streams are enabled.
95
+
96
+ **pubsub** (`PubSub`): The PubSub instance used for streaming events.
97
+
98
+ ## Methods
99
+
100
+ ### Execution
101
+
102
+ #### `stream(messages, options?)`
103
+
104
+ Streams a response using Inngest's durable execution engine. The workflow is triggered via an Inngest event after the PubSub subscription is established.
105
+
106
+ ```typescript
107
+ const { output, runId, cleanup } = await durableAgent.stream('Hello!', {
108
+ onChunk: chunk => console.log(chunk),
109
+ onFinish: result => console.log('done', result),
110
+ })
111
+
112
+ const text = await output.text
113
+ cleanup()
114
+ ```
115
+
116
+ Returns: [`Promise<InngestAgentStreamResult>`](#inngestagentstreamresult)
117
+
118
+ #### `resume(runId, resumeData, options?)`
119
+
120
+ Resumes a suspended Inngest run, for example after a tool approval. Loads the workflow snapshot from storage, finds the suspended step, and sends a resume event to Inngest.
121
+
122
+ ```typescript
123
+ const { output, cleanup } = await durableAgent.resume(
124
+ runId,
125
+ {
126
+ approved: true,
127
+ },
128
+ { threadId: 'thread-1', resourceId: 'user-1' },
129
+ )
130
+
131
+ await output.text
132
+ cleanup()
133
+ ```
134
+
135
+ The third argument accepts `threadId` and `resourceId` in addition to the lifecycle callbacks:
136
+
137
+ **threadId** (`string`): Thread ID to associate with the resumed run.
138
+
139
+ **resourceId** (`string`): Resource ID to associate with the resumed run.
140
+
141
+ **onChunk** (`(chunk: ChunkType) => void | Promise<void>`): Called for each streamed chunk.
142
+
143
+ **onStepFinish** (`(result: AgentStepFinishEventData) => void | Promise<void>`): Called when a step in the agentic loop finishes.
144
+
145
+ **onFinish** (`(result: AgentFinishEventData) => void | Promise<void>`): Called when the run finishes.
146
+
147
+ **onError** (`(error: Error) => void | Promise<void>`): Called when the run errors.
148
+
149
+ **onSuspended** (`(data: AgentSuspendedEventData) => void | Promise<void>`): Called when the run suspends.
150
+
151
+ Returns: [`Promise<InngestAgentStreamResult>`](#inngestagentstreamresult)
152
+
153
+ #### `observe(runId, options?)`
154
+
155
+ Reconnects to an existing run, replaying cached events before delivering live ones. Use this after a network disconnection. Pass `offset` to start replay from a known position.
156
+
157
+ ```typescript
158
+ const { output, cleanup } = await durableAgent.observe(runId, {
159
+ offset: 0,
160
+ onChunk: chunk => console.log(chunk),
161
+ })
162
+
163
+ await output.text
164
+ ```
165
+
166
+ The result from `observe()` does not include `threadId` or `resourceId`.
167
+
168
+ Returns: `Promise<Omit<InngestAgentStreamResult, 'threadId' | 'resourceId'>>`
169
+
170
+ > **Warning:** The `cleanup()` returned by `observe()` destroys the run's registry entries and cached events. Only call it when you are done with the run. If the run is suspended and you intend to resume later, don't call `cleanup()`.
171
+
172
+ #### `prepare(messages, options?)`
173
+
174
+ Prepares a run for durable execution without triggering it. Returns the serialized workflow input that can be used to manually trigger the Inngest workflow event.
175
+
176
+ ```typescript
177
+ const { runId, messageId, workflowInput, threadId, resourceId } = await durableAgent.prepare(
178
+ 'Summarize the document',
179
+ {
180
+ memory: { threadId: 'thread-1', resourceId: 'user-1' },
181
+ },
182
+ )
183
+ ```
184
+
185
+ Returns:
186
+
187
+ ```typescript
188
+ interface PrepareResult {
189
+ runId: string
190
+ messageId: string
191
+ workflowInput: any
192
+ threadId?: string
193
+ resourceId?: string
194
+ }
195
+ ```
196
+
197
+ ### Introspection
198
+
199
+ #### `isInngestAgent(obj)`
200
+
201
+ Type guard that checks whether an object is an `InngestAgent`.
202
+
203
+ ```typescript
204
+ import { isInngestAgent } from '@mastra/inngest'
205
+
206
+ if (isInngestAgent(agent)) {
207
+ // agent is InngestAgent
208
+ }
209
+ ```
210
+
211
+ Returns: `boolean`
212
+
213
+ ## Stream options
214
+
215
+ `stream()` accepts an `InngestAgentStreamOptions` object. It supports the same agent execution options as [`DurableAgent.stream()`](https://mastra.ai/reference/agents/durable-agent), plus lifecycle callbacks.
216
+
217
+ **runId** (`string`): Unique identifier for this run. Use it later with \`resume()\` or \`observe()\`.
218
+
219
+ **instructions** (`AgentExecutionOptions['instructions']`): Overrides the agent's default instructions for this run.
220
+
221
+ **context** (`ModelMessage[]`): Additional context messages to provide to the agent.
222
+
223
+ **memory** (`object`): Memory configuration for conversation persistence and retrieval.
224
+
225
+ **requestContext** (`RequestContext`): Request context carrying dynamic configuration and state for this run.
226
+
227
+ **maxSteps** (`number`): Maximum number of steps to run.
228
+
229
+ **toolsets** (`object`): Additional tool sets available for this run.
230
+
231
+ **clientTools** (`object`): Client-side tools available during execution.
232
+
233
+ **toolChoice** (`'auto' | 'none' | 'required' | { type: 'tool'; toolName: string }`): Tool selection strategy.
234
+
235
+ **modelSettings** (`object`): Model-specific settings such as temperature.
236
+
237
+ **requireToolApproval** (`boolean`): Require approval for all tool calls, which suspends the run until resumed.
238
+
239
+ **autoResumeSuspendedTools** (`boolean`): Automatically resume tools that suspended, instead of waiting for an external \`resume()\` call.
240
+
241
+ **toolCallConcurrency** (`number`): Maximum number of tool calls to execute concurrently.
242
+
243
+ **includeRawChunks** (`boolean`): Include raw provider chunks in the stream output.
244
+
245
+ **maxProcessorRetries** (`number`): Maximum number of processor retries per generation.
246
+
247
+ **untilIdle** (`boolean | { maxIdleMs?: number }`): When set, keeps the stream open across background-task continuations until the agent is idle. Pass \`true\` for the default 5-minute idle timeout, or \`{ maxIdleMs }\` to customise.
248
+
249
+ **onChunk** (`(chunk: ChunkType) => void | Promise<void>`): Called for each streamed chunk.
250
+
251
+ **onStepFinish** (`(result: AgentStepFinishEventData) => void | Promise<void>`): Called when a step in the agentic loop finishes.
252
+
253
+ **onFinish** (`(result: AgentFinishEventData) => void | Promise<void>`): Called when the run finishes.
254
+
255
+ **onError** (`(error: Error) => void | Promise<void>`): Called when the run errors.
256
+
257
+ **onSuspended** (`(data: AgentSuspendedEventData) => void | Promise<void>`): Called when the run suspends, for example for tool approval.
258
+
259
+ `observe()` accepts the lifecycle callbacks (`onChunk`, `onStepFinish`, `onFinish`, `onError`, `onSuspended`) plus an `offset` to control where replay starts.
260
+
261
+ ## `InngestAgentStreamResult`
262
+
263
+ The object returned by `stream()` and `resume()`. The `observe()` method returns the same shape but omits `threadId` and `resourceId`.
264
+
265
+ ```typescript
266
+ interface InngestAgentStreamResult<OUTPUT = undefined> {
267
+ output: MastraModelOutput<OUTPUT>
268
+ readonly fullStream: ReadableStream<any>
269
+ runId: string
270
+ threadId?: string
271
+ resourceId?: string
272
+ cleanup: () => void
273
+ }
274
+ ```
275
+
276
+ **output** (`MastraModelOutput`): The streaming output. Await \`output.text\` for the full text, or consume \`output.fullStream\`.
277
+
278
+ **fullStream** (`ReadableStream`): The full event stream, delegating to \`output.fullStream\`.
279
+
280
+ **runId** (`string`): The unique run ID. Pass it to \`resume()\` or \`observe()\` to reconnect.
281
+
282
+ **threadId** (`string`): Thread ID when using memory.
283
+
284
+ **resourceId** (`string`): Resource ID when using memory.
285
+
286
+ **cleanup** (`() => void`): Unsubscribes from PubSub and clears registry entries for the run. Call it when done with the run.
287
+
288
+ ## Serving Inngest functions
289
+
290
+ The `@mastra/inngest` package provides `serve()` and `createServe()` to register Inngest workflow functions with your HTTP framework.
291
+
292
+ ### `serve(options)`
293
+
294
+ Serves Mastra workflows with Hono (the default framework). Collects all Inngest-backed workflows from Mastra and registers them as Inngest functions.
295
+
296
+ ```typescript
297
+ import { serve } from '@mastra/inngest'
298
+
299
+ app.use('/inngest/api', async c => {
300
+ return serve({ mastra, inngest })(c)
301
+ })
302
+ ```
303
+
304
+ ### `createServe(adapter)`
305
+
306
+ Factory that accepts any Inngest serve adapter (`inngest/express`, `inngest/fastify`, `inngest/next`, etc.) and returns a serve function for that framework.
307
+
308
+ ```typescript
309
+ import { createServe } from '@mastra/inngest'
310
+ import { serve } from 'inngest/express'
311
+
312
+ const serveExpress = createServe(serve)
313
+ app.use('/inngest/api', serveExpress({ mastra, inngest }))
314
+ ```
315
+
316
+ ```typescript
317
+ import { createServe } from '@mastra/inngest'
318
+ import { serve } from 'inngest/next'
319
+
320
+ const serveNext = createServe(serve)
321
+ export const { GET, POST, PUT } = serveNext({ mastra, inngest })
322
+ ```
323
+
324
+ ### Serve options
325
+
326
+ **mastra** (`Mastra`): The Mastra instance containing registered agents and workflows.
327
+
328
+ **inngest** (`Inngest`): The Inngest client instance.
329
+
330
+ **functions** (`InngestFunction.Like[]`): Additional Inngest functions to serve alongside Mastra workflows.
331
+
332
+ **registerOptions** (`RegisterOptions`): Options passed to the Inngest registration handler.
333
+
334
+ ## Related
335
+
336
+ - [DurableAgent reference](https://mastra.ai/reference/agents/durable-agent)
337
+ - [Agent class](https://mastra.ai/reference/agents/agent)
338
+ - [Inngest deployment guide](https://mastra.ai/guides/deployment/inngest)
339
+ - [PubSub](https://mastra.ai/docs/server/pubsub)
@@ -0,0 +1,53 @@
1
+ # `.listSkills()`
2
+
3
+ Returns metadata for all skills available to the agent, including both agent-level and workspace skills.
4
+
5
+ ## Usage example
6
+
7
+ ```typescript
8
+ import { agent } from '../mastra/agents'
9
+
10
+ const skills = await agent.listSkills()
11
+
12
+ for (const skill of skills) {
13
+ console.log(`${skill.name}: ${skill.description}`)
14
+ }
15
+ ```
16
+
17
+ ## Parameters
18
+
19
+ **options** (`object`): Options for skill resolution.
20
+
21
+ **options.requestContext** (`RequestContext`): Request context passed to dynamic skill resolvers.
22
+
23
+ ## Return value
24
+
25
+ Returns `Promise<SkillMetadata[]>`.
26
+
27
+ Each entry contains the metadata for a discovered skill:
28
+
29
+ ```typescript
30
+ interface SkillMetadata {
31
+ name: string
32
+ description: string
33
+ path: string
34
+ source: { type: string; projectPath: string }
35
+ references: string[]
36
+ scripts: string[]
37
+ assets: string[]
38
+ license?: string
39
+ compatibility?: string[]
40
+ 'user-invocable'?: boolean
41
+ metadata?: Record<string, unknown>
42
+ }
43
+ ```
44
+
45
+ ## Merging behavior
46
+
47
+ When both agent-level skills and workspace skills are configured, `.listSkills()` returns the merged set. Agent-level skills take precedence on name conflicts — if both define a skill named `code-review`, only the agent-level version appears in the result.
48
+
49
+ ## Related
50
+
51
+ - [Agent skills](https://mastra.ai/docs/agents/skills)
52
+ - [`.getSkill()` reference](https://mastra.ai/reference/agents/getSkill)
53
+ - [`createSkill()` reference](https://mastra.ai/reference/agents/createSkill)
@@ -10,7 +10,7 @@ Use [`workflowRoute()`](https://mastra.ai/reference/ai-sdk/workflow-route) if yo
10
10
 
11
11
  > **Agent streaming in workflows:** When a workflow step pipes an agent's stream to the workflow writer (e.g., `await response.fullStream.pipeTo(writer)`), the agent's text chunks and tool calls are forwarded to the UI stream in real time, even when the agent runs inside workflow steps.
12
12
  >
13
- > See [Workflow Streaming](https://mastra.ai/docs/streaming/workflow-streaming) for more details.
13
+ > See [Workflow Streaming](https://mastra.ai/docs/workflows/overview) for more details.
14
14
 
15
15
  ## Usage example
16
16
 
@@ -8,7 +8,7 @@ Use [`handleWorkflowStream()`](https://mastra.ai/reference/ai-sdk/handle-workflo
8
8
 
9
9
  > **Agent streaming in workflows:** When a workflow step pipes an agent's stream to the workflow writer (e.g., `await response.fullStream.pipeTo(writer)`), the agent's text chunks and tool calls are forwarded to the UI stream in real time, even when the agent runs inside workflow steps.
10
10
  >
11
- > See [Workflow Streaming](https://mastra.ai/docs/streaming/workflow-streaming) for more details.
11
+ > See [Workflow Streaming](https://mastra.ai/docs/workflows/overview) for more details.
12
12
 
13
13
  ## Usage example
14
14
 
@@ -6,6 +6,8 @@ The Reference section provides documentation of Mastra's API, including paramete
6
6
  - [createACPTool()](https://mastra.ai/reference/acp/create-acp-tool)
7
7
  - [Agent Class](https://mastra.ai/reference/agents/agent)
8
8
  - [Channels](https://mastra.ai/reference/agents/channels)
9
+ - [createInngestAgent()](https://mastra.ai/reference/agents/inngest-agent)
10
+ - [createSkill()](https://mastra.ai/reference/agents/createSkill)
9
11
  - [DurableAgent](https://mastra.ai/reference/agents/durable-agent)
10
12
  - [.generate()](https://mastra.ai/reference/agents/generate)
11
13
  - [.generateLegacy()](https://mastra.ai/reference/agents/generateLegacy)
@@ -18,10 +20,12 @@ The Reference section provides documentation of Mastra's API, including paramete
18
20
  - [.getMemory()](https://mastra.ai/reference/agents/getMemory)
19
21
  - [.getMetadata()](https://mastra.ai/reference/agents/getMetadata)
20
22
  - [.getModel()](https://mastra.ai/reference/agents/getModel)
23
+ - [.getSkill()](https://mastra.ai/reference/agents/getSkill)
21
24
  - [.getTools()](https://mastra.ai/reference/agents/getTools)
22
25
  - [.getVoice()](https://mastra.ai/reference/agents/getVoice)
23
26
  - [.listAgents()](https://mastra.ai/reference/agents/listAgents)
24
27
  - [.listScorers()](https://mastra.ai/reference/agents/listScorers)
28
+ - [.listSkills()](https://mastra.ai/reference/agents/listSkills)
25
29
  - [.listTools()](https://mastra.ai/reference/agents/listTools)
26
30
  - [.listWorkflows()](https://mastra.ai/reference/agents/listWorkflows)
27
31
  - [.network()](https://mastra.ai/reference/agents/network)
@@ -30,6 +30,38 @@ The processor checks the error and its cause chain for:
30
30
 
31
31
  When the error is retryable, the processor returns `{ retry: true }`. It doesn't mutate messages.
32
32
 
33
+ When `delayMs` is set, the processor waits before signaling a retry. This is useful for transient network errors like `ECONNRESET` where immediately retrying is likely to fail again. The delay can be a fixed number of milliseconds or a function evaluated with the error args (for example, to implement exponential backoff).
34
+
35
+ ## Delaying retries
36
+
37
+ Use `delayMs` with a custom matcher to retry transient network resets with a wait:
38
+
39
+ ```typescript
40
+ import { Agent } from '@mastra/core/agent'
41
+ import { StreamErrorRetryProcessor } from '@mastra/core/processors'
42
+
43
+ const isECONNRESET = (error: unknown) => {
44
+ if (!error || typeof error !== 'object') return false
45
+ const code = (error as { code?: unknown }).code
46
+ if (typeof code === 'string' && code.toUpperCase() === 'ECONNRESET') return true
47
+ const message = error instanceof Error ? error.message : undefined
48
+ return typeof message === 'string' && /econnreset|socket hang up/i.test(message)
49
+ }
50
+
51
+ export const agent = new Agent({
52
+ name: 'resilient-agent',
53
+ instructions: 'You are a helpful assistant.',
54
+ model: 'openai/gpt-5',
55
+ errorProcessors: [
56
+ new StreamErrorRetryProcessor({
57
+ maxRetries: 2,
58
+ delayMs: ({ retryCount }) => Math.min(1000 * 2 ** retryCount, 30000),
59
+ matchers: [isECONNRESET],
60
+ }),
61
+ ],
62
+ })
63
+ ```
64
+
33
65
  ## Default OpenAI Responses matcher
34
66
 
35
67
  `isRetryableOpenAIResponsesStreamError` matches OpenAI Responses stream error chunks with `type: 'error'` or `type: 'response.failed'`. It retries known transient OpenAI error codes and, as a fallback, errors with explicit retry guidance such as `You can retry your request`.
@@ -137,6 +137,6 @@ const result = await output.result
137
137
 
138
138
  - [Run.timeTravel()](https://mastra.ai/reference/workflows/run-methods/timeTravel)
139
139
  - [Time Travel](https://mastra.ai/docs/workflows/time-travel)
140
- - [Workflow Streaming](https://mastra.ai/docs/streaming/workflow-streaming)
140
+ - [Workflow Streaming](https://mastra.ai/docs/workflows/overview)
141
141
  - [Run.stream()](https://mastra.ai/reference/streaming/workflows/stream)
142
142
  - [Run.resumeStream()](https://mastra.ai/reference/streaming/workflows/resumeStream)
@@ -445,5 +445,5 @@ These annotations follow the [MCP specification](https://spec.modelcontextprotoc
445
445
  - [MCP Overview](https://mastra.ai/docs/mcp/overview)
446
446
  - [Using Tools with Agents](https://mastra.ai/docs/agents/using-tools)
447
447
  - [Agent Approval](https://mastra.ai/docs/agents/agent-approval)
448
- - [Tool Streaming](https://mastra.ai/docs/streaming/tool-streaming)
448
+ - [Tool Streaming](https://mastra.ai/docs/agents/using-tools)
449
449
  - [Request Context](https://mastra.ai/docs/server/request-context)
@@ -55,5 +55,5 @@ A workflow run's `status` indicates its current execution state. The possible va
55
55
  - [Run.cancel()](https://mastra.ai/reference/workflows/run-methods/cancel)
56
56
  - [Run.restart()](https://mastra.ai/reference/workflows/run-methods/restart)
57
57
  - [Run.timeTravel()](https://mastra.ai/reference/workflows/run-methods/timeTravel)
58
- - [Run.stream()](https://mastra.ai/docs/streaming/workflow-streaming)
58
+ - [Run.stream()](https://mastra.ai/docs/workflows/overview)
59
59
  - [Run.timeTravelStream()](https://mastra.ai/reference/streaming/workflows/timeTravelStream)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.1-alpha.5
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`5c4e9a4`](https://github.com/mastra-ai/mastra/commit/5c4e9a4cfb2216bb3ea7f8988ad3727f3b92bb3a), [`25961e3`](https://github.com/mastra-ai/mastra/commit/25961e3260ff3b1464637af8fcdb36210551c39f), [`7b29f33`](https://github.com/mastra-ai/mastra/commit/7b29f332a357a83e555f29e718e5f2fab9979943), [`24912b1`](https://github.com/mastra-ai/mastra/commit/24912b1f855d29ec36af4ef4bde1f7417e20cdf5), [`7686216`](https://github.com/mastra-ai/mastra/commit/7686216f37e74568feddec17cef3c3d24e10e60a), [`975c59a`](https://github.com/mastra-ai/mastra/commit/975c59ae363ee275fc55062392e1ffd2cbccbd53), [`d95f394`](https://github.com/mastra-ai/mastra/commit/d95f394fd24c8411886930d727679c4d5252aa26), [`f3f0c9d`](https://github.com/mastra-ai/mastra/commit/f3f0c9d7c878db5a13177871ce3523a14f14b311)]:
8
+ - @mastra/core@1.46.0-alpha.4
9
+
10
+ ## 1.2.1-alpha.3
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`65f255a`](https://github.com/mastra-ai/mastra/commit/65f255a38667beb6ceeadabfa9eb5059bfec8298), [`4a88c6e`](https://github.com/mastra-ai/mastra/commit/4a88c6e2bdce316f8d7551b4ec3449b0b06fc71c), [`87a17ef`](https://github.com/mastra-ai/mastra/commit/87a17efbd725aca6639febdc5e69e2abb3048689), [`e11ff30`](https://github.com/mastra-ai/mastra/commit/e11ff301408bf1731dca2fb7fbfcd8c819500a35), [`9d2c946`](https://github.com/mastra-ai/mastra/commit/9d2c946d0859e90ae4bcec5beeb1da7398d2ad1e), [`f1ec385`](https://github.com/mastra-ai/mastra/commit/f1ec385386f62b1a0847ec5353ae2bb169d1c3d9), [`e14986f`](https://github.com/mastra-ai/mastra/commit/e14986f6e5478d6384d04ff9a7f9a79a46a8b529), [`0be490f`](https://github.com/mastra-ai/mastra/commit/0be490fabb538c5a7de796ea0aff7d04a0bea1f3), [`0be490f`](https://github.com/mastra-ai/mastra/commit/0be490fabb538c5a7de796ea0aff7d04a0bea1f3), [`974f614`](https://github.com/mastra-ai/mastra/commit/974f614e083bd68278536f94453f7b320b86a3c7), [`31be1cf`](https://github.com/mastra-ai/mastra/commit/31be1cf5f2a7b5eef12f6123a40653b4d8115c16)]:
15
+ - @mastra/core@1.46.0-alpha.3
16
+
3
17
  ## 1.2.1-alpha.2
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.2.1-alpha.2",
3
+ "version": "1.2.1-alpha.5",
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.46.0-alpha.2",
32
- "@mastra/mcp": "^1.12.0-alpha.0"
31
+ "@mastra/mcp": "^1.12.0-alpha.0",
32
+ "@mastra/core": "1.46.0-alpha.4"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^1.19.11",
@@ -47,7 +47,7 @@
47
47
  "vitest": "4.1.8",
48
48
  "@internal/types-builder": "0.0.82",
49
49
  "@internal/lint": "0.0.107",
50
- "@mastra/core": "1.46.0-alpha.2"
50
+ "@mastra/core": "1.46.0-alpha.4"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {