@mastra/mcp-docs-server 1.2.17-alpha.17 → 1.2.17-alpha.19

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.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Mastra supports the [Agent Client Protocol (ACP)](https://agentclientprotocol.com/overview/introduction) for running ACP-compatible coding agents from a Mastra agent. Use `@mastra/acp` to wrap a coding agent process as a Mastra tool or as a subagent.
6
6
 
7
- ACP is useful for coding agents such as Claude Code, Amp, Codex, or any other executable that implements ACP over standard input and output.
7
+ ACP is useful for coding agents such as Claude Code, Cline, OpenCode, Amp, Codex, or any other executable that implements ACP over standard input and output.
8
8
 
9
9
  ## When to use ACP
10
10
 
@@ -30,6 +30,18 @@ The flow is:
30
30
 
31
31
  During execution, the ACP client also handles permission requests and file operations. File reads and writes go through Mastra's `Workspace`, so the ACP agent operates inside the workspace you provide.
32
32
 
33
+ ## Compatible agents
34
+
35
+ Any executable that implements ACP over standard input and output works with `@mastra/acp`. You don't need a dedicated Mastra package for each agent. Install the agent, then pass its launch command through `command` and `args`.
36
+
37
+ | Agent | `command` | `args` |
38
+ | ---------- | ---------- | ----------- |
39
+ | Cline | `cline` | `['--acp']` |
40
+ | OpenCode | `opencode` | `['acp']` |
41
+ | Gemini CLI | `gemini` | `['--acp']` |
42
+
43
+ Each agent documents its own ACP mode, and launch flags change between releases. Check the agent's documentation for the current command, such as [Cline ACP](https://docs.cline.bot/usage/acp) or [OpenCode ACP](https://opencode.ai/docs/acp/).
44
+
33
45
  ## Getting started
34
46
 
35
47
  Install `@mastra/acp` in a project that already uses `@mastra/core`. The package requires `@mastra/core` version `1.34.0` or later.
@@ -75,8 +87,8 @@ const codeAgent = new AcpAgent({
75
87
  id: 'code-agent',
76
88
  name: 'Code Agent',
77
89
  description: 'An ACP-compatible coding agent that can inspect and edit files',
78
- command: 'acp-agent',
79
- args: ['--stdio'],
90
+ command: 'opencode',
91
+ args: ['acp'],
80
92
  cwd: process.cwd(),
81
93
  })
82
94
 
@@ -104,8 +116,8 @@ import { Agent } from '@mastra/core/agent'
104
116
  const codeAgentTool = createACPTool({
105
117
  id: 'code-agent',
106
118
  description: 'Use an ACP-compatible coding agent to inspect and edit code',
107
- command: 'acp-agent',
108
- args: ['--stdio'],
119
+ command: 'opencode',
120
+ args: ['acp'],
109
121
  cwd: process.cwd(),
110
122
  })
111
123
 
@@ -6,7 +6,7 @@ Connections let Mastra work with remote agents, coding agents, provider software
6
6
 
7
7
  - [**Model Context Protocol (MCP)**](https://mastra.ai/docs/connections/mcp): Connect agents to external tools and resources, or expose Mastra agents, tools, workflows, prompts, and resources to MCP-compatible systems.
8
8
  - [**Agent-to-Agent (A2A)**](https://mastra.ai/docs/connections/a2a): Expose or consume remote agents across service, framework, vendor, and language boundaries.
9
- - [**Agent Client Protocol (ACP)**](https://mastra.ai/docs/connections/acp): Run compatible coding-agent processes as Mastra tools or subagents.
9
+ - [**Agent Client Protocol (ACP)**](https://mastra.ai/docs/connections/acp): Run compatible coding-agent processes, such as Claude Code, Cline, or OpenCode, as Mastra tools or subagents.
10
10
  - [**SDK agents**](https://mastra.ai/docs/connections/sdk-agents): Register Claude, Cursor, or OpenAI SDK-backed agents while the provider SDK retains control of the runtime, tools, permissions, and agent loop.
11
11
 
12
12
  ## When to use connections
@@ -17,6 +17,8 @@ SDK agents let you use other agent SDK frameworks inside Mastra. Use them to reg
17
17
  - [Cursor Agent SDK](#cursor-agent-sdk): Use `@mastra/cursor` to register a Cursor SDK agent and call it with Mastra `generate()` and `stream()`.
18
18
  - [OpenAI Agents SDK](#openai-agents-sdk): Use `@mastra/openai` to register an OpenAI SDK agent and call it with Mastra `generate()` and `stream()`.
19
19
 
20
+ Coding agents without a dedicated Mastra package, such as Cline and OpenCode, run through the [Agent Client Protocol](https://mastra.ai/docs/connections/acp) instead.
21
+
20
22
  ## Claude Agent SDK
21
23
 
22
24
  Use `@mastra/claude` for Claude Code runtime configuration, permissions, tools, and agent-loop behavior.
@@ -21,5 +21,6 @@ The following pages show you how to deploy Mastra to specific cloud providers.
21
21
  - [Inngest](https://mastra.ai/integrations/deploy/inngest)
22
22
  - [Kubernetes](https://mastra.ai/integrations/deploy/kubernetes)
23
23
  - [Netlify](https://mastra.ai/integrations/deploy/netlify)
24
+ - [Render](https://mastra.ai/integrations/deploy/render)
24
25
  - [Temporal](https://mastra.ai/integrations/deploy/temporal)
25
26
  - [Vercel](https://mastra.ai/integrations/deploy/vercel)
@@ -52,6 +52,7 @@ Use this option for auto-scaling, minimal infrastructure management, or when you
52
52
  - [Inngest](https://mastra.ai/integrations/deploy/inngest)
53
53
  - [Kubernetes](https://mastra.ai/integrations/deploy/kubernetes)
54
54
  - [Netlify](https://mastra.ai/integrations/deploy/netlify)
55
+ - [Render](https://mastra.ai/integrations/deploy/render)
55
56
  - [Temporal](https://mastra.ai/integrations/deploy/temporal)
56
57
  - [Vercel](https://mastra.ai/integrations/deploy/vercel)
57
58
 
@@ -118,6 +118,22 @@ const agent = new Agent({
118
118
  export const eventedWriter = createEventedAgent({ agent })
119
119
  ```
120
120
 
121
+ ### Stored agents created through the API
122
+
123
+ Agents created with [`createStoredAgent()`](https://mastra.ai/reference/client-js/agents) opt in with a `durable` field on the agent config. The server wraps the agent with `createDurableAgent()` when it hydrates it, so no code deployment is needed:
124
+
125
+ ```typescript
126
+ await mastraClient.createStoredAgent({
127
+ id: 'helper',
128
+ name: 'Helper',
129
+ instructions: 'You are a helpful assistant.',
130
+ model: { provider: 'openai', name: 'gpt-5' },
131
+ durable: true,
132
+ })
133
+ ```
134
+
135
+ `durable` also accepts `{ maxSteps, cleanupTimeoutMs }`. Cache and pubsub are inherited from the server's `Mastra` instance, so configure distributed backends there if you need durability across replicas. Automatic recovery is still configured in code through `recovery.durableAgents`.
136
+
121
137
  ### Inngest-powered with `createInngestAgent()`
122
138
 
123
139
  Run the workflow on the [Inngest](https://www.inngest.com/docs) platform. Each tool call becomes a memoized step that Inngest can retry independently, and you get a dashboard for monitoring runs:
@@ -111,6 +111,7 @@ Use a remote or container backend when commands need a stronger boundary from th
111
111
  - [AgentCore](https://mastra.ai/integrations/sandboxes/agentcore)
112
112
  - [Apple Container](https://mastra.ai/integrations/sandboxes/apple-container)
113
113
  - [Blaxel](https://mastra.ai/integrations/sandboxes/blaxel)
114
+ - [Cloudflare Sandbox](https://mastra.ai/integrations/sandboxes/cloudflare-sandbox)
114
115
  - [Daytona](https://mastra.ai/integrations/sandboxes/daytona)
115
116
  - [Docker](https://mastra.ai/integrations/sandboxes/docker)
116
117
  - [E2B](https://mastra.ai/integrations/sandboxes/e2b)
@@ -0,0 +1,389 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Render
4
+
5
+ Deploy Mastra applications on [Render](https://render.com/). Host the Mastra API as a [web service](https://render.com/docs/web-services), or use [Render Workflows](https://render.com/docs/workflows) for long-running tasks with independent retry policies.
6
+
7
+ Choose the deployment path that fits your application:
8
+
9
+ - **Mastra API**: Deploy Mastra's [server](https://mastra.ai/docs/server/overview) as a web service with a public endpoint. The [Web Services guide](https://render.com/docs/web-services) explains how to deploy custom code or a supported [server adapter](https://mastra.ai/docs/server/server-adapters).
10
+ - **Mastra workflow**: Run an entire Mastra workflow within one task. Render controls the outer run, while Mastra manages its steps and state. See [Defining Workflow Tasks](https://render.com/docs/workflows-defining) for configuration details.
11
+ - **Distributed agent operations**: Give each operation its own compute plan, timeout, and retry policy. Render Workflows handles the execution queue and provides run observability.
12
+
13
+ This guide builds an editorial pipeline that reviews a draft from three perspectives in parallel, then passes the feedback to an editor agent. Use the links above if you want to deploy a Mastra API or execute an entire Mastra workflow as one task.
14
+
15
+ ## How Render Workflows integrates with Mastra
16
+
17
+ Mastra supplies the agents and application logic, while Render Workflows defines the execution boundaries. A typical pipeline has three layers:
18
+
19
+ 1. A parent task coordinates the run.
20
+ 2. Child tasks invoke Mastra agents for focused work.
21
+ 3. A final task combines the results.
22
+
23
+ Calling one task from another creates a chained run in a separate instance, with its own compute plan, timeout, and retry policy.
24
+
25
+ ## Setup
26
+
27
+ Create an empty Mastra project named `render-workflows`:
28
+
29
+ **npm**:
30
+
31
+ ```bash
32
+ npm create mastra@latest render-workflows -- --empty
33
+ ```
34
+
35
+ **pnpm**:
36
+
37
+ ```bash
38
+ pnpm create mastra render-workflows --empty
39
+ ```
40
+
41
+ **Yarn**:
42
+
43
+ ```bash
44
+ yarn create mastra render-workflows --empty
45
+ ```
46
+
47
+ **Bun**:
48
+
49
+ ```bash
50
+ bunx create-mastra render-workflows --empty
51
+ ```
52
+
53
+ Install two additional dependencies:
54
+
55
+ **npm**:
56
+
57
+ ```bash
58
+ npm install @renderinc/sdk tsx
59
+ ```
60
+
61
+ **pnpm**:
62
+
63
+ ```bash
64
+ pnpm add @renderinc/sdk tsx
65
+ ```
66
+
67
+ **Yarn**:
68
+
69
+ ```bash
70
+ yarn add @renderinc/sdk tsx
71
+ ```
72
+
73
+ **Bun**:
74
+
75
+ ```bash
76
+ bun add @renderinc/sdk tsx
77
+ ```
78
+
79
+ Add your API key to an `.env` file. This example uses OpenAI, but any supported [model provider](https://mastra.ai/models) works.
80
+
81
+ ```text
82
+ OPENAI_API_KEY=your_openai_api_key
83
+ ```
84
+
85
+ Install the [Render CLI](https://render.com/docs/cli) to run workflow commands from your terminal.
86
+
87
+ ## Distributed agent pipeline
88
+
89
+ ### Create the agents
90
+
91
+ In `src/mastra`, create an `agents` directory with `reviewer-agent.ts` and `editor-agent.ts`. Define both agents:
92
+
93
+ ```ts
94
+ import { Agent } from '@mastra/core/agent'
95
+
96
+ export const reviewerAgent = new Agent({
97
+ id: 'reviewer-agent',
98
+ name: 'Reviewer Agent',
99
+ model: 'openai/gpt-5.6-sol',
100
+ instructions: `
101
+ Review the supplied draft only from the requested perspective.
102
+ Identify concrete problems and recommend specific changes.
103
+ Do not rewrite the full draft.
104
+ `,
105
+ })
106
+ ```
107
+
108
+ ```ts
109
+ import { Agent } from '@mastra/core/agent'
110
+
111
+ export const editorAgent = new Agent({
112
+ id: 'editor-agent',
113
+ name: 'Editor Agent',
114
+ model: 'openai/gpt-5.6-sol',
115
+ instructions: `
116
+ Revise the supplied draft using the reviewers' feedback.
117
+ Return the complete revised draft and nothing else.
118
+ Preserve accurate details and do not introduce unsupported claims.
119
+ `,
120
+ })
121
+ ```
122
+
123
+ ### Configure the Mastra instance
124
+
125
+ Add both agents to the Mastra instance in `src/mastra/index.ts`:
126
+
127
+ ```ts
128
+ import { Mastra } from '@mastra/core/mastra'
129
+ import { editorAgent } from './agents/editor-agent.js'
130
+ import { reviewerAgent } from './agents/reviewer-agent.js'
131
+
132
+ export const mastra = new Mastra({
133
+ agents: {
134
+ editorAgent,
135
+ reviewerAgent,
136
+ },
137
+ })
138
+ ```
139
+
140
+ ### Create the tasks
141
+
142
+ In `src`, create a `tasks` directory with `review-task.ts`, `revision-task.ts`, and `editorial-task.ts`.
143
+
144
+ #### Review task
145
+
146
+ The reviewer agent handles one area of focus. Its compute plan, five-minute timeout, and retry policy apply only to that analysis. A temporary model-provider failure can trigger another attempt without restarting the other reviewers.
147
+
148
+ ```typescript
149
+ import { task } from '@renderinc/sdk/workflows'
150
+ import { mastra } from '../mastra/index.js'
151
+
152
+ type Review = {
153
+ focus: string
154
+ feedback: string
155
+ }
156
+
157
+ export const reviewDraft = task(
158
+ {
159
+ name: 'review_draft',
160
+ plan: 'starter',
161
+ timeoutSeconds: 300,
162
+ retry: {
163
+ maxRetries: 2,
164
+ waitDurationMs: 1_000,
165
+ backoffScaling: 2,
166
+ },
167
+ },
168
+ async function reviewDraft(draft: string, focus: string): Promise<Review> {
169
+ const reviewer = mastra.getAgentById('reviewer-agent')
170
+ const response = await reviewer.generate(`
171
+ Review this draft for ${focus}.
172
+ Draft: ${draft}
173
+ `)
174
+ if (!response.text) {
175
+ throw new Error(`The ${focus} review returned no text`)
176
+ }
177
+ return {
178
+ focus,
179
+ feedback: response.text,
180
+ }
181
+ },
182
+ )
183
+ ```
184
+
185
+ #### Revision task
186
+
187
+ This task combines the feedback and produces a revised draft. It uses a larger compute plan and a longer timeout than each reviewer.
188
+
189
+ ```typescript
190
+ import { task } from '@renderinc/sdk/workflows'
191
+ import { mastra } from '../mastra/index.js'
192
+
193
+ type Review = {
194
+ focus: string
195
+ feedback: string
196
+ }
197
+
198
+ export const reviseDraft = task(
199
+ {
200
+ name: 'revise_draft',
201
+ plan: 'standard',
202
+ timeoutSeconds: 600,
203
+ retry: {
204
+ maxRetries: 2,
205
+ waitDurationMs: 1_000,
206
+ backoffScaling: 2,
207
+ },
208
+ },
209
+ async function reviseDraft(draft: string, reviews: Review[]): Promise<{ draft: string }> {
210
+ const editor = mastra.getAgentById('editor-agent')
211
+ const response = await editor.generate(`
212
+ Revise the draft using the review feedback.
213
+ Draft: ${draft}
214
+ Reviews: ${JSON.stringify(reviews, null, 2)}
215
+ `)
216
+ if (!response.text) {
217
+ throw new Error('The editor returned no text')
218
+ }
219
+ return {
220
+ draft: response.text,
221
+ }
222
+ },
223
+ )
224
+ ```
225
+
226
+ #### Editorial task
227
+
228
+ The parent dispatches three reviews in parallel with `Promise.all()`, then sends their combined feedback to the revision step. Retries are disabled at this level because each child defines its own policy. If you enable orchestration retries, ensure that another attempt can't duplicate external side effects or other non-idempotent work.
229
+
230
+ ```typescript
231
+ import { task } from '@renderinc/sdk/workflows'
232
+ import { reviewDraft } from './review-task.js'
233
+ import { reviseDraft } from './revision-task.js'
234
+
235
+ export const editorialPipeline = task(
236
+ {
237
+ name: 'editorial_pipeline',
238
+ plan: 'starter',
239
+ timeoutSeconds: 1_200,
240
+ retry: {
241
+ maxRetries: 0,
242
+ waitDurationMs: 1_000,
243
+ backoffScaling: 2,
244
+ },
245
+ },
246
+ async function editorialPipeline(draft: string): Promise<{ draft: string }> {
247
+ const focuses = ['technical clarity', 'structure and flow', 'reader usefulness']
248
+ const reviews = await Promise.all(focuses.map(focus => reviewDraft(draft, focus)))
249
+ return reviseDraft(draft, reviews)
250
+ },
251
+ )
252
+ ```
253
+
254
+ ### Set up the entry point
255
+
256
+ Create `src/index.ts` and import the editorial task:
257
+
258
+ ```ts
259
+ import './tasks/editorial-task.js'
260
+ ```
261
+
262
+ In `package.json`, add scripts to build the TypeScript project and run the workflow:
263
+
264
+ ```json
265
+ {
266
+ "scripts": {
267
+ "build": "tsc",
268
+ "dev:workflows": "tsx src/index.ts",
269
+ "start:workflows": "node dist/index.js"
270
+ }
271
+ }
272
+ ```
273
+
274
+ Configure `tsconfig.json` for the build:
275
+
276
+ ```json
277
+ {
278
+ "compilerOptions": {
279
+ "target": "ES2022",
280
+ "module": "NodeNext",
281
+ "moduleResolution": "NodeNext",
282
+ "rootDir": "src",
283
+ "outDir": "dist",
284
+ "strict": true,
285
+ "esModuleInterop": true,
286
+ "skipLibCheck": true
287
+ },
288
+ "include": ["src/**/*"]
289
+ }
290
+ ```
291
+
292
+ Build the project. The command compiles the JavaScript files into `dist`.
293
+
294
+ **npm**:
295
+
296
+ ```bash
297
+ npm run build
298
+ ```
299
+
300
+ **pnpm**:
301
+
302
+ ```bash
303
+ pnpm run build
304
+ ```
305
+
306
+ **Yarn**:
307
+
308
+ ```bash
309
+ yarn build
310
+ ```
311
+
312
+ **Bun**:
313
+
314
+ ```bash
315
+ bun run build
316
+ ```
317
+
318
+ ## Run the pipeline
319
+
320
+ ### Locally
321
+
322
+ Start the local development server with the Render CLI:
323
+
324
+ ```bash
325
+ render workflows dev -- npm run dev:workflows
326
+ ```
327
+
328
+ The server lists the registered tasks:
329
+
330
+ ```bash
331
+ ➜ render workflows dev -- npm run dev:workflows
332
+ Workflow server listening on port 8120
333
+ Loaded environment variables from .env
334
+ 3 tasks found in npm run dev:workflows
335
+ • editorial_pipeline
336
+ • review_draft
337
+ • revise_draft
338
+
339
+ To browse and run tasks, open another terminal and run:
340
+ render workflows tasks list --local
341
+ ```
342
+
343
+ In another terminal, confirm that the tasks are available:
344
+
345
+ ```bash
346
+ render workflows tasks list --local
347
+ ```
348
+
349
+ The command displays each task's name, ID, and creation time. Press `Ctrl+C`, then start the editorial pipeline from the same terminal:
350
+
351
+ ```bash
352
+ render workflows tasks runs start editorial_pipeline \
353
+ --local \
354
+ --input='["Render Workflows runs long-running tasks outside the request lifecycle."]'
355
+ ```
356
+
357
+ The development server records the parent run, three parallel reviews, and the final revision.
358
+
359
+ ### Production
360
+
361
+ Create a workflow service from the current repository:
362
+
363
+ ```bash
364
+ render workflows create \
365
+ --name mastra-workflows \
366
+ --repo . \
367
+ --runtime node \
368
+ --build-command "npm install && npm run build" \
369
+ --run-command "npm run start:workflows"
370
+ ```
371
+
372
+ Add `OPENAI_API_KEY`, or the key for your chosen model provider, to the service's environment variables.
373
+
374
+ After deployment, start a production run. If needed, replace `mastra-workflows/editorial_pipeline` with the task slug shown in the Render Dashboard.
375
+
376
+ ```bash
377
+ render workflows tasks start mastra-workflows/editorial_pipeline \
378
+ --input='["Render Workflows runs long-running tasks outside the request lifecycle."]'
379
+ ```
380
+
381
+ Open the workflow service in the Render Dashboard to inspect each task run, attempt, result, and log stream.
382
+
383
+ ## Related
384
+
385
+ - [Render Workflows documentation](https://render.com/docs/workflows)
386
+ - [Defining Render workflow tasks](https://render.com/docs/workflows-defining)
387
+ - [Triggering task runs](https://render.com/docs/workflows-running)
388
+ - [Render Workflows TypeScript SDK](https://render.com/docs/workflows-sdk-typescript)
389
+ - [Render Workflows limits and pricing](https://render.com/docs/workflows-limits)
@@ -0,0 +1,118 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # Cloudflare Sandbox
4
+
5
+ `CloudflareSandbox` executes commands and manages files in a remote [Cloudflare Sandbox](https://developers.cloudflare.com/sandbox/) through the [Sandbox Bridge HTTP API](https://developers.cloudflare.com/sandbox/bridge/http-api/).
6
+
7
+ > **Warning:** Deploy and secure a [Sandbox Bridge Worker](https://developers.cloudflare.com/sandbox/bridge/) before using this provider. The bridge can create and delete sandboxes, execute commands, and write files on behalf of its callers.
8
+
9
+ ## Installation
10
+
11
+ **npm**:
12
+
13
+ ```bash
14
+ npm install @mastra/cloudflare-sandbox
15
+ ```
16
+
17
+ **pnpm**:
18
+
19
+ ```bash
20
+ pnpm add @mastra/cloudflare-sandbox
21
+ ```
22
+
23
+ **Yarn**:
24
+
25
+ ```bash
26
+ yarn add @mastra/cloudflare-sandbox
27
+ ```
28
+
29
+ **Bun**:
30
+
31
+ ```bash
32
+ bun add @mastra/cloudflare-sandbox
33
+ ```
34
+
35
+ ## Usage
36
+
37
+ Add `CloudflareSandbox` to a workspace and assign it to an agent:
38
+
39
+ ```typescript
40
+ import { Agent } from '@mastra/core/agent'
41
+ import { Workspace } from '@mastra/core/workspace'
42
+ import { CloudflareSandbox } from '@mastra/cloudflare-sandbox'
43
+
44
+ const workspace = new Workspace({
45
+ sandbox: new CloudflareSandbox({
46
+ baseUrl: process.env.CLOUDFLARE_SANDBOX_BRIDGE_URL!,
47
+ apiToken: process.env.CLOUDFLARE_SANDBOX_API_KEY,
48
+ workingDirectory: '/workspace',
49
+ commandTimeout: 300_000,
50
+ }),
51
+ })
52
+
53
+ export const agent = new Agent({
54
+ id: 'dev-agent',
55
+ name: 'Development agent',
56
+ instructions: 'You are a helpful development assistant.',
57
+ model: 'anthropic/claude-sonnet-4-6',
58
+ workspace,
59
+ })
60
+ ```
61
+
62
+ The provider creates a remote sandbox when the workspace starts. Pass `sandboxId` to reconnect to an existing sandbox instead.
63
+
64
+ ## Execute commands
65
+
66
+ Pass command arguments, environment variables, a working directory, and streaming callbacks through `executeCommand()`. The provider sends the command as an `argv` array, so the bridge handles shell escaping:
67
+
68
+ ```typescript
69
+ const result = await workspace.sandbox?.executeCommand?.('npm', ['test'], {
70
+ cwd: '/workspace/project',
71
+ env: {
72
+ NODE_ENV: 'test',
73
+ },
74
+ onStdout: chunk => process.stdout.write(chunk),
75
+ onStderr: chunk => process.stderr.write(chunk),
76
+ })
77
+ ```
78
+
79
+ ## Write files
80
+
81
+ Relative paths are resolved under `/workspace`. Absolute paths must also resolve within `/workspace`. Each file is sent as its own bridge request, and the bridge caps a single file at 32 MiB.
82
+
83
+ ```typescript
84
+ await workspace.sandbox?.writeFiles?.([
85
+ { path: 'src/index.ts', content: "console.log('hello')\n" },
86
+ { path: '/workspace/package.json', content: JSON.stringify({ type: 'module' }) },
87
+ ])
88
+ ```
89
+
90
+ ## Constructor parameters
91
+
92
+ **baseUrl** (`string`): URL of the deployed Cloudflare Sandbox Bridge Worker.
93
+
94
+ **apiToken** (`string`): Bearer token matching the Worker's SANDBOX\_API\_KEY secret.
95
+
96
+ **sandboxId** (`string`): Existing Cloudflare sandbox ID to reconnect to instead of creating a sandbox.
97
+
98
+ **id** (`string`): Stable Mastra identifier. Defaults to a generated UUID-based value.
99
+
100
+ **name** (`string`): Human-readable sandbox name. (Default: `Cloudflare Sandbox`)
101
+
102
+ **env** (`Record<string, string>`): Environment variables applied to every command.
103
+
104
+ **workingDirectory** (`string`): Working directory applied to every command.
105
+
106
+ **commandTimeout** (`number`): Default command timeout in milliseconds. (Default: `300000`)
107
+
108
+ **instructions** (`string | ((options) => string)`): Custom instructions returned by getInstructions().
109
+
110
+ ## Lifecycle behavior
111
+
112
+ - `start()`: Reconnects to `sandboxId` or creates a remote sandbox.
113
+ - `stop()`: Detaches the Mastra lifecycle without deleting the remote sandbox because the bridge doesn't expose a suspend operation.
114
+ - `destroy()`: Deletes the remote sandbox.
115
+
116
+ ## Limitations
117
+
118
+ The provider supports command execution, streamed output, and file writes. It doesn't currently expose the bridge's bucket mounts, sessions, PTY terminals, or workspace persistence routes, and it doesn't support background process management, stdin, snapshots, or port URLs.
@@ -36,6 +36,7 @@
36
36
  - [AgentCore](https://mastra.ai/integrations/sandboxes/agentcore)
37
37
  - [Apple Container](https://mastra.ai/integrations/sandboxes/apple-container)
38
38
  - [Blaxel](https://mastra.ai/integrations/sandboxes/blaxel)
39
+ - [Cloudflare Sandbox](https://mastra.ai/integrations/sandboxes/cloudflare-sandbox)
39
40
  - [Daytona](https://mastra.ai/integrations/sandboxes/daytona)
40
41
  - [Docker](https://mastra.ai/integrations/sandboxes/docker)
41
42
  - [E2B](https://mastra.ai/integrations/sandboxes/e2b)
@@ -90,6 +91,7 @@
90
91
  - [Kubernetes](https://mastra.ai/integrations/deploy/kubernetes)
91
92
  - [Mastra](https://mastra.ai/docs/mastra-platform/deploy)
92
93
  - [Netlify](https://mastra.ai/integrations/deploy/netlify)
94
+ - [Render](https://mastra.ai/integrations/deploy/render)
93
95
  - [Temporal](https://mastra.ai/integrations/deploy/temporal)
94
96
  - [Vercel](https://mastra.ai/integrations/deploy/vercel)
95
97
 
@@ -79,6 +79,7 @@ List of required environment variables for each model provider and gateway suppo
79
79
  | [Kenari](https://mastra.ai/models/providers/kenari) | `kenari/*` | `KENARI_API_KEY` |
80
80
  | [Kilo Gateway](https://mastra.ai/models/providers/kilo) | `kilo/*` | `KILO_API_KEY` |
81
81
  | [Kimi For Coding](https://mastra.ai/models/providers/kimi-for-coding) | `kimi-for-coding/*` | `KIMI_API_KEY` |
82
+ | [Kosmik Compute](https://mastra.ai/models/providers/kosmik) | `kosmik/*` | `KOSMIK_API_KEY` |
82
83
  | [KUAE Cloud Coding Plan](https://mastra.ai/models/providers/kuae-cloud-coding-plan) | `kuae-cloud-coding-plan/*` | `KUAE_API_KEY` |
83
84
  | [Lilac](https://mastra.ai/models/providers/lilac) | `lilac/*` | `LILAC_API_KEY` |
84
85
  | [Llama](https://mastra.ai/models/providers/llama) | `llama/*` | `LLAMA_API_KEY` |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![OpenRouter logo](https://models.dev/logos/openrouter.svg)OpenRouter
4
4
 
5
- OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 352 models through Mastra's model router.
5
+ OpenRouter aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 350 models through Mastra's model router.
6
6
 
7
7
  Learn more in the [OpenRouter documentation](https://openrouter.ai/models).
8
8
 
@@ -149,7 +149,6 @@ ANTHROPIC_API_KEY=ant-...
149
149
  | `kwaipilot/kat-coder-air-v2.5` |
150
150
  | `kwaipilot/kat-coder-pro-v2` |
151
151
  | `kwaipilot/kat-coder-pro-v2.5` |
152
- | `liquid/lfm-2.5-2.6b:free` |
153
152
  | `mancer/weaver` |
154
153
  | `meituan/longcat-2.0` |
155
154
  | `meta-llama/llama-3.1-70b-instruct` |
@@ -386,5 +385,4 @@ ANTHROPIC_API_KEY=ant-...
386
385
  | `z-ai/glm-5-turbo` |
387
386
  | `z-ai/glm-5.1` |
388
387
  | `z-ai/glm-5.2` |
389
- | `z-ai/glm-5.2:free` |
390
388
  | `z-ai/glm-5v-turbo` |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Vercel logo](https://models.dev/logos/vercel.svg)Vercel
4
4
 
5
- Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 329 models through Mastra's model router.
5
+ Vercel aggregates models from multiple providers with enhanced features like rate limiting and failover. Access 347 models through Mastra's model router.
6
6
 
7
7
  Learn more in the [Vercel documentation](https://ai-sdk.dev/providers/ai-sdk-providers).
8
8
 
@@ -238,35 +238,51 @@ ANTHROPIC_API_KEY=ant-...
238
238
  | `openai/gpt-3.5-turbo` |
239
239
  | `openai/gpt-4-turbo` |
240
240
  | `openai/gpt-4.1` |
241
+ | `openai/gpt-4.1-fast` |
241
242
  | `openai/gpt-4.1-mini` |
243
+ | `openai/gpt-4.1-mini-fast` |
242
244
  | `openai/gpt-4.1-nano` |
245
+ | `openai/gpt-4.1-nano-fast` |
243
246
  | `openai/gpt-4o` |
247
+ | `openai/gpt-4o-fast` |
244
248
  | `openai/gpt-4o-mini` |
249
+ | `openai/gpt-4o-mini-fast` |
245
250
  | `openai/gpt-4o-mini-search-preview` |
246
251
  | `openai/gpt-4o-mini-transcribe` |
247
252
  | `openai/gpt-4o-transcribe` |
248
253
  | `openai/gpt-5` |
249
254
  | `openai/gpt-5-codex` |
255
+ | `openai/gpt-5-fast` |
250
256
  | `openai/gpt-5-mini` |
257
+ | `openai/gpt-5-mini-fast` |
251
258
  | `openai/gpt-5-nano` |
252
259
  | `openai/gpt-5-pro` |
253
260
  | `openai/gpt-5.1-codex` |
254
261
  | `openai/gpt-5.1-codex-max` |
255
262
  | `openai/gpt-5.1-codex-mini` |
256
263
  | `openai/gpt-5.1-thinking` |
264
+ | `openai/gpt-5.1-thinking-fast` |
257
265
  | `openai/gpt-5.2` |
258
266
  | `openai/gpt-5.2-codex` |
267
+ | `openai/gpt-5.2-fast` |
259
268
  | `openai/gpt-5.2-pro` |
260
269
  | `openai/gpt-5.3-codex` |
270
+ | `openai/gpt-5.3-codex-fast` |
261
271
  | `openai/gpt-5.4` |
272
+ | `openai/gpt-5.4-fast` |
262
273
  | `openai/gpt-5.4-mini` |
274
+ | `openai/gpt-5.4-mini-fast` |
263
275
  | `openai/gpt-5.4-nano` |
264
276
  | `openai/gpt-5.4-pro` |
265
277
  | `openai/gpt-5.5` |
278
+ | `openai/gpt-5.5-fast` |
266
279
  | `openai/gpt-5.5-pro` |
267
280
  | `openai/gpt-5.6-luna` |
281
+ | `openai/gpt-5.6-luna-fast` |
268
282
  | `openai/gpt-5.6-sol` |
283
+ | `openai/gpt-5.6-sol-fast` |
269
284
  | `openai/gpt-5.6-terra` |
285
+ | `openai/gpt-5.6-terra-fast` |
270
286
  | `openai/gpt-image-1` |
271
287
  | `openai/gpt-image-1-mini` |
272
288
  | `openai/gpt-image-1.5` |
@@ -282,9 +298,11 @@ ANTHROPIC_API_KEY=ant-...
282
298
  | `openai/o1` |
283
299
  | `openai/o3` |
284
300
  | `openai/o3-deep-research` |
301
+ | `openai/o3-fast` |
285
302
  | `openai/o3-mini` |
286
303
  | `openai/o3-pro` |
287
304
  | `openai/o4-mini` |
305
+ | `openai/o4-mini-fast` |
288
306
  | `openai/text-embedding-3-large` |
289
307
  | `openai/text-embedding-3-small` |
290
308
  | `openai/text-embedding-ada-002` |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # Model Providers
4
4
 
5
- Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 6076 models from 177 providers through a single API.
5
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 6097 models from 178 providers through a single API.
6
6
 
7
7
  ## Features
8
8
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Cloudflare Workers AI logo](https://models.dev/logos/cloudflare-workers-ai.svg)Cloudflare Workers AI
4
4
 
5
- Access 24 Cloudflare Workers AI models through Mastra's model router. Authentication is handled automatically using the `CLOUDFLARE_API_KEY` environment variable. Configure `CLOUDFLARE_ACCOUNT_ID` as well.
5
+ Access 25 Cloudflare Workers AI models through Mastra's model router. Authentication is handled automatically using the `CLOUDFLARE_API_KEY` environment variable. Configure `CLOUDFLARE_ACCOUNT_ID` as well.
6
6
 
7
7
  Learn more in the [Cloudflare Workers AI documentation](https://developers.cloudflare.com/workers-ai/models/).
8
8
 
@@ -58,6 +58,7 @@ for await (const chunk of stream) {
58
58
  | `cloudflare-workers-ai/@cf/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
59
59
  | `cloudflare-workers-ai/@cf/qwen/qwen2.5-coder-32b-instruct` | 33K | | | | | | $0.66 | $1 |
60
60
  | `cloudflare-workers-ai/@cf/qwen/qwen3-30b-a3b-fp8` | 33K | | | | | | $0.05 | $0.34 |
61
+ | `cloudflare-workers-ai/@cf/qwen/qwen3.8-27b` | 262K | | | | | | $0.45 | $3 |
61
62
  | `cloudflare-workers-ai/@cf/qwen/qwq-32b` | 24K | | | | | | $0.66 | $1 |
62
63
  | `cloudflare-workers-ai/@cf/zai-org/glm-4.7-flash` | 131K | | | | | | $0.06 | $0.40 |
63
64
  | `cloudflare-workers-ai/@cf/zai-org/glm-5.2` | 262K | | | | | | $1 | $4 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Deep Infra logo](https://models.dev/logos/deepinfra.svg)Deep Infra
4
4
 
5
- Access 59 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
5
+ Access 60 Deep Infra models through Mastra's model router. Authentication is handled automatically using the `DEEPINFRA_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Deep Infra documentation](https://deepinfra.com/models).
8
8
 
@@ -77,6 +77,7 @@ for await (const chunk of stream) {
77
77
  | `deepinfra/Qwen/Qwen3.6-35B-A3B` | 262K | | | | | | $0.10 | $0.95 |
78
78
  | `deepinfra/Qwen/Qwen3.7-Max` | 256K | | | | | | $3 | $8 |
79
79
  | `deepinfra/Qwen/Qwen3.8-2.4T-A95B` | 262K | | | | | | $2 | $6 |
80
+ | `deepinfra/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
80
81
  | `deepinfra/Qwen/Qwen3.8-Max` | 256K | | | | | | $2 | $5 |
81
82
  | `deepinfra/stepfun-ai/Step-3.7-Flash` | 262K | | | | | | $0.20 | $1 |
82
83
  | `deepinfra/tencent/Hy3` | 262K | | | | | | $0.14 | $0.58 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Eden AI logo](https://models.dev/logos/edenai.svg)Eden AI
4
4
 
5
- Access 232 Eden AI models through Mastra's model router. Authentication is handled automatically using the `EDENAI_API_KEY` environment variable.
5
+ Access 234 Eden AI models through Mastra's model router. Authentication is handled automatically using the `EDENAI_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Eden AI documentation](https://docs.edenai.co).
8
8
 
@@ -66,6 +66,7 @@ for await (const chunk of stream) {
66
66
  | `edenai/cloudflare/@cf/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
67
67
  | `edenai/cloudflare/@cf/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
68
68
  | `edenai/cloudflare/@cf/qwen/qwen2.5-coder-32b-instruct` | 33K | | | | | | $0.66 | $1 |
69
+ | `edenai/cloudflare/@cf/qwen/qwen3.8-27b` | 262K | | | | | | $0.45 | $3 |
69
70
  | `edenai/cloudflare/@cf/zai-org/glm-4.7-flash` | 131K | | | | | | $0.06 | $0.40 |
70
71
  | `edenai/cohere/command-a-03-2025` | 288K | | | | | | $3 | $10 |
71
72
  | `edenai/cohere/command-r-08-2024` | 128K | | | | | | $0.15 | $0.60 |
@@ -90,6 +91,7 @@ for await (const chunk of stream) {
90
91
  | `edenai/deepinfra/nvidia/Nemotron-3-Nano-30B-A3B` | 262K | | | | | | $0.05 | $0.20 |
91
92
  | `edenai/deepinfra/openai/gpt-oss-120b` | 131K | | | | | | $0.04 | $0.17 |
92
93
  | `edenai/deepinfra/openai/gpt-oss-20b` | 131K | | | | | | $0.03 | $0.14 |
94
+ | `edenai/deepinfra/Qwen/Qwen3.8-27B` | 262K | | | | | | $0.40 | $3 |
93
95
  | `edenai/deepinfra/stepfun-ai/Step-3.5-Flash` | 262K | | | | | | $0.09 | $0.30 |
94
96
  | `edenai/deepinfra/stepfun-ai/Step-3.7-Flash` | 262K | | | | | | $0.20 | $1 |
95
97
  | `edenai/deepinfra/tencent/Hy3` | 262K | | | | | | $0.14 | $0.58 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Kilo Gateway logo](https://models.dev/logos/kilo.svg)Kilo Gateway
4
4
 
5
- Access 360 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
5
+ Access 358 Kilo Gateway models through Mastra's model router. Authentication is handled automatically using the `KILO_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Kilo Gateway documentation](https://kilo.ai).
8
8
 
@@ -40,7 +40,7 @@ for await (const chunk of stream) {
40
40
  | `kilo/~anthropic/claude-haiku-latest` | 200K | | | | | | $1 | $5 |
41
41
  | `kilo/~anthropic/claude-opus-latest` | 1.0M | | | | | | $5 | $25 |
42
42
  | `kilo/~anthropic/claude-sonnet-latest` | 1.0M | | | | | | $2 | $10 |
43
- | `kilo/~deepseek/deepseek-v4-flash-latest` | 262K | | | | | | $0.08 | $0.16 |
43
+ | `kilo/~deepseek/deepseek-v4-flash-latest` | 1.0M | | | | | | $0.08 | $0.16 |
44
44
  | `kilo/~google/gemini-flash-latest` | 1.0M | | | | | | $0.38 | $2 |
45
45
  | `kilo/~google/gemini-pro-latest` | 1.0M | | | | | | $2 | $12 |
46
46
  | `kilo/~moonshotai/kimi-latest` | 975K | | | | | | $3 | $13 |
@@ -154,7 +154,6 @@ for await (const chunk of stream) {
154
154
  | `kilo/kwaipilot/kat-coder-air-v2.5` | 256K | | | | | | $0.15 | $0.60 |
155
155
  | `kilo/kwaipilot/kat-coder-pro-v2` | 256K | | | | | | $0.30 | $1 |
156
156
  | `kilo/kwaipilot/kat-coder-pro-v2.5` | 256K | | | | | | $0.74 | $3 |
157
- | `kilo/liquid/lfm-2.5-2.6b:free` | 128K | | | | | | — | — |
158
157
  | `kilo/mancer/weaver` | 8K | | | | | | $0.50 | $0.75 |
159
158
  | `kilo/meituan/longcat-2.0` | 1.0M | | | | | | $0.75 | $3 |
160
159
  | `kilo/meta-llama/llama-3.1-70b-instruct` | 131K | | | | | | $0.40 | $0.40 |
@@ -394,7 +393,6 @@ for await (const chunk of stream) {
394
393
  | `kilo/z-ai/glm-5-turbo` | 203K | | | | | | $1 | $4 |
395
394
  | `kilo/z-ai/glm-5.1` | 200K | | | | | | $1 | $4 |
396
395
  | `kilo/z-ai/glm-5.2` | 1.0M | | | | | | $1 | $4 |
397
- | `kilo/z-ai/glm-5.2:free` | 128K | | | | | | — | — |
398
396
  | `kilo/z-ai/glm-5v-turbo` | 203K | | | | | | $1 | $4 |
399
397
 
400
398
  ## Advanced configuration
@@ -0,0 +1,73 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # ![Kosmik Compute logo](https://models.dev/logos/kosmik.svg)Kosmik Compute
4
+
5
+ Access 1 Kosmik Compute model through Mastra's model router. Authentication is handled automatically using the `KOSMIK_API_KEY` environment variable.
6
+
7
+ Learn more in the [Kosmik Compute documentation](https://api.koscompute.com/docs/).
8
+
9
+ ```bash
10
+ KOSMIK_API_KEY=your-api-key
11
+ ```
12
+
13
+ ```typescript
14
+ import { Agent } from "@mastra/core/agent";
15
+
16
+ const agent = new Agent({
17
+ id: "my-agent",
18
+ name: "My Agent",
19
+ instructions: "You are a helpful assistant",
20
+ model: "kosmik/qwen/qwen3.8-27b"
21
+ });
22
+
23
+ // Generate a response
24
+ const response = await agent.generate("Hello!");
25
+
26
+ // Stream a response
27
+ const stream = await agent.stream("Tell me a story");
28
+ for await (const chunk of stream) {
29
+ console.log(chunk);
30
+ }
31
+ ```
32
+
33
+ > **Note:** Mastra uses the OpenAI-compatible `/chat/completions` endpoint. Some provider-specific features may not be available. Check the [Kosmik Compute documentation](https://api.koscompute.com/docs/) for details.
34
+
35
+ ## Models
36
+
37
+ | Model | Context | Tools | Reasoning | Image | Audio | Video | Input $/1M | Output $/1M |
38
+ | ------------------------- | ------- | ----- | --------- | ----- | ----- | ----- | ---------- | ----------- |
39
+ | `kosmik/qwen/qwen3.8-27b` | 262K | | | | | | $0.35 | $2 |
40
+
41
+ ## Advanced configuration
42
+
43
+ ### Custom headers
44
+
45
+ ```typescript
46
+ const agent = new Agent({
47
+ id: "custom-agent",
48
+ name: "custom-agent",
49
+ model: {
50
+ url: "https://api.koscompute.com/v1",
51
+ id: "kosmik/qwen/qwen3.8-27b",
52
+ apiKey: process.env.KOSMIK_API_KEY,
53
+ headers: {
54
+ "X-Custom-Header": "value"
55
+ }
56
+ }
57
+ });
58
+ ```
59
+
60
+ ### Dynamic model selection
61
+
62
+ ```typescript
63
+ const agent = new Agent({
64
+ id: "dynamic-agent",
65
+ name: "Dynamic Agent",
66
+ model: ({ requestContext }) => {
67
+ const useAdvanced = requestContext.task === "complex";
68
+ return useAdvanced
69
+ ? "kosmik/qwen/qwen3.8-27b"
70
+ : "kosmik/qwen/qwen3.8-27b";
71
+ }
72
+ });
73
+ ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Merge Gateway logo](https://models.dev/logos/merge-gateway.svg)Merge Gateway
4
4
 
5
- Access 171 Merge Gateway models through Mastra's model router. Authentication is handled automatically using the `MERGE_GATEWAY_API_KEY` environment variable.
5
+ Access 172 Merge Gateway models through Mastra's model router. Authentication is handled automatically using the `MERGE_GATEWAY_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Merge Gateway documentation](https://docs.merge.dev/merge-gateway).
8
8
 
@@ -183,6 +183,7 @@ for await (const chunk of stream) {
183
183
  | `merge-gateway/qwen/qwen3.7-plus` | 1.0M | | | | | | $0.40 | $2 |
184
184
  | `merge-gateway/qwen/qwen3.8-max` | 1.0M | | | | | | $2 | $6 |
185
185
  | `merge-gateway/sakana/fugu-ultra` | 1.0M | | | | | | $5 | $30 |
186
+ | `merge-gateway/sakana/sakana-namazu` | 262K | | | | | | $0.95 | $4 |
186
187
  | `merge-gateway/thinkingmachines/inkling` | 1.0M | | | | | | $1 | $4 |
187
188
  | `merge-gateway/writer/palmyra-x4` | 128K | | | | | | $3 | $10 |
188
189
  | `merge-gateway/writer/palmyra-x5` | 1.0M | | | | | | $0.60 | $6 |
@@ -401,12 +401,12 @@ for await (const chunk of stream) {
401
401
  | `nano-gpt/openai/gpt-5.5` | 1.0M | | | | | | $5 | $30 |
402
402
  | `nano-gpt/openai/gpt-5.6-luna` | 1.1M | | | | | | $0.10 | $0.60 |
403
403
  | `nano-gpt/openai/gpt-5.6-luna-pro` | 1.1M | | | | | | $0.10 | $0.60 |
404
- | `nano-gpt/openai/gpt-5.6-sol` | 1.1M | | | | | | $5 | $30 |
405
- | `nano-gpt/openai/gpt-5.6-sol-pro` | 1.1M | | | | | | $5 | $30 |
404
+ | `nano-gpt/openai/gpt-5.6-sol` | 1.1M | | | | | | $3 | $15 |
405
+ | `nano-gpt/openai/gpt-5.6-sol-pro` | 1.1M | | | | | | $3 | $15 |
406
406
  | `nano-gpt/openai/gpt-5.6-terra` | 1.1M | | | | | | $1 | $6 |
407
407
  | `nano-gpt/openai/gpt-5.6-terra-pro` | 1.1M | | | | | | $1 | $6 |
408
- | `nano-gpt/openai/gpt-chat-latest` | 1.1M | | | | | | $5 | $30 |
409
- | `nano-gpt/openai/gpt-latest` | 1.1M | | | | | | $5 | $30 |
408
+ | `nano-gpt/openai/gpt-chat-latest` | 1.1M | | | | | | $3 | $15 |
409
+ | `nano-gpt/openai/gpt-latest` | 1.1M | | | | | | $3 | $15 |
410
410
  | `nano-gpt/openai/gpt-oss-120b` | 128K | | | | | | $0.35 | $0.75 |
411
411
  | `nano-gpt/openai/gpt-oss-20b` | 128K | | | | | | $0.20 | $0.30 |
412
412
  | `nano-gpt/openai/gpt-oss-safeguard-20b` | 128K | | | | | | $0.07 | $0.30 |
@@ -2,7 +2,7 @@
2
2
 
3
3
  # ![Sakana AI logo](https://models.dev/logos/sakana.svg)Sakana AI
4
4
 
5
- Access 3 Sakana AI models through Mastra's model router. Authentication is handled automatically using the `SAKANA_API_KEY` environment variable.
5
+ Access 4 Sakana AI models through Mastra's model router. Authentication is handled automatically using the `SAKANA_API_KEY` environment variable.
6
6
 
7
7
  Learn more in the [Sakana AI documentation](https://console.sakana.ai/models).
8
8
 
@@ -39,6 +39,7 @@ for await (const chunk of stream) {
39
39
  | `sakana/fugu` | 1.0M | | | | | | — | — |
40
40
  | `sakana/fugu-ultra` | 1.0M | | | | | | $5 | $30 |
41
41
  | `sakana/fugu-ultra-20260615` | 1.0M | | | | | | $5 | $30 |
42
+ | `sakana/sakana-namazu` | 262K | | | | | | $0.95 | $4 |
42
43
 
43
44
  ## Advanced configuration
44
45
 
@@ -68,7 +69,7 @@ const agent = new Agent({
68
69
  model: ({ requestContext }) => {
69
70
  const useAdvanced = requestContext.task === "complex";
70
71
  return useAdvanced
71
- ? "sakana/fugu-ultra-20260615"
72
+ ? "sakana/sakana-namazu"
72
73
  : "sakana/fugu";
73
74
  }
74
75
  });
@@ -80,6 +80,7 @@ Direct access to individual AI model providers. Each provider offers unique mode
80
80
  - [Kenari](https://mastra.ai/models/providers/kenari)
81
81
  - [Kilo Gateway](https://mastra.ai/models/providers/kilo)
82
82
  - [Kimi For Coding](https://mastra.ai/models/providers/kimi-for-coding)
83
+ - [Kosmik Compute](https://mastra.ai/models/providers/kosmik)
83
84
  - [KUAE Cloud Coding Plan](https://mastra.ai/models/providers/kuae-cloud-coding-plan)
84
85
  - [Lilac](https://mastra.ai/models/providers/lilac)
85
86
  - [Llama](https://mastra.ai/models/providers/llama)
@@ -778,9 +778,29 @@ const agent = await mastraClient.createStoredAgent({
778
778
  version: '1.0',
779
779
  team: 'engineering',
780
780
  },
781
+ durable: true,
781
782
  })
782
783
  ```
783
784
 
785
+ #### Durable stored agents
786
+
787
+ Set `durable` to run the agent as a [durable agent](https://mastra.ai/docs/harness/durable-agents) once the server hydrates it. Pass `true` to accept the defaults, or an object to tune the durable loop:
788
+
789
+ ```typescript
790
+ const agent = await mastraClient.createStoredAgent({
791
+ id: 'durable-agent',
792
+ name: 'Durable Agent',
793
+ instructions: 'You are a helpful assistant.',
794
+ model: {
795
+ provider: 'openai',
796
+ name: 'gpt-5.4',
797
+ },
798
+ durable: { maxSteps: 50, cleanupTimeoutMs: 0 },
799
+ })
800
+ ```
801
+
802
+ Only serializable options are accepted. The durable cache and pubsub are inherited from the server's `Mastra` instance. If it has no distributed cache or pubsub configured, durability is process-local. Automatic recovery is still configured in code through `recovery.durableAgents`.
803
+
784
804
  ### `getStoredAgent()`
785
805
 
786
806
  Get an instance of a specific stored agent:
@@ -41,6 +41,8 @@ const skillSearch = new SkillSearchProcessor({
41
41
 
42
42
  **options.ttl** (`number`): Time-to-live for thread state in milliseconds. After this duration of inactivity, thread state will be cleaned up. Set to 0 to disable cleanup.
43
43
 
44
+ **options.blockingRefresh** (`boolean`): When true, awaits the skills staleness check before the first step of each request so skill changes appear in the same turn. When false, the cached catalog is served and revalidated in the background, so skill changes can lag by one turn plus the staleness cooldown (up to 30 seconds).
45
+
44
46
  ## Returns
45
47
 
46
48
  **id** (`string`): Processor identifier set to 'skill-search'
@@ -64,6 +64,10 @@ for await (const part of stream.fullStream) {
64
64
  }
65
65
  ```
66
66
 
67
+ ## Media token counting
68
+
69
+ Images and file attachments are estimated rather than tokenized. This applies to `file` message parts and to tool results shaped like `{ data, mediaType }`. Images use a flat per-image estimate, other media is estimated from its decoded byte size, and remote URLs or provider file ids use a flat fallback because their size isn't known locally. Encoded payloads such as base64 data are never counted as text, which would otherwise inflate the count by an order of magnitude and truncate history unnecessarily.
70
+
67
71
  ## Error behavior
68
72
 
69
73
  When used as an input processor (both `processInput` and `processInputStep`), `TokenLimiterProcessor` throws a `TripWire` error in the following cases:
@@ -65,6 +65,8 @@ Each server in the `servers` map is configured using the `MastraMCPServerDefinit
65
65
 
66
66
  **requireToolApproval** (`boolean | (params: RequireToolApprovalContext) => boolean | Promise<boolean>`): Require human approval before executing tools from this server. When set to true, all tools require approval. When set to a function, the function is called with the tool name, arguments, request context, and any tool annotations advertised by the server to dynamically decide whether approval is needed.
67
67
 
68
+ **protocolVersion** (`'auto' | '2026-07-28'`): Opt-in MCP protocol version negotiation. Omitted keeps the legacy (2025-era) connect sequence unchanged. 'auto' probes the server at connect time and uses the stateless '2026-07-28' revision when the server supports it, with a safe fallback to the legacy handshake. '2026-07-28' pins that revision exactly and fails with a typed error when the server does not offer it. Elicitation handlers work on both eras: on a '2026-07-28' connection, embedded elicitation requests from input\_required results are dispatched through the same registered handler and the originating call retries automatically.
69
+
68
70
  ## Tool approval
69
71
 
70
72
  Use `requireToolApproval` on a server definition to require human approval before any tool from that server is executed. This works with the existing [human-in-the-loop](https://mastra.ai/docs/workflows/human-in-the-loop) approval flow.
@@ -91,6 +91,35 @@ The constructor accepts an `MCPServerConfig` object with the following propertie
91
91
 
92
92
  **appResources** (`AppResources`): A map of ui:// URIs to app resource configurations. Each entry defines an interactive HTML UI served via the MCP Apps extension (SEP-1865). See the MCP Apps section for details.
93
93
 
94
+ **protocolVersion** (`'2025-11-25' | '2026-07-28'`): Opt-in MCP protocol revision. Omitted (or '2025-11-25') keeps the legacy behavior exactly. Set to '2026-07-28' to serve the stateless MCP revision. See the Protocol versions section for details.
95
+
96
+ **cacheHints** (`MCPServerCacheHints`): Cache hints (ttlMs / cacheScope) advertised on cacheable results of the '2026-07-28' protocol revision, keyed by operation (e.g. 'tools/list'). Only applied when protocolVersion: '2026-07-28' is set.
97
+
98
+ ## Protocol versions
99
+
100
+ By default, `MCPServer` speaks the legacy (2025-era) MCP protocol: sessionful streamable HTTP with an `initialize` handshake. Set `protocolVersion: '2026-07-28'` to serve the stateless MCP revision instead:
101
+
102
+ - HTTP and serverless requests go through a dual-era handler: clients that speak `2026-07-28` are served natively (stateless, per-request envelope), and legacy clients are served through a built-in stateless fallback on the same endpoint.
103
+ - `startStdio()` serves both eras: the opening exchange selects the era for the connection.
104
+ - Tool list, prompt list, resource list, and resource update notifications also reach `2026-07-28` clients through `subscriptions/listen`.
105
+ - Tool log messages honor the caller's per-request `logLevel` opt-in instead of the session-level `logging/setLevel`.
106
+ - Configured `cacheHints` are advertised on cacheable results such as `tools/list`.
107
+ - Tool elicitation (`options.mcp.elicitation.sendRequest()`) works on both eras. On `2026-07-28` requests, it uses the protocol's multi round-trip mechanism. The tool call first returns an `input_required` result. After the client answers, the call retries with the answer attached. The `sendRequest()` promise API is unchanged, but the tool function re-executes from the top on each retry, so keep side effects idempotent (or place them after the last elicitation) and keep the order of `sendRequest()` calls deterministic for an input.
108
+
109
+ ```typescript
110
+ const server = new MCPServer({
111
+ name: 'My Server',
112
+ version: '1.0.0',
113
+ tools: { weatherTool },
114
+ protocolVersion: '2026-07-28',
115
+ cacheHints: {
116
+ 'tools/list': { ttlMs: 60_000, cacheScope: 'private' },
117
+ },
118
+ })
119
+ ```
120
+
121
+ Omitting `protocolVersion` keeps the current behavior unchanged.
122
+
94
123
  ## Exposing agents as tools
95
124
 
96
125
  A powerful feature of `MCPServer` is its ability to automatically expose your Mastra Agents as callable tools. When you provide agents in the `agents` property of the configuration:
@@ -239,6 +268,8 @@ await server.startStdio()
239
268
 
240
269
  ### `startSSE()`
241
270
 
271
+ > **Warning:** The HTTP+SSE transport is deprecated in the MCP specification. Use `startHTTP()` (streamable HTTP) instead.
272
+
242
273
  This method helps you integrate the MCP server with an existing web server to use Server-Sent Events (SSE) for communication. You'll call this from your web server's code when it receives a request for the SSE or message paths.
243
274
 
244
275
  ```typescript
@@ -291,6 +322,8 @@ Here are the details for the values needed by the `startSSE` method:
291
322
 
292
323
  ### `startHonoSSE()`
293
324
 
325
+ > **Warning:** The HTTP+SSE transport is deprecated in the MCP specification. Use `startHTTP()` (streamable HTTP) instead.
326
+
294
327
  This method helps you integrate the MCP server with an existing web server to use Server-Sent Events (SSE) for communication. You'll call this from your web server's code when it receives a request for the SSE or message paths.
295
328
 
296
329
  ```typescript
@@ -361,6 +394,21 @@ async startHTTP({
361
394
  }): Promise<void>
362
395
  ```
363
396
 
397
+ #### Options with `protocolVersion: '2026-07-28'`
398
+
399
+ The `2026-07-28` protocol uses one shared stateless handler instead of a transport configured for each request. `startHTTP()` handles legacy transport options as follows:
400
+
401
+ | Options | Behavior |
402
+ | ------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
403
+ | `serverless: true`, `serverlessStreaming: true`, `sessionIdGenerator: undefined` | Accepted because the modern handler already provides stateless requests and automatic request-scoped streaming. |
404
+ | `allowedHosts`, `allowedOrigins`, `enableDnsRebindingProtection` | Enforced before the request reaches the modern handler. Host and origin lists are active when `enableDnsRebindingProtection` is `true`. |
405
+ | `sessionIdGenerator` with a function, session callbacks, or `eventStore` | Rejected because the modern protocol doesn't create HTTP sessions. |
406
+ | `enableJsonResponse`, `retryInterval`, `keepAliveMs`, or `supportedProtocolVersions` | Rejected because these values configure a shared handler and can't vary between requests. |
407
+ | `serverless: false` or `serverlessStreaming: false` | Rejected because these values request behavior that differs from the modern handler. |
408
+ | Unknown options | Rejected instead of being ignored. |
409
+
410
+ Omit `options` when you don't need request guards or compatibility declarations.
411
+
364
412
  Here's an example of how you might use `startHTTP` within an HTTP server request handler. In this example an MCP client could connect to your MCP server at `http://localhost:1234/http`:
365
413
 
366
414
  ```typescript
@@ -383,7 +431,7 @@ httpServer.listen(PORT, () => {
383
431
  })
384
432
  ```
385
433
 
386
- For **serverless environments** (Supabase Edge Functions, Cloudflare Workers, Vercel Edge, etc.), use `serverless: true` to enable stateless operation:
434
+ For **serverless environments** (Supabase Edge Functions, Cloudflare Workers, Vercel Edge, etc.), use `serverless: true` to enable stateless operation on the legacy protocol path. Servers configured with `protocolVersion: '2026-07-28'` are already stateless and may omit this option.
387
435
 
388
436
  ```typescript
389
437
  // Supabase Edge Function example
@@ -457,7 +505,7 @@ serve(async req => {
457
505
  >
458
506
  > This is still stateless: no `mcp-session-id` is required or persisted. It only enables notifications scoped to the current request (such as progress). The session-dependent features below remain unavailable.
459
507
  >
460
- > The following MCP features require session state or persistent connections and **won't work** in serverless mode (including with `serverlessStreaming: true`):
508
+ > On the legacy protocol path, the following MCP features require session state or persistent connections and **won't work** in serverless mode (including with `serverlessStreaming: true`):
461
509
  >
462
510
  > - **Elicitation** - Interactive user input requests during tool execution require session management to route responses back to the correct client
463
511
  > - **Resource subscriptions** - `resources/subscribe` and `resources/unsubscribe` need persistent connections to maintain subscription state
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.17-alpha.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`6db7a5d`](https://github.com/mastra-ai/mastra/commit/6db7a5dd3dd2b6f7ef75dcd804fcffef5fa83963), [`0cdc5dc`](https://github.com/mastra-ai/mastra/commit/0cdc5dc69024957815da4f51acc4119eb4f447d7)]:
8
+ - @mastra/core@1.60.0-alpha.12
9
+
10
+ ## 1.2.17-alpha.18
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`6223446`](https://github.com/mastra-ai/mastra/commit/6223446ddce6166e96e0ba5e00d628b615dee8ca), [`583e235`](https://github.com/mastra-ai/mastra/commit/583e23519c13af16c1746f9c49722d011216611b), [`a77f8d4`](https://github.com/mastra-ai/mastra/commit/a77f8d4740d2178a74c41e4bf678b4fcd8fa0bb2), [`40d358e`](https://github.com/mastra-ai/mastra/commit/40d358e29d55543803e64b49241122f598ffabc7), [`e80cd7e`](https://github.com/mastra-ai/mastra/commit/e80cd7e7683e7d732e1cc6784bcac1d2640d2ce3), [`39ba1b9`](https://github.com/mastra-ai/mastra/commit/39ba1b9ce256a9a910a16f125cc6a59588185bfe), [`0f53aeb`](https://github.com/mastra-ai/mastra/commit/0f53aeb119158bd9f83bd8ef667f1f675740e8f0), [`20504b2`](https://github.com/mastra-ai/mastra/commit/20504b2ecebd0e077acda3d457ab57480a98ed3e)]:
15
+ - @mastra/core@1.60.0-alpha.11
16
+ - @mastra/mcp@1.17.0-alpha.2
17
+
3
18
  ## 1.2.17-alpha.17
4
19
 
5
20
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.17-alpha.17",
3
+ "version": "1.2.17-alpha.19",
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.60.0-alpha.10",
32
- "@mastra/mcp": "^1.17.0-alpha.1"
31
+ "@mastra/core": "1.60.0-alpha.12",
32
+ "@mastra/mcp": "^1.17.0-alpha.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^2.0.0",
@@ -45,9 +45,9 @@
45
45
  "tsx": "^4.23.1",
46
46
  "typescript": "^6.0.3",
47
47
  "vitest": "4.1.10",
48
- "@internal/types-builder": "0.0.98",
49
- "@mastra/core": "1.60.0-alpha.10",
50
- "@internal/lint": "0.0.123"
48
+ "@internal/lint": "0.0.123",
49
+ "@mastra/core": "1.60.0-alpha.12",
50
+ "@internal/types-builder": "0.0.98"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {