Your Mastra agents can now control a real Linux desktop with computer tools. Browse the web, fill in forms, download files, take screenshots, and run programs from a terminal — all from the safety of a sandbox.
We're launching today with two providers: E2B Desktop and Daytona. Both expose 11 computer_* tools your agents can use:
- Screenshot:
computer_screenshot - Mouse:
computer_click,computer_double_click,computer_right_click,computer_move_mouse,computer_drag,computer_scroll - Keyboard:
computer_type,computer_press_key - Environment:
computer_get_screen_info,computer_wait
An alternative is to use Mastra’s browser capabilities so your agents navigate the web, extract data, and pass it back for processing. But with computer tools, you can extend an agent's capabilities by giving it access to the whole sandbox operating system.
Supported providers implement Mastra's SandboxComputer interface, which includes several helper methods: .getScreenSize(), .getCursorPosition(), and .streamUrl() — to watch your agent live at work.
Get started
Install the E2B Desktop provider:
npm install @mastra/e2b-desktop@mastra/core@1.62.0 or later, added in PR #21700.Attach an E2BDesktopSandbox to your agent's Workspace:
import { Agent } from "@mastra/core/agent";
import { Workspace } from "@mastra/core/workspace";
import { E2BDesktopSandbox } from "@mastra/e2b-desktop";
export const computerToolsAgent = new Agent({
id: "computer-tools-agent",
name: "Computer Tools Agent",
instructions: /* ... */,
model: "anthropic/claude-sonnet-5",
workspace: new Workspace({
id: "computer-tools-workspace",
sandbox: new E2BDesktopSandbox({
id: "computer-tools-desktop",
apiKey: process.env.E2B_API_KEY,
})
}),
defaultOptions: { maxSteps: 50 }
});For more information and full configuration options, see:
