Proposal
Give agents (kimi-code first; any MCP engine) controlled access to the desktop's embedded browser (<webview> webtabs) via a browser-bridge MCP server in the Electron main process, backed by webContents.debugger CDP. This is Kimi WebBridge's architecture (local service + CDP) rebuilt MCP-native and scoped to TermiPod.
Grounding (verified on this Mac, kimi-code 0.28.1 + current main)
- WebBridge itself is not reusable: in the 0.28.1 binary it is only a pinned marketplace promo (
kimi-webbridge, application/x-google-chrome-extension, "open in browser" → features page). The kimi-code CLI has no WebBridge client; the driver is Kimi Work (closed protocol). Feature page: local service + Chrome extension, agent commands → CDP.
- No extension needed here: webtabs are Electron
<webview> guests (electron/src/webtab.ts, partitions in webtab_policy.ts); the main process can attach webContents.debugger and speak raw CDP in-process. Verified live: TermiPod with --remote-debugging-port=9333 answers /json with Chrome 150 / protocol 1.3.
- The tool-delivery channel exists today: hostrunner
writeMCPConfigForFamily (launch_m2.go:676) injects per-spawn MCP config per family (kimi → <workdir>/.kimi-code/mcp.json, auto-discovered; claude → .mcp.json; codex/gemini equivalents). A bridge server entry is additive.
- Precedent tools: Google's
chrome-devtools-mcp (--browserUrl) and @playwright/mcp (--cdp-endpoint) validate the tool-surface shape (snapshot/click/type/navigate/screenshot over CDP + accessibility tree). A zero-code spike (launch TermiPod with --remote-debugging-port, point stock MCP at it) works but exposes the app:// shell too — not shippable.
Shape (details in the plan doc, PR to follow)
- W1 read-only: loopback+bearer MCP in main;
browser_list_tabs / browser_snapshot (AX tree) / browser_screenshot / browser_read_text; scoped strictly to allowlisted guest partitions (never the shell); desktop toggle (default off); discovery file ~/.termipod/browser-bridge.json (0o600, per-run token); hostrunner injects the stdio bridge entry at spawn.
- W2 actions: navigate/click/type/scroll/eval behind per-spawn opt-in; partition navigation policies enforced on tool calls (kimiweb stays loopback-pinned); audit events into the hub transcript.
- W3 hub-relayed: remote hosts drive the desktop browser through the hub WS; approval routing for action calls.
Security headline: webtab partitions persist real login cookies → web content is a prompt-injection vector; read vs action tool classes with separate gates.
Proposal
Give agents (kimi-code first; any MCP engine) controlled access to the desktop's embedded browser (
<webview>webtabs) via a browser-bridge MCP server in the Electron main process, backed bywebContents.debuggerCDP. This is Kimi WebBridge's architecture (local service + CDP) rebuilt MCP-native and scoped to TermiPod.Grounding (verified on this Mac, kimi-code 0.28.1 + current main)
kimi-webbridge,application/x-google-chrome-extension, "open in browser" → features page). The kimi-code CLI has no WebBridge client; the driver is Kimi Work (closed protocol). Feature page: local service + Chrome extension, agent commands → CDP.<webview>guests (electron/src/webtab.ts, partitions inwebtab_policy.ts); the main process can attachwebContents.debuggerand speak raw CDP in-process. Verified live: TermiPod with--remote-debugging-port=9333answers/jsonwith Chrome 150 / protocol 1.3.writeMCPConfigForFamily(launch_m2.go:676) injects per-spawn MCP config per family (kimi →<workdir>/.kimi-code/mcp.json, auto-discovered; claude →.mcp.json; codex/gemini equivalents). A bridge server entry is additive.chrome-devtools-mcp(--browserUrl) and@playwright/mcp(--cdp-endpoint) validate the tool-surface shape (snapshot/click/type/navigate/screenshot over CDP + accessibility tree). A zero-code spike (launch TermiPod with--remote-debugging-port, point stock MCP at it) works but exposes theapp://shell too — not shippable.Shape (details in the plan doc, PR to follow)
browser_list_tabs/browser_snapshot(AX tree) /browser_screenshot/browser_read_text; scoped strictly to allowlisted guest partitions (never the shell); desktop toggle (default off); discovery file~/.termipod/browser-bridge.json(0o600, per-run token); hostrunner injects the stdio bridge entry at spawn.Security headline: webtab partitions persist real login cookies → web content is a prompt-injection vector; read vs action tool classes with separate gates.