Skip to main content

Module browser

Module browser 

Source
Expand description

The browser family: the core @playwright/mcp tools, forwarded to the server’s browser fleet.

Names and argument shapes are upstream’s, exactly. A prompt written against a Playwright MCP server names browser_navigate and passes a snapshot’s target ref, so the tools register unprefixed, with upstream’s argument schemas - transcribed from @playwright/mcp 0.0.83’s tools/list, the capture preserved with the V1 spec. Anything this family added on top (a hand-off tab, a forced click) would be a shape upstream does not have and a prompt that means something else here. Two descriptions differ: the close’s is this family’s own, because a close here closes the session’s current tab, and the snapshot’s gains the sentences on a ref’s lifetime and on driving a page that keeps changing.

The family is any-caller, and it is not a toggleable one. The browser is one machine-global one, not a scope like reviews or crons: every session may drive it, with one exception - browser_end_host belongs to a project’s lead, because it ends a host every session on the profile shares, and a worker is refused by name. A workspace with no fleet answers the no-host refusal rather than pretending the surface is absent.

The tool carries no logic. It forwards the call to the fleet and hands back the parts it returned - refs only mean something inside that browser’s own page state, so the server drives the page rather than answering for it.

Re-exports§

use std::sync::Arc; 🔒
use forge_primitives::SessionSlot; 🔒
use forge_primitives::browser::BrowserPart; 🔒
use forge_primitives::browser::HandOffEnding; 🔒
use forge_sdk::mcp::server::McpServerBuilder; 🔒
use forge_sdk::mcp::tool::Tool; 🔒
use forge_sdk::mcp::tool::ToolInput; 🔒
use forge_sdk::mcp::tool::ToolOutput; 🔒
use forge_sdk::mcp::tool::ToolOutputBlock; 🔒
use serde_json::Value; 🔒
use crate::mcp::browser::facade::BrowserFacade; 🔒
use specs::ToolSpec; 🔒

Modules§

facade
The narrow surface the browser tools call: one call, sent to the server’s browser fleet.
specs
The tool surface: what a session is offered, transcribed from @playwright/mcp 0.0.83’s own tools/list - the capture preserved with the V1 spec.

Structs§

BrowserTool 🔒
One registered tool: upstream’s spec, plus the caller it acts for.

Functions§

add_tools 🔒
Attach the browser tools to an existing builder, so they share the forge server name with every other family.
is_page_id 🔒
A page id as browser_tabs prints it: the page’s CDP target, 32 hex characters. A stale seat’s numeric schema has produced a digit run instead (DD241... arrived as 241), so anything of another shape is refused before it can name a page.
parts_output 🔒
What a host’s answer becomes on the tool’s way back: one content block per part, in order.