Skip to content

Fix Playwright and Backlog MCPs not using their configured defaults - #34

Open
szachovy wants to merge 1 commit into
masterfrom
fix/mcp-defaults-issue-33
Open

Fix Playwright and Backlog MCPs not using their configured defaults#34
szachovy wants to merge 1 commit into
masterfrom
fix/mcp-defaults-issue-33

Conversation

@szachovy

Copy link
Copy Markdown
Owner

Summary

Fixes #33 — two devcontainer MCPs weren't behaving as configured:

  • Playwright: --browser chromium internally resolves to Playwright's chrome-for-testing channel (a separately-managed/downloaded build), not the apt-installed /usr/bin/chromium. DISPLAY=":99" was set but no Xvfb server was ever started anywhere in the container lifecycle (the xvfb package was installed in Pin TruffleHog version, fix firewall DNS, remove instructions skill #29 as a workaround but never wired up). Result: headed launches crashed with "Missing X server", and Playwright fell back to downloading its own Chrome build — matching the "downloads chrome (or chrome-testing), initially fails, eventually succeeds" behavior in the issue. Traced this to a regression: Install curated Claude plugins; add headless Chromium (#16) #27 originally pinned the system Chromium via a Dockerfile env var, Pin TruffleHog version, fix firewall DNS, remove instructions skill #29 silently dropped it.
  • Backlog MCP: @radleta/backlog-md-mcp resolves the project directory via process.env.PWD || process.cwd(), preferring the env var. In this container PWD is inherited stale from the VS Code server process chain (not /workspace), even though the actual OS cwd is correct — so it always reports "Backlog.md is not initialized" and callers fall back to the raw CLI.

Both root causes were empirically verified (live reproduction, source tracing into the installed @playwright/mcp / @radleta/backlog-md-mcp packages, and git log -S for the Dockerfile regression) before fixing.

Changes

  • .devcontainer/Dockerfile: remove the dead xvfb package.
  • .devcontainer/config/{claude,codex,opencode}/*: playwright entries now pass --executable-path /usr/bin/chromium --headless and drop DISPLAY; backlog-md entries now set PWD=/workspace.
  • CHANGELOG.md: documented both fixes under [Unreleased].

Test plan

  • Validated JSON syntax of the two edited JSON configs (jq .)
  • Confirmed the pre-existing TOML file's multi-line inline table (unrelated to this change) is the only reason Python's strict tomllib rejects it; diff itself is well-formed
  • Live-reproduced the original crash (Missing X server or $DISPLAY, downloading from ~/.cache/ms-playwright/chromium-*), then live-verified the fix: started @playwright/mcp with the new args/env and drove a real browser_navigate call over the MCP protocol — succeeded instantly, no download, no display needed
  • Verified isBacklogInitialized('/workspace') returns true while the stale inherited PWD returns false, confirming PWD=/workspace resolves the detection bug

Playwright's --browser chromium silently resolves to the chrome-for-testing
channel (a separately-downloaded build), and DISPLAY=:99 was never backed by
a running Xvfb server, so headed launches crashed and fell back to
downloading its own browser. Pin --executable-path to the apt-installed
/usr/bin/chromium and run --headless instead; drop the now-dead xvfb package
and DISPLAY env var.

backlog-mcp resolves the project directory via process.env.PWD, which is
inherited stale from the VS Code server process chain rather than reflecting
the actual /workspace cwd, so it always reported "not initialized". Set
PWD=/workspace explicitly in its MCP env.

Fixes #33
@szachovy
szachovy force-pushed the fix/mcp-defaults-issue-33 branch from 791fe60 to e9c2318 Compare July 16, 2026 09:11

@szachovy szachovy left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check if I can use Chrome for testing: https://www.chromium.org/getting-involved/download-chromium/ with playwright

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCPs does not use defaults

1 participant