
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@mastra/browser-viewer
Advanced tools
Affected versions:
Playwright-based browser viewer for Mastra workspaces with CLI provider support.
@mastra/browser-viewer provides BrowserViewer, which launches Chrome via Playwright and exposes the CDP URL for CLI tools (agent-browser, browser-use, or browse) to connect. This gives you:
npm install @mastra/browser-viewer
import { BrowserViewer } from '@mastra/browser-viewer';
const viewer = new BrowserViewer({
cli: 'agent-browser', // Which CLI the agent will use
headless: false, // Show browser window
});
// Launch browser
await viewer.launch();
// Get CDP URL for CLIs to connect
const cdpUrl = await viewer.getCdpUrl();
console.log(cdpUrl); // ws://127.0.0.1:9222/devtools/browser/...
import { BrowserViewer } from '@mastra/browser-viewer';
const viewer = new BrowserViewer({
cli: 'agent-browser',
cdpUrl: 'ws://127.0.0.1:9222/devtools/browser/abc123',
});
The CDP URL is automatically injected into CLI commands when used with workspace tools.
import { Workspace, LocalSandbox } from '@mastra/core';
import { BrowserViewer } from '@mastra/browser-viewer';
const workspace = new Workspace({
sandbox: new LocalSandbox({ cwd: './workspace' }),
browser: new BrowserViewer({
cli: 'agent-browser',
headless: false,
}),
});
// When agent runs: agent-browser open https://google.com
// Mastra auto-injects the CDP connection so CLI uses Mastra's browser
| Option | Type | Default | Description |
|---|---|---|---|
cli | 'agent-browser' | 'browser-use' | 'browse' | 'browse-cli' | Required | Which CLI the agent uses |
cdpUrl | string | - | Connect to existing browser instead of launching |
headless | boolean | true | Run browser in headless mode |
cdpPort | number | 0 (auto) | Port for Chrome remote debugging |
viewport | { width, height } | 1280x720 | Browser viewport size |
executablePath | string | - | Path to Chrome executable |
--remote-debugging-portworkspace_execute_command--cdp <port>)--cdp-url <url>)--ws <url>)Apache-2.0
FAQs
Playwright-based browser viewer for Mastra CLI providers
The npm package @mastra/browser-viewer receives a total of 1,010 weekly downloads. As such, @mastra/browser-viewer popularity was classified as popular.
We found that @mastra/browser-viewer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.