Architecture
webmcp-bridge has four layers.
Layers
local-mcpOne-site stdio MCP server. It exposestools/list,tools/call, and the reservedbridge.*controls.playwrightBrowser page gateway, page lifecycle, and runtime dispatch.adapter-*Fallback site logic used only when native WebMCP is unavailable.coreShared contracts and shim/runtime behavior for fallback paths.
Native-First Flow
- local client starts
local-mcp local-mcpopens a browser page through Playwright- Playwright checks whether the page exposes native
navigator.modelContext - if native WebMCP exists, the bridge forwards tool discovery and calls directly
- if not, the bridge installs shim behavior and dispatches to an adapter
Boundaries
- adapters should stay thin and site-specific
- bridge layers should stay site-agnostic
- credentials stay in the browser profile, not in local scripts
- ambiguous upstream states fail closed
Example App
The repo also contains a native browser example:
examples/board
It is a WebMCP provider example, not a fallback adapter.