je_web_runner.mcp_server

WebRunner MCP server: expose WR_* actions over the Model Context Protocol.

class je_web_runner.mcp_server.McpServer(tools: Dict[str, ~je_web_runner.mcp_server.server.Tool]=<factory>, initialized: bool = False)

Bases: object

JSON-RPC 2.0 server that speaks the MCP wire protocol over stdio.

handle(message: Dict[str, Any]) Dict[str, Any] | None
initialized: bool = False
register(tool: Tool) None
tools: Dict[str, Tool]
exception je_web_runner.mcp_server.McpServerError

Bases: WebRunnerException

Raised when the server encounters a fatal protocol error.

je_web_runner.mcp_server.build_browser_tools() List[Tool]

Return the browser-execution MCP tools.

je_web_runner.mcp_server.build_default_tools() List[Tool]

Construct the default tool list shipped with the server.

je_web_runner.mcp_server.serve_stdio(stdin: TextIO | None = None, stdout: TextIO | None = None, server: McpServer | None = None) None

主迴圈:每行一個 JSON-RPC 2.0 訊息,直到 stdin EOF Read newline-delimited JSON-RPC messages from stdin until EOF and write responses to stdout.

Modules

browser_tools

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

server

WebRunner MCP server:用 Model Context Protocol (JSON-RPC 2.0) 把 WR_* 動作對外開放。 WebRunner MCP server.