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_actionprints 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 asstdoutin the result.Action return values may contain WebDriver / WebElement instances that
json.dumpscannot serialise._serialize_valuereduces those torepr()strings before the server’s encoder sees them.
Functions
Return the browser-execution MCP tools. |