Lessons building a stdio MCP server that drives a real browser via WebDriver BiDi
PumpingBytes · reddit · 2026-10-22
The author open-sourced zenpilot, a Python MCP server letting Claude Desktop/Code drive the Firefox-based Zen browser over WebDriver BiDi (no extension, WebSocket on 127.0.0.1:9222), and shares five unexpected pitfalls:
- Remote debugging silently weakens the profile: Firefox's agent rewrites 40 automation prefs (Safe Browsing, popup blocker, password saving) that Zen persists; writing remote.prefs.recommended=false to user.js prevents it.
- One BiDi session outlives the socket: handle session.end on signals/stdin close and release after 2 min idle so Desktop and Code can share.
- Claude Desktop lacks elicitation: site approval is a native macOS dialog Claude never sees (prompt-injection-proof), with a 45s timeout vs the 60s client tool timeout.
- A covered window breaks visibility waits: create tabs in background, 1s activate timeout.
- 0x0 viewport until Zen's welcome screen is dismissed.
Tool design: readpage returns a compact outline with r12-style refs instead of screenshots; errors are written for the model.
More from coding & agent
- Index Network open-sources Social Discovery Protocol: agents negotiate fit on your behalf — carsonfarmer · 2026-10-23
- Installed a formal-verification skill: it silently installed Java, MacBook runs 10 degrees hotter — zealcaiden · 2026-10-23
- OpenAI's Decisions API hits GA: near real-time routing up to 10x faster than GPT-6 Luna — OpenAIDevs · 2026-10-23
- Ruff author warns: upgrade Node/Bun now — --use-system-ca still accepts the eMudhra cert — charliermarsh · 2026-10-23
- Proof of Agent: paste one prompt and your AI mines, grades, and self-governs — adamamcbride · 2026-10-23
- DeepLearning.AI weekly: GPT-6.1 hits 97.9% byte parity on COBOL migration — DeepLearningAI · 2026-10-23