@mastra/mcp-docs-server 1.1.28-alpha.1 → 1.1.28-alpha.4

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.
@@ -133,34 +133,7 @@ const viewer = new BrowserViewer({
133
133
  })
134
134
  ```
135
135
 
136
- ## Configuration
137
-
138
- | Option | Type | Default | Description |
139
- | ---------------- | -------------------------------------------------- | ---------- | ------------------------------------------------------- |
140
- | `cli` | `'agent-browser' \| 'browser-use' \| 'browse-cli'` | Required | Which CLI the agent uses |
141
- | `headless` | `boolean` | `false` | Run browser in headless mode |
142
- | `cdpUrl` | `string` | — | Connect to an existing browser instead of launching one |
143
- | `cdpPort` | `number` | `0` (auto) | Port for Chrome remote debugging |
144
- | `viewport` | `{ width, height }` | `1280×720` | Browser viewport size |
145
- | `userDataDir` | `string` | — | Chrome profile directory for persistent state |
146
- | `executablePath` | `string` | — | Path to a Chrome executable |
147
-
148
- ## Connecting to an existing browser
149
-
150
- To connect to a browser that is already running, pass a `cdpUrl`:
151
-
152
- ```typescript
153
- const viewer = new BrowserViewer({
154
- cli: 'browser-use',
155
- cdpUrl: 'ws://127.0.0.1:9222/devtools/browser/abc123',
156
- })
157
- ```
158
-
159
- BrowserViewer connects via the CDP endpoint and enables screencast without launching its own browser.
160
-
161
- ## External CDP connections
162
-
163
- When the agent provides its own CDP URL in a command (for example, `browser-use --cdp-url wss://cloud.example.com/session`), BrowserViewer detects this and skips injection. It connects to the external browser for screencast only, without managing the browser lifecycle.
136
+ > **Note:** See [BrowserViewer reference](https://mastra.ai/reference/browser/browser-viewer) for all configuration options, advanced connection modes, and method details.
164
137
 
165
138
  ## Related
166
139
 
@@ -93,6 +93,58 @@ const workspace = new Workspace({
93
93
 
94
94
  When `contained` is `false`, absolute paths are treated as real filesystem paths with no restriction.
95
95
 
96
+ ## Dynamic filesystem
97
+
98
+ The `filesystem` option accepts a resolver function instead of a static instance. The resolver receives `requestContext` and returns a filesystem per request, allowing a single workspace to serve different filesystems based on the caller's identity, role, or tenant.
99
+
100
+ ```typescript
101
+ import { Agent } from '@mastra/core/agent'
102
+ import { Workspace, LocalFilesystem } from '@mastra/core/workspace'
103
+
104
+ const workspace = new Workspace({
105
+ filesystem: ({ requestContext }) => {
106
+ const role = requestContext.get('agent-role') || 'guest'
107
+ return new LocalFilesystem({
108
+ basePath: `/workspaces/${role}`,
109
+ readOnly: role !== 'admin',
110
+ })
111
+ },
112
+ })
113
+
114
+ const agent = new Agent({
115
+ id: 'multi-role-agent',
116
+ model: 'openai/gpt-4o',
117
+ workspace,
118
+ })
119
+ ```
120
+
121
+ Each request resolves its own filesystem at tool execution time:
122
+
123
+ ```typescript
124
+ import { RequestContext } from '@mastra/core/request-context'
125
+
126
+ // Admin request — reads and writes from /workspaces/admin/
127
+ const adminCtx = new RequestContext([['agent-role', 'admin']])
128
+ await agent.generate('Write report.txt with Q4 results', { requestContext: adminCtx })
129
+
130
+ // Viewer request — reads from /workspaces/viewer/, writes are blocked
131
+ const viewerCtx = new RequestContext([['agent-role', 'viewer']])
132
+ await agent.generate('Read info.txt', { requestContext: viewerCtx })
133
+ ```
134
+
135
+ The resolver can also be asynchronous, for example to look up configuration from a database:
136
+
137
+ ```typescript
138
+ const workspace = new Workspace({
139
+ filesystem: async ({ requestContext }) => {
140
+ const tenantConfig = await db.getTenant(requestContext.get('tenant-id'))
141
+ return new LocalFilesystem({ basePath: tenantConfig.storagePath })
142
+ },
143
+ })
144
+ ```
145
+
146
+ > **Note:** `filesystem` and `mounts` are mutually exclusive. You cannot use a resolver function together with `mounts` in the same workspace.
147
+
96
148
  ## Read-only mode
97
149
 
98
150
  To prevent agents from modifying files, enable read-only mode:
@@ -106,7 +158,9 @@ const workspace = new Workspace({
106
158
  })
107
159
  ```
108
160
 
109
- When read-only, write tools (`write_file`, `edit_file`, `delete`, `mkdir`) aren't added to the agent's toolset. The agent can still read and list files.
161
+ With a static filesystem, write tools (`write_file`, `edit_file`, `delete`, `mkdir`) are excluded from the agent's toolset entirely. The agent can still read and list files.
162
+
163
+ When using a [dynamic filesystem](#dynamic-filesystem), write tools are always included because `readOnly` isn't known until the resolver runs. Instead, write operations are blocked at runtime — the tool returns an error if the resolved filesystem is read-only.
110
164
 
111
165
  ## Mounts and `CompositeFilesystem`
112
166
 
@@ -153,15 +153,34 @@ const workspace = new Workspace({
153
153
 
154
154
  The agent receives the `execute_command` tool.
155
155
 
156
+ ### Dynamic filesystem (per-request)
157
+
158
+ Pass a resolver function to `filesystem` to return a different filesystem per request. This is useful for multi-tenant applications or multi-role agents where each request needs a different storage root or different permissions.
159
+
160
+ ```typescript
161
+ const workspace = new Workspace({
162
+ filesystem: ({ requestContext }) => {
163
+ const role = requestContext.get('agent-role') || 'guest'
164
+ return new LocalFilesystem({
165
+ basePath: `/workspaces/${role}`,
166
+ readOnly: role !== 'admin',
167
+ })
168
+ },
169
+ })
170
+ ```
171
+
172
+ One workspace instance serves all requests. The resolver runs at tool execution time, so each request gets its own filesystem. See [dynamic filesystem](https://mastra.ai/docs/workspace/filesystem) for details.
173
+
156
174
  ### Which pattern should I use?
157
175
 
158
- | Scenario | Pattern |
159
- | ----------------------------------------------------- | ----------------------------------------------------- |
160
- | Local development with files and commands | `filesystem` + `sandbox` (both local, same directory) |
161
- | Cloud storage accessible inside a cloud sandbox | `mounts` + `sandbox` |
162
- | Multiple cloud providers in one sandbox | `mounts` + `sandbox` (one mount per provider) |
163
- | Agent reads/writes files, no command execution needed | `filesystem` only |
164
- | Agent runs commands, no file tools needed | `sandbox` only |
176
+ | Scenario | Pattern |
177
+ | --------------------------------------------------------- | ----------------------------------------------------- |
178
+ | Local development with files and commands | `filesystem` + `sandbox` (both local, same directory) |
179
+ | Cloud storage accessible inside a cloud sandbox | `mounts` + `sandbox` |
180
+ | Multiple cloud providers in one sandbox | `mounts` + `sandbox` (one mount per provider) |
181
+ | Agent reads/writes files, no command execution needed | `filesystem` only |
182
+ | Agent runs commands, no file tools needed | `sandbox` only |
183
+ | Multi-role or multi-tenant agent with per-request storage | `filesystem` with resolver function |
165
184
 
166
185
  ## Tool configuration
167
186
 
@@ -1,6 +1,6 @@
1
1
  # Model Providers
2
2
 
3
- Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3720 models from 104 providers through a single API.
3
+ Mastra provides a unified interface for working with LLMs across multiple providers, giving you access to 3723 models from 104 providers through a single API.
4
4
 
5
5
  ## Features
6
6
 
@@ -1,6 +1,6 @@
1
1
  # ![Cortecs logo](https://models.dev/logos/cortecs.svg)Cortecs
2
2
 
3
- Access 33 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
3
+ Access 34 Cortecs models through Mastra's model router. Authentication is handled automatically using the `CORTECS_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Cortecs documentation](https://cortecs.ai).
6
6
 
@@ -57,6 +57,7 @@ for await (const chunk of stream) {
57
57
  | `cortecs/kimi-k2-instruct` | 131K | | | | | | $0.55 | $3 |
58
58
  | `cortecs/kimi-k2-thinking` | 262K | | | | | | $0.66 | $3 |
59
59
  | `cortecs/kimi-k2.5` | 256K | | | | | | $0.55 | $3 |
60
+ | `cortecs/kimi-k2.6` | 256K | | | | | | $0.81 | $4 |
60
61
  | `cortecs/llama-3.1-405b-instruct` | 128K | | | | | | — | — |
61
62
  | `cortecs/minimax-m2` | 400K | | | | | | $0.39 | $2 |
62
63
  | `cortecs/minimax-m2.1` | 196K | | | | | | $0.34 | $1 |
@@ -1,6 +1,6 @@
1
1
  # ![OpenAI logo](https://models.dev/logos/openai.svg)OpenAI
2
2
 
3
- Access 50 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
3
+ Access 51 OpenAI models through Mastra's model router. Authentication is handled automatically using the `OPENAI_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [OpenAI documentation](https://platform.openai.com/docs/models).
6
6
 
@@ -66,6 +66,7 @@ for await (const chunk of stream) {
66
66
  | `openai/gpt-5.4-mini` | 400K | | | | | | $0.75 | $5 |
67
67
  | `openai/gpt-5.4-nano` | 400K | | | | | | $0.20 | $1 |
68
68
  | `openai/gpt-5.4-pro` | 1.1M | | | | | | $30 | $180 |
69
+ | `openai/gpt-5.5` | 1.1M | | | | | | $5 | $30 |
69
70
  | `openai/gpt-image-1` | — | | | | | | — | — |
70
71
  | `openai/gpt-image-1-mini` | — | | | | | | — | — |
71
72
  | `openai/gpt-image-1.5` | — | | | | | | — | — |
@@ -1,6 +1,6 @@
1
1
  # ![Poe logo](https://models.dev/logos/poe.svg)Poe
2
2
 
3
- Access 118 Poe models through Mastra's model router. Authentication is handled automatically using the `POE_API_KEY` environment variable.
3
+ Access 119 Poe models through Mastra's model router. Authentication is handled automatically using the `POE_API_KEY` environment variable.
4
4
 
5
5
  Learn more in the [Poe documentation](https://creator.poe.com/docs/external-applications/openai-compatible-api).
6
6
 
@@ -126,6 +126,7 @@ for await (const chunk of stream) {
126
126
  | `poe/openai/gpt-image-1` | 128K | | | | | | — | — |
127
127
  | `poe/openai/gpt-image-1-mini` | — | | | | | | — | — |
128
128
  | `poe/openai/gpt-image-1.5` | 128K | | | | | | — | — |
129
+ | `poe/openai/gpt-image-2` | — | | | | | | $5 | $32 |
129
130
  | `poe/openai/o1` | 200K | | | | | | $14 | $54 |
130
131
  | `poe/openai/o1-pro` | 200K | | | | | | $140 | $540 |
131
132
  | `poe/openai/o3` | 200K | | | | | | $2 | $7 |
@@ -44,7 +44,7 @@ When `cdpUrl` is provided, `BrowserViewer` connects to the existing browser inst
44
44
 
45
45
  **cli** (`'agent-browser' | 'browser-use' | 'browse-cli'`): Which CLI the agent uses for browser automation. The CLI connects to Chrome via the CDP URL.
46
46
 
47
- **headless** (`boolean`): Whether to run Chrome in headless mode. (Default: `false`)
47
+ **headless** (`boolean`): Whether to run Chrome in headless mode. (Default: `true`)
48
48
 
49
49
  **cdpUrl** (`string | (() => string | Promise<string>)`): CDP WebSocket URL for connecting to an existing browser instead of launching one.
50
50
 
@@ -54,12 +54,8 @@ When `cdpUrl` is provided, `BrowserViewer` connects to the existing browser inst
54
54
 
55
55
  **viewport** (`{ width: number; height: number }`): Browser viewport dimensions. (Default: `{ width: 1280, height: 720 }`)
56
56
 
57
- **userDataDir** (`string`): Path to Chrome user data directory. Persists cookies, localStorage, and extensions across sessions.
58
-
59
57
  **executablePath** (`string`): Path to a Chrome executable. Uses Playwright's bundled Chromium by default.
60
58
 
61
- **timeout** (`number`): Default timeout in milliseconds for browser operations. (Default: `10000`)
62
-
63
59
  **onLaunch** (`(args: { browser: MastraBrowser }) => void | Promise<void>`): Callback invoked after the browser is ready.
64
60
 
65
61
  **onClose** (`(args: { browser: MastraBrowser }) => void | Promise<void>`): Callback invoked before the browser closes.
@@ -34,7 +34,7 @@ export const browserAgent = new Agent({
34
34
 
35
35
  **viewport** (`{ width: number; height: number }`): Browser viewport dimensions. Controls the size of the browser window. (Default: `{ width: 1280, height: 720 }`)
36
36
 
37
- **timeout** (`number`): Default timeout in milliseconds for browser operations. (Default: `10000`)
37
+ **timeout** (`number`): Default timeout in milliseconds. Each provider defines its own semantics and default. See the provider reference for details.
38
38
 
39
39
  **cdpUrl** (`string | (() => string | Promise<string>)`): CDP WebSocket URL, HTTP endpoint, or sync/async provider function. When provided, connects to an existing browser instead of launching a new one. HTTP endpoints are resolved to WebSocket internally. Can't be used with scope: 'thread' (automatically uses shared scope).
40
40
 
@@ -52,7 +52,7 @@ Use stagehand_extract to get data from pages.`,
52
52
 
53
53
  **scope** (`'shared' | 'thread'`): Browser instance scope across threads. (Default: `'thread' (or 'shared' when cdpUrl is provided)`)
54
54
 
55
- **timeout** (`number`): Default timeout in milliseconds for browser operations. (Default: `10000`)
55
+ **timeout** (`number`): Default timeout in milliseconds for Stagehand operations. (Default: `30000`)
56
56
 
57
57
  **onLaunch** (`(args: { browser: MastraBrowser }) => void | Promise<void>`): Callback invoked after the browser is ready.
58
58
 
@@ -29,7 +29,7 @@ const workspace = new Workspace({
29
29
 
30
30
  **name** (`string`): Human-readable name (Default: `workspace-{id}`)
31
31
 
32
- **filesystem** (`WorkspaceFilesystem`): Filesystem provider instance (e.g., LocalFilesystem)
32
+ **filesystem** (`WorkspaceFilesystem | WorkspaceFilesystemResolver`): Filesystem provider instance, or a resolver function that receives \`requestContext\` and returns a filesystem per request. See \[dynamic filesystem]\(/docs/workspace/filesystem#dynamic-filesystem).
33
33
 
34
34
  **sandbox** (`WorkspaceSandbox`): Sandbox provider instance (e.g., LocalSandbox)
35
35
 
@@ -122,7 +122,7 @@ Tool names must be unique across all workspace tools. Setting a custom name that
122
122
 
123
123
  **status** (`WorkspaceStatus`): 'pending' | 'initializing' | 'ready' | 'paused' | 'error' | 'destroying' | 'destroyed'
124
124
 
125
- **filesystem** (`WorkspaceFilesystem | undefined`): The filesystem provider
125
+ **filesystem** (`WorkspaceFilesystem | undefined`): The static filesystem provider. Returns \`undefined\` when a resolver function is configured — use \`hasFilesystemConfig()\` to check availability.
126
126
 
127
127
  **sandbox** (`WorkspaceSandbox | undefined`): The sandbox provider
128
128
 
@@ -251,6 +251,37 @@ workspace.setToolsConfig(undefined)
251
251
 
252
252
  **config** (`WorkspaceToolsConfig | undefined`): New tool configuration to apply. Pass undefined to reset to defaults.
253
253
 
254
+ ### Dynamic filesystem
255
+
256
+ #### `hasFilesystemConfig()`
257
+
258
+ Check whether a filesystem is configured, either as a static instance or a resolver function. Use this instead of checking `workspace.filesystem` directly, because a resolver-based workspace returns `undefined` from the `filesystem` property.
259
+
260
+ ```typescript
261
+ if (workspace.hasFilesystemConfig()) {
262
+ // Filesystem tools are available
263
+ }
264
+ ```
265
+
266
+ **Returns:** `boolean`
267
+
268
+ #### `resolveFilesystem({ requestContext })`
269
+
270
+ Resolve the filesystem for a given request context. When a resolver function is configured, calls it with the provided `requestContext`. When a static filesystem is configured, returns it directly. Returns `undefined` if no filesystem is configured.
271
+
272
+ ```typescript
273
+ import { RequestContext } from '@mastra/core/request-context'
274
+
275
+ const ctx = new RequestContext([['agent-role', 'admin']])
276
+ const fs = await workspace.resolveFilesystem({ requestContext: ctx })
277
+ ```
278
+
279
+ **Parameters:**
280
+
281
+ **requestContext** (`RequestContext`): The request context to pass to the resolver function.
282
+
283
+ **Returns:** `Promise<WorkspaceFilesystem | undefined>`
284
+
254
285
  ## Agent tools
255
286
 
256
287
  A workspace provides tools to agents based on what's configured.
@@ -270,7 +301,7 @@ Added when a filesystem is configured:
270
301
  | `mastra_workspace_mkdir` | Create a directory. Creates parent directories automatically if they don't exist. |
271
302
  | `mastra_workspace_grep` | Search file contents using regex patterns. Supports glob filtering, context lines, and case-insensitive search. |
272
303
 
273
- Write tools (`write_file`, `edit_file`, `delete`, `mkdir`) are excluded when the filesystem is in read-only mode.
304
+ With a static filesystem, write tools (`write_file`, `edit_file`, `delete`, `mkdir`) are excluded when the filesystem is in read-only mode. With a [dynamic filesystem](https://mastra.ai/docs/workspace/filesystem), write tools are always included and read-only is enforced at runtime.
274
305
 
275
306
  ### Sandbox tools
276
307
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.1.28-alpha.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`45e29cb`](https://github.com/mastra-ai/mastra/commit/45e29cb5b5737f3083eb3852db02b944b9cf37ed), [`696694e`](https://github.com/mastra-ai/mastra/commit/696694e00f29241a25dd1a1b749afa06c3a626b4)]:
8
+ - @mastra/core@1.28.0-alpha.2
9
+
10
+ ## 1.1.28-alpha.2
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [[`750b4d3`](https://github.com/mastra-ai/mastra/commit/750b4d3d8231f92e769b2c485921ac5a8ca639b9)]:
15
+ - @mastra/core@1.28.0-alpha.1
16
+
3
17
  ## 1.1.28-alpha.1
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.28-alpha.1",
3
+ "version": "1.1.28-alpha.4",
4
4
  "description": "MCP server for accessing Mastra.ai documentation, changelogs, and news.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,7 +29,7 @@
29
29
  "jsdom": "^26.1.0",
30
30
  "local-pkg": "^1.1.2",
31
31
  "zod": "^4.3.6",
32
- "@mastra/core": "1.28.0-alpha.0",
32
+ "@mastra/core": "1.28.0-alpha.2",
33
33
  "@mastra/mcp": "^1.5.1"
34
34
  },
35
35
  "devDependencies": {
@@ -47,8 +47,8 @@
47
47
  "typescript": "^5.9.3",
48
48
  "vitest": "4.1.5",
49
49
  "@internal/lint": "0.0.85",
50
- "@internal/types-builder": "0.0.60",
51
- "@mastra/core": "1.28.0-alpha.0"
50
+ "@mastra/core": "1.28.0-alpha.2",
51
+ "@internal/types-builder": "0.0.60"
52
52
  },
53
53
  "homepage": "https://mastra.ai",
54
54
  "repository": {