A web page can change after JavaScript runs, so reading its HTML alone may miss what a visitor sees. On Debian 12 (Bookworm) arm64, Playwright MCP lets Codex navigate a browser and read the resulting accessibility snapshot, including text added by the page.

Codex starts the server as a local stdio process and exchanges browser tool requests with it. Its accessibility snapshots describe headings, controls, and visible text; screenshots are available for visual checks, but are not required to read a page title or form label.

A Debian 12 arm64 development environment needs Node.js 20 or newer with npm and npx, system CA certificates, and an installed Codex CLI with a working model connection. Chromium must run as a regular user with a working browser sandbox. Browser pages and tool results remain untrusted input, even when the browser profile starts empty.

Steps to add the Playwright MCP server to Codex:

MCP servers execute local code with your user account's access, and browser tools can act on websites. An isolated browser profile starts without saved logins, but does not make page instructions trustworthy or restrict network access. A container also needs working user namespaces and an appropriate seccomp policy for Chromium's sandbox; Playwright's Docker documentation describes the non-root setup.

  1. Install Chromium's Linux system libraries as the environment administrator.
    # npx -y playwright@1.65.0-alpha-2026-10-30 install-deps chromium

    This installs operating-system packages and requires root or sudo. Playwright MCP 0.0.84 pins this Playwright version, whose Node.js requirement is 20 or newer.

  2. Download Chromium as the regular user who runs Codex.
    $ npx -y playwright@1.65.0-alpha-2026-10-30 install chromium

    The browser download belongs to the current user. Running Codex under another account can leave it unable to find the executable.

  3. Register the headless Playwright launcher in Codex.
    $ codex mcp add playwright -- npx -y @playwright/mcp@0.0.84 --browser chromium --headless --isolated --sandbox
    Added global MCP server 'playwright'.

    The pinned package keeps the launcher and browser versions aligned. Headless mode needs no display server; the isolated profile discards session storage when the browser closes. The sandbox option explicitly enables Chromium's sandbox. Codex saves the entry in its active user configuration for new sessions.

  4. Inspect the saved Playwright transport and arguments.
    $ codex mcp get playwright

    The transport should be stdio, the command npx, and the arguments should include the pinned package, --browser chromium, --headless, --isolated, and --sandbox. A saved entry alone does not prove that Chromium starts.
    Related: How to get Codex MCP server details

  5. Ask a fresh Codex session to read Example Domain through Playwright.
    $ codex "Use the playwright MCP server to open https://example.com, take an accessibility snapshot, and report the page title and paragraph text."

    Codex may request approval for the browser action; approval is limited to opening this public documentation domain. The reply should identify Example Domain and describe the domain's use in documentation examples. The session's tool activity should show Playwright navigation and a browser snapshot. A startup error, missing browser executable, or answer without a browser call does not establish that the connection works. The registered server remains available for later browser tasks.

Share this guide