je_web_runner.mcp_server.browser_tools

MCP tools that drive a real browser via the WebRunner executor.

The executor already maps ~200 WR_* strings to callables (Selenium, Playwright, reporting, …); these tools simply hand a JSON-RPC arguments payload through to execute_action / execute_files.

Two hazards are handled here so the rest of the protocol stays clean:

  • execute_action prints each record to stdout. The MCP server speaks JSON-RPC over stdout, so stray prints corrupt the wire. We redirect stdout into a buffer for the duration of the call and surface it as stdout in the result.

  • Action return values may contain WebDriver / WebElement instances that json.dumps cannot serialise. _serialize_value reduces those to repr() strings before the server’s encoder sees them.

Functions

build_browser_tools()

Return the browser-execution MCP tools.

je_web_runner.mcp_server.browser_tools.build_browser_tools() List[Tool]

Return the browser-execution MCP tools.