Repository navigation
Description
Problem
The Playwright MCP plugin (@playwright/mcp@latest) defaults to --browser chrome, which attempts to find Google Chrome at /opt/google/chrome/chrome. This fails on ARM64 (Apple Silicon) because Google Chrome does not ship for Linux ARM64.
What happens
When Claude Code invokes any Playwright MCP tool (e.g., browser_navigate), the user sees:
Error: server: Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome
Run "npx playwright install chrome"
Running the suggested command also fails:
$ npx playwright install chrome
ERROR: not supported on Linux Arm64
Current workaround (manual, per-session)
npx playwright install chromium
sudo mkdir -p /opt/google/chrome
sudo ln -sf /home/node/.cache/ms-playwright/chromium-*/chrome-linux/chrome /opt/google/chrome/chromeThis downloads ~180MB and requires a symlink hack — not something users should have to figure out.
Root cause
Two separate Playwright installations exist in the container:
| Project Playwright | Playwright MCP Plugin | |
|---|---|---|
| Version | @playwright/test from package.json |
Bundled inside @playwright/mcp@latest |
| Browser cache | /workspace/.playwright/ |
~/.cache/ms-playwright/ |
| Installed by | npx playwright install --only-shell (devcontainer setup) |
MCP plugin, on first use |
| Default browser | N/A (configured in playwright.config.ts) |
chrome (hardcoded default) |
The project's Playwright browsers are installed correctly during container setup. But the MCP plugin is a separate runtime that defaults to chrome — which doesn't exist on ARM64.
Proposed fix
Option A: Patch in project init-plugins.sh (per-project)
After the Playwright plugin is installed, override its MCP config to use chromium:
# Patch Playwright MCP plugin to use chromium (chrome not available on ARM64)
PLAYWRIGHT_MCP_CONFIG="$HOME/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/playwright/.mcp.json"
if [ -f "$PLAYWRIGHT_MCP_CONFIG" ]; then
echo '{"playwright":{"command":"npx","args":["@playwright/mcp@latest","--browser","chromium"]}}' > "$PLAYWRIGHT_MCP_CONFIG"
echo " Patched Playwright MCP to use chromium"
fiPros: Zero extra download, uses existing chromium, no symlink hack.
Cons: Every project using claude-code image needs this in their own init-plugins.sh.
Option B: Bake into the claude-code image (recommended)
Add to the image Dockerfile or a shared setup script so all projects benefit:
# Install chromium for the Playwright MCP plugin and symlink to expected Chrome path.
# The MCP plugin defaults to --browser chrome, which doesn't exist on ARM64.
RUN npx playwright install chromium \
&& CHROMIUM_BIN=$(find /home/node/.cache/ms-playwright -name "chrome" -path "*/chrome-linux/*" | head -1) \
&& if [ -n "$CHROMIUM_BIN" ]; then \
mkdir -p /opt/google/chrome && ln -sf "$CHROMIUM_BIN" /opt/google/chrome/chrome; \
fiPros: Works for all projects out of the box, no per-project config needed.
Cons: Adds ~180MB to image, browser version may differ from what MCP plugin expects (though Playwright handles graceful fallback).
Option C: Shared init script in the image (best of both)
Add a helper script to the image that projects can call from their init-plugins.sh:
# In image: /usr/local/bin/fix-playwright-mcp.sh
#!/bin/bash
PLAYWRIGHT_MCP_CONFIG="$HOME/.claude/plugins/marketplaces/claude-plugins-official/external_plugins/playwright/.mcp.json"
if [ -f "$PLAYWRIGHT_MCP_CONFIG" ]; then
echo '{"playwright":{"command":"npx","args":["@playwright/mcp@latest","--browser","chromium"]}}' > "$PLAYWRIGHT_MCP_CONFIG"
fiProjects opt in with one line: fix-playwright-mcp.sh
Environment
- Image:
ghcr.io/gatezh/devcontainer-images/claude-code:latest - Architecture: ARM64 (Apple Silicon Mac)
- Playwright MCP:
@playwright/mcp@latest(v0.0.69 at time of writing) - Plugin source:
playwright@claude-plugins-official
Activity
fix(claude-code): patch Playwright MCP plugin to use chromium on ARM64 (
fix(claude-code): patch Playwright MCP plugin to use chromium on ARM64 (
fix(ralphex-fe): patch Playwright MCP to use chromium on ARM64
fix: correct hadolint ARM64 download + Playwright MCP patch for ralph…