Skip to main content

Module server

Module server 

Source
Expand description

Minimal hand-rolled MCP JSON-RPC server over stdio.

This is the wave-3 skeleton. A future task may replace this with a more capable framework (e.g. rmcp). The protocol surface is small: newline-delimited JSON-RPC 2.0 over stdin/stdout.

Structs§

RegisteredTool
ServerState
State carried by the server. Tools reach into this for the resolved browser endpoint and any cached engine clients.
ToolRegistry

Functions§

run
Run the server using the real stdin/stdout.
run_with_streams
Run the server with injected I/O streams (used by tests).

Type Aliases§

BidiCache
Persistent BiDi session, opened lazily on first use. Reused across all tool calls because Firefox limits concurrent BiDi sessions per browser to one.
ToolHandler
Handler signature: takes (state, params) and returns a tool result.