@mastra/mcp-docs-server 1.2.19-alpha.18 → 1.2.19-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.
@@ -73,6 +73,48 @@ Set `{ enabled: false }` on one tool to remove it, or set the top-level `enabled
73
73
 
74
74
  See the [sandbox tools reference](https://mastra.ai/reference/workspace/workspace-class) for all generated tools and the [tool configuration reference](https://mastra.ai/reference/workspace/workspace-class) for approvals, output limits, and hooks.
75
75
 
76
+ ### Computer-use tools
77
+
78
+ Sandboxes that run a desktop environment can expose screenshot, mouse, and keyboard control. The workspace registers these tools when a statically configured sandbox supports the computer capability:
79
+
80
+ | Tool | Does |
81
+ | -------------------------- | -------------------------------------------------------------------------------- |
82
+ | `computer_screenshot` | Captures the desktop as a PNG image and returns it to the model as native media. |
83
+ | `computer_click` | Presses and releases the left mouse button at pixel coordinates. |
84
+ | `computer_double_click` | Presses the left mouse button twice at pixel coordinates. |
85
+ | `computer_right_click` | Presses and releases the right mouse button at pixel coordinates. |
86
+ | `computer_move_mouse` | Moves the cursor to pixel coordinates without pressing a button. |
87
+ | `computer_drag` | Presses, drags, and releases between two points. |
88
+ | `computer_type` | Types text into the focused element. |
89
+ | `computer_press_key` | Presses a key or key combination, such as `Enter` or `ctrl+s`. |
90
+ | `computer_scroll` | Scrolls up or down. |
91
+ | `computer_get_screen_info` | Gets the screen dimensions and cursor position. |
92
+ | `computer_wait` | Waits for the interface to settle. |
93
+
94
+ [`DaytonaSandbox`](https://mastra.ai/integrations/sandboxes/daytona) and [`E2BDesktopSandbox`](https://mastra.ai/integrations/sandboxes/e2b-desktop) support this capability. Other sandbox backends don't register the computer tools. Resolver-backed sandboxes don't register them because the workspace can't inspect the resolved sandbox's capabilities when it creates the tool list.
95
+
96
+ Action tools take a screenshot after each action by default. Configure the screenshot behavior for each tool:
97
+
98
+ ```typescript
99
+ import { Workspace, WORKSPACE_TOOLS } from '@mastra/core/workspace'
100
+ import { E2BDesktopSandbox } from '@mastra/e2b-desktop'
101
+
102
+ const workspace = new Workspace({
103
+ sandbox: new E2BDesktopSandbox(),
104
+ tools: {
105
+ [WORKSPACE_TOOLS.COMPUTER.CLICK]: {
106
+ screenshotAfterAction: true,
107
+ screenshotDelayMs: 1000,
108
+ },
109
+ [WORKSPACE_TOOLS.COMPUTER.TYPE]: {
110
+ requireApproval: true,
111
+ },
112
+ },
113
+ })
114
+ ```
115
+
116
+ Computer tools accept the same per-tool `enabled` and `requireApproval` configuration as other workspace tools.
117
+
76
118
  Authored runtime functions, including tools and workflow steps, can get the live sandbox from their execution context. Use it to execute commands, install dependencies, process files, or spawn a long-running process.
77
119
 
78
120
  ```typescript
@@ -136,6 +178,7 @@ Use a remote or container sandbox when commands need a stronger boundary from th
136
178
  - [Daytona](https://mastra.ai/integrations/sandboxes/daytona)
137
179
  - [Docker](https://mastra.ai/integrations/sandboxes/docker)
138
180
  - [E2B](https://mastra.ai/integrations/sandboxes/e2b)
181
+ - [E2B Desktop](https://mastra.ai/integrations/sandboxes/e2b-desktop)
139
182
  - [Mastra](https://mastra.ai/reference/workspace/platform-sandbox)
140
183
  - [Modal](https://mastra.ai/integrations/sandboxes/modal)
141
184
  - [Railway](https://mastra.ai/integrations/sandboxes/railway)
@@ -298,6 +298,36 @@ const workspace = new Workspace({
298
298
 
299
299
  Inside the sandbox, the environment variable holds an opaque placeholder. Daytona's egress proxy substitutes the real value into HTTPS request headers toward the Secret's allowed hosts, so the raw credential never enters the sandbox. Secrets are applied at sandbox creation and are preserved by `clone()`.
300
300
 
301
+ ### Computer use (desktop)
302
+
303
+ `DaytonaSandbox` exposes the [computer capability](https://mastra.ai/docs/sandbox/overview): screenshot, mouse, and keyboard control of a desktop environment inside the sandbox. When the sandbox is used in a workspace, agents automatically get the `mastra_workspace_computer_*` tools.
304
+
305
+ The desktop processes (Xvfb, xfce4, x11vnc, noVNC) are started lazily on the first computer operation:
306
+
307
+ ```typescript
308
+ const sandbox = new DaytonaSandbox()
309
+ await sandbox.start()
310
+
311
+ await sandbox.computer.leftClick(100, 200)
312
+ await sandbox.computer.type('hello')
313
+ const { data } = await sandbox.computer.screenshot() // PNG bytes
314
+
315
+ // Live desktop view via the noVNC preview link
316
+ const url = await sandbox.computer.streamUrl()
317
+ ```
318
+
319
+ Disable the capability, or manage the desktop processes yourself, with the `computerUse` option:
320
+
321
+ ```typescript
322
+ // No computer capability, no computer tools
323
+ new DaytonaSandbox({ computerUse: false })
324
+
325
+ // Capability stays on, but you call sandbox.daytona.computerUse.start() yourself
326
+ new DaytonaSandbox({ computerUse: { autoStart: false } })
327
+ ```
328
+
329
+ For Daytona-specific desktop APIs (regions, compressed screenshots, screen recording, accessibility tree), use the [direct SDK access](#direct-sdk-access) escape hatch: `sandbox.daytona.computerUse`.
330
+
301
331
  ## Constructor parameters
302
332
 
303
333
  **id** (`string`): Unique identifier for this sandbox instance. (Default: `Auto-generated`)
@@ -346,6 +376,8 @@ Inside the sandbox, the environment variable holds an opaque placeholder. Dayton
346
376
 
347
377
  **secrets** (`Record<string, string>`): Daytona Secrets to expose inside the sandbox, mapping environment variable names to Daytona Secret names. The env var holds an opaque placeholder; the real value is substituted into HTTPS request headers at egress toward the Secret's allowed hosts.
348
378
 
379
+ **computerUse** (`boolean | { autoStart?: boolean; noVncPort?: number }`): Computer-use (desktop) capability configuration. Set to false to disable the capability. Set autoStart to false to manage the desktop processes yourself. noVncPort sets the noVNC viewer port used by computer.streamUrl(). (Default: `true`)
380
+
349
381
  ## Properties
350
382
 
351
383
  **id** (`string`): Sandbox instance identifier.
@@ -360,6 +392,8 @@ Inside the sandbox, the environment variable holds an opaque placeholder. Dayton
360
392
 
361
393
  **processes** (`DaytonaProcessManager`): Background process manager. See SandboxProcessManager reference.
362
394
 
395
+ **computer** (`SandboxComputer | undefined`): Computer-use capability: screenshot, mouse, keyboard, and stream URL. Undefined when constructed with computerUse: false. See SandboxComputer reference.
396
+
363
397
  ## Background processes
364
398
 
365
399
  `DaytonaSandbox` includes a built-in process manager for spawning and managing background processes. Processes run in the Daytona cloud sandbox using session-based command execution.
@@ -0,0 +1,128 @@
1
+ > Discover all available pages from the documentation index: https://mastra.ai/llms.txt
2
+
3
+ # E2B Desktop
4
+
5
+ Runs a full Linux desktop environment in an isolated [E2B](https://e2b.dev) cloud sandbox with screenshot, mouse, and keyboard control. `E2BDesktopSandbox` extends [`E2BSandbox`](https://mastra.ai/integrations/sandboxes/e2b), so everything the base provider supports (command execution, background processes, file upload, pause/resume reconnection) works against the same desktop machine. For interface details, see [WorkspaceSandbox interface](https://mastra.ai/reference/workspace/sandbox).
6
+
7
+ ## Installation
8
+
9
+ **npm**:
10
+
11
+ ```bash
12
+ npm install @mastra/e2b-desktop
13
+ ```
14
+
15
+ **pnpm**:
16
+
17
+ ```bash
18
+ pnpm add @mastra/e2b-desktop
19
+ ```
20
+
21
+ **Yarn**:
22
+
23
+ ```bash
24
+ yarn add @mastra/e2b-desktop
25
+ ```
26
+
27
+ **Bun**:
28
+
29
+ ```bash
30
+ bun add @mastra/e2b-desktop
31
+ ```
32
+
33
+ Set your E2B API key with the `E2B_API_KEY` environment variable or the `apiKey` option.
34
+
35
+ ## Usage
36
+
37
+ Add an `E2BDesktopSandbox` to a workspace and assign it to an agent. Because the sandbox supports the [computer capability](https://mastra.ai/docs/sandbox/overview), the workspace registers the `mastra_workspace_computer_*` tools alongside the shell and process tools:
38
+
39
+ ```typescript
40
+ import { Agent } from '@mastra/core/agent'
41
+ import { Workspace } from '@mastra/core/workspace'
42
+ import { E2BDesktopSandbox } from '@mastra/e2b-desktop'
43
+
44
+ const workspace = new Workspace({
45
+ sandbox: new E2BDesktopSandbox({
46
+ resolution: [1280, 720],
47
+ }),
48
+ })
49
+
50
+ const agent = new Agent({
51
+ id: 'desktop-agent',
52
+ name: 'Desktop Agent',
53
+ instructions: 'You can control a Linux desktop and run shell commands.',
54
+ model: 'anthropic/claude-sonnet-4-6',
55
+ workspace,
56
+ })
57
+
58
+ const response = await agent.generate(
59
+ 'Take a screenshot, then create /tmp/hello.txt with the text "hello" and cat it.',
60
+ )
61
+ ```
62
+
63
+ The agent can mix desktop actions (click, type, screenshot) with shell commands. Both surfaces operate on the same machine.
64
+
65
+ ### Direct desktop control
66
+
67
+ Use the `computer` capability programmatically without an agent:
68
+
69
+ ```typescript
70
+ const sandbox = new E2BDesktopSandbox()
71
+ await sandbox.start()
72
+
73
+ await sandbox.computer.leftClick(100, 200)
74
+ await sandbox.computer.type('hello')
75
+ const { data } = await sandbox.computer.screenshot() // PNG bytes
76
+
77
+ const size = await sandbox.computer.getScreenSize()
78
+ console.log(size) // { width: 1024, height: 768 }
79
+ ```
80
+
81
+ ### Live desktop view
82
+
83
+ `streamUrl()` starts an authenticated noVNC stream inside the sandbox and returns a viewer URL. Open it in a browser to watch the agent work:
84
+
85
+ ```typescript
86
+ const url = await sandbox.computer.streamUrl()
87
+ // https://6080-<sandbox-id>.e2b.app/vnc.html?...&password=<auth-key>
88
+ ```
89
+
90
+ ### Desktop SDK escape hatch
91
+
92
+ Desktop-only APIs such as `launch`, `open`, window helpers, and custom stream control are available on the underlying [`@e2b/desktop`](https://github.com/e2b-dev/desktop) sandbox:
93
+
94
+ ```typescript
95
+ await sandbox.desktop.launch('xfce4-terminal')
96
+ await sandbox.desktop.open('https://mastra.ai')
97
+ ```
98
+
99
+ ## Constructor parameters
100
+
101
+ Accepts all [`E2BSandbox` options](https://mastra.ai/integrations/sandboxes/e2b) plus:
102
+
103
+ **resolution** (`[number, number]`): Desktop display resolution as \[width, height] in pixels. Applies to newly created sandboxes only.
104
+
105
+ **dpi** (`number`): Desktop display DPI. Applies to newly created sandboxes only.
106
+
107
+ When no `template` is provided, the E2B-hosted `desktop` template is used instead of the base provider's mountable template.
108
+
109
+ ## Properties
110
+
111
+ **computer** (`SandboxComputer`): Computer-use capability: screenshot, mouse, keyboard, and stream URL. See SandboxComputer reference.
112
+
113
+ **desktop** (`Sandbox`): The underlying @e2b/desktop SDK sandbox for desktop-only APIs. Throws if the sandbox has not started.
114
+
115
+ **name** (`string`): Provider name ('E2BDesktopSandbox')
116
+
117
+ **provider** (`string`): Provider identifier ('e2b-desktop')
118
+
119
+ ## Cloud storage mounting
120
+
121
+ The default `desktop` template has no FUSE tooling, so [cloud storage mounting](https://mastra.ai/integrations/sandboxes/e2b) requires a custom desktop template with `s3fs` or `gcsfuse` installed. Pass it with the `template` option.
122
+
123
+ ## Related
124
+
125
+ - [Computer-use tools](https://mastra.ai/docs/sandbox/overview)
126
+ - [`E2BSandbox` reference](https://mastra.ai/integrations/sandboxes/e2b)
127
+ - [`WorkspaceSandbox` interface](https://mastra.ai/reference/workspace/sandbox)
128
+ - [Sandbox](https://mastra.ai/docs/sandbox/overview)
@@ -40,6 +40,7 @@
40
40
  - [Daytona](https://mastra.ai/integrations/sandboxes/daytona)
41
41
  - [Docker](https://mastra.ai/integrations/sandboxes/docker)
42
42
  - [E2B](https://mastra.ai/integrations/sandboxes/e2b)
43
+ - [E2B Desktop](https://mastra.ai/integrations/sandboxes/e2b-desktop)
43
44
  - [Mastra](https://mastra.ai/reference/workspace/platform-sandbox)
44
45
  - [Modal](https://mastra.ai/integrations/sandboxes/modal)
45
46
  - [Railway](https://mastra.ai/integrations/sandboxes/railway)
@@ -10,6 +10,8 @@ The `WorkspaceSandbox` interface defines how workspaces execute commands and man
10
10
 
11
11
  **processes** (`SandboxProcessManager`): Background process manager. If not implemented, process management tools won't be available. See SandboxProcessManager reference.
12
12
 
13
+ **computer** (`SandboxComputer`): Computer-use (desktop) capability. If not implemented, computer tools won't be available. See Computer capability.
14
+
13
15
  ## Methods
14
16
 
15
17
  ### `start()`
@@ -195,6 +197,48 @@ const instructions = sandbox.getInstructions?.()
195
197
 
196
198
  **Returns:** `string`
197
199
 
200
+ ## Computer capability
201
+
202
+ Sandboxes with a controllable desktop environment implement the optional `SandboxComputer` interface on the `computer` property. When present on a statically configured sandbox, the workspace tools factory registers the `mastra_workspace_computer_*` tools automatically. See [Computer-use tools](https://mastra.ai/docs/sandbox/overview).
203
+
204
+ Coordinates are pixels from the top-left corner of the display. Providers normalize their SDK semantics (key names, scroll units) onto this surface and expose richer native APIs through their own accessors.
205
+
206
+ **screenshot()** (`() => Promise<{ data: Uint8Array; mediaType: "image/png" }>`): Capture the current display as a PNG image.
207
+
208
+ **leftClick(x, y)** (`(x: number, y: number) => Promise<void>`): Left-click at the given coordinates.
209
+
210
+ **rightClick(x, y)** (`(x: number, y: number) => Promise<void>`): Right-click at the given coordinates.
211
+
212
+ **doubleClick(x, y)** (`(x: number, y: number) => Promise<void>`): Double-click (left button) at the given coordinates.
213
+
214
+ **moveMouse(x, y)** (`(x: number, y: number) => Promise<void>`): Move the cursor without clicking.
215
+
216
+ **drag(from, to)** (`(from: ComputerPosition, to: ComputerPosition) => Promise<void>`): Press the left button at from, drag to to, and release.
217
+
218
+ **scroll(direction, amount)** (`(direction: 'up' | 'down', amount: number) => Promise<void>`): Scroll the display by the given amount of ticks.
219
+
220
+ **type(text)** (`(text: string) => Promise<void>`): Type text into the focused element.
221
+
222
+ **press(key)** (`(key: string | string[]) => Promise<void>`): Press a key or key combination. A string presses one key (for example 'Enter'); an array presses a chord (for example \['ctrl', 's']).
223
+
224
+ **getScreenSize()** (`() => Promise<{ width: number; height: number }>`): Get the display dimensions.
225
+
226
+ **getCursorPosition()** (`() => Promise<{ x: number; y: number }>`): Get the current cursor position.
227
+
228
+ **streamUrl()** (`() => Promise<string | null>`): Get a URL for a live view of the desktop, such as noVNC, or null when unavailable. Optional, not all providers expose a viewer.
229
+
230
+ Use the `supportsComputer()` type guard to check for the capability:
231
+
232
+ ```typescript
233
+ import { supportsComputer } from '@mastra/core/workspace'
234
+
235
+ if (supportsComputer(sandbox)) {
236
+ const { data } = await sandbox.computer.screenshot()
237
+ }
238
+ ```
239
+
240
+ `DaytonaSandbox` and `E2BDesktopSandbox` implement this capability. See the [Daytona](https://mastra.ai/integrations/sandboxes/daytona) and [E2B Desktop](https://mastra.ai/integrations/sandboxes/e2b-desktop) integration pages.
241
+
198
242
  ## Related
199
243
 
200
244
  - [SandboxProcessManager reference](https://mastra.ai/reference/workspace/process-manager)
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @mastra/mcp-docs-server
2
2
 
3
+ ## 1.2.19-alpha.19
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`48ef1f1`](https://github.com/mastra-ai/mastra/commit/48ef1f1d24eedafbb07f64e659a81b52b67b8bf6), [`63796ba`](https://github.com/mastra-ai/mastra/commit/63796ba0fda60253be17535e68f6bbbf1e6ffa09), [`3c19dce`](https://github.com/mastra-ai/mastra/commit/3c19dcef8e73062a80627a4927eae3ec11145afd)]:
8
+ - @mastra/core@1.62.0-alpha.12
9
+
3
10
  ## 1.2.19-alpha.18
4
11
 
5
12
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/mcp-docs-server",
3
- "version": "1.2.19-alpha.18",
3
+ "version": "1.2.19-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/mcp": "^1.17.2-alpha.2",
32
- "@mastra/core": "1.62.0-alpha.11"
31
+ "@mastra/core": "1.62.0-alpha.12",
32
+ "@mastra/mcp": "^1.17.2-alpha.2"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@hono/node-server": "^2.0.0",
@@ -47,7 +47,7 @@
47
47
  "vitest": "4.1.10",
48
48
  "@internal/lint": "0.0.125",
49
49
  "@internal/types-builder": "0.0.100",
50
- "@mastra/core": "1.62.0-alpha.11"
50
+ "@mastra/core": "1.62.0-alpha.12"
51
51
  },
52
52
  "homepage": "https://mastra.ai",
53
53
  "repository": {