MCP server
@browserview/mcp is a Model Context Protocol server that gives any MCP-capable agent — Claude, Cursor, and others — tools to create and manage BrowserView sessions.
Setup
The server runs over stdio via npx and needs only your API key:
claude mcp add browserview \ -e BROWSERVIEW_API_KEY=bv_live_... \ -- npx -y @browserview/mcp{ "mcpServers": { "browserview": { "command": "npx", "args": ["-y", "@browserview/mcp"], "env": { "BROWSERVIEW_API_KEY": "bv_live_..." } } }}Set BROWSERVIEW_BASE_URL to point at a self-hosted orchestrator instead of sessions.browserview.io (the legacy BROWSERVIEW_API_URL name still works).
Tools
| Tool | What it does |
|---|---|
create_session | Start a browser session. Returns the viewer URL a human can open to watch, plus the CDP URL and token for driving it. |
list_sessions | List the account's active sessions. |
get_session | Fetch one session with freshly minted URLs and tokens. |
destroy_session | Destroy a session and everything in it. |
mint_session_token | Mint an extra scoped token (view, control, or cdp) — for example a view-only link to share with a teammate. |
get_session_replay | Fetch the replay of a session created with record: true — video plus action, console, network, and error event streams. Works after the session is destroyed. |
The pattern
The MCP tools manage session lifecycle; the agent's own browsing stack does the driving. A typical flow: the agent calls create_session, hands the viewer_url to its human, connects Playwright to the cdp_url, works, and calls destroy_session when finished. If the agent crashes instead, idle reaping cleans the session up automatically.
Pass record: true to create_session and the whole run is captured server-side — afterwards get_session_replay returns the video and event streams, even once the session is gone. See Session replay for the manifest format.