feat(collab): bake Playwright browser MCP (off by default) + fix Headroom serve#48
Merged
Merged
Conversation
…room serve Add @playwright/mcp@0.0.76 to the collab container with a version-matched headless Chromium baked at PLAYWRIGHT_BROWSERS_PATH (no runtime download). Registered as an OFF-by-default MCP server in the global opencode.json, so it appears in every collab session's MCP toggle panel; a Driver enables it per session when browser automation is needed. --headless --no-sandbox keep Chromium runnable as the non-root opencode user; --isolated gives each connect a throwaway profile (no cross-session state) for multi-user safety. Adds the browser cache/output dirs and an AGENTS.md nudge. Also fixes the Headroom MCP launch command on the same baked-config line: the stdio server is `headroom mcp serve`, not `headroom mcp` (the bare subcommand group printed help and exited, so the handshake never completed and opencode flagged the server failed). Bumps its connect timeout 10s -> 30s. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a Playwright browser-automation MCP to the collab container and fixes the Headroom MCP launch command (both edits live on the same baked-config line, hence one PR).
Playwright MCP
npm install -g @playwright/mcp@0.0.76+ a version-matched headless Chromium baked at build time (PLAYWRIGHT_BROWSERS_PATH=/home/opencode/.cache/playwright) — installed via the bundled playwright so the browser revision can't drift. No runtime download / no cold-task network dependency.opencode.jsonmcpblock asenabled:false→ shows in every collab session's MCP toggle panel (grey dot); a Driver flips it ON per session when browser automation is needed. Idle cost is zero until toggled.--headless --no-sandbox(mandatory for Chromium as the non-rootopencodeuser withoutSYS_ADMIN) +--isolated(throwaway profile per connect → no cross-session state, no disk growth) +--browser chromium+--output-dir /home/opencode/.cache/playwright-output.timeout:60000for the first browser launch.Headroom fix (same line)
["headroom","mcp"]→["headroom","mcp","serve"]. The baremcpis the subcommand group (install/status/uninstall/serve) — it printed help and exited, so the stdio handshake never completed and opencode flagged the server failed (the red dot). Connect timeout bumped 10s → 30s.Why
Built-in browser tools (
OPENCODE_ENABLE_BROWSER/browser:true) do not exist in this fork (v1.15.4) — verified by repo-wide grep — so an MCP server is the only route. Mirrors the existing Headroom MCP bake pattern.Scope
Dockerfile. No app code, no infra/terraform, no new ports or domains.Verification
opencode.jsonre-parses;mcp={headroom (serve, on), playwright (off)}.command -v playwright-mcp,playwright-mcp --version,ls $PLAYWRIGHT_BROWSERS_PATH/chromium-*.playwrightgrey → toggle ON → green within 60s → prompt "navigate to example.com and screenshot" → output in/home/opencode/.cache/playwright-output.Guardrails
enabled:false+--isolatedkeep memory off the 4 vCPU / 16 GB task (shared with the preview build) until actually used; the existing S6 cgroup memory monitor still WARNs >13 GB.🤖 Generated with Claude Code