Codex browser checks need a local browser automation server when a task depends on rendered pages, forms, screenshots, console output, or network activity. Adding the Playwright MCP server gives new Codex sessions a named stdio launcher that can open pages and return structured accessibility snapshots from the same prompt.

Codex stores MCP server definitions in config.toml, with the user-level file at ~/.codex/config.toml and optional project-scoped config in trusted repositories. The CLI and IDE extension share those configuration layers, so a server saved with codex mcp add can be reused by either client when the same CODEX_HOME and project trust state apply.

Playwright MCP requires Node.js 18 or newer and runs through npx @playwright/mcp@latest in the published setup. The browser opens in headed mode by default and uses a persistent profile, so choose browser-state flags before saving the launcher when a task needs headless operation, an isolated profile, or a specific saved session.

Steps to add the Playwright MCP server to Codex:

  1. Add the published Playwright MCP launcher to Codex.
    $ codex mcp add playwright -- npx @playwright/mcp@latest
    Added global MCP server 'playwright'.

    Append server flags after @playwright/mcp@latest before saving the entry when the browser should start differently, such as --headless for no visible browser or --isolated for a fresh in-memory profile.

  2. Check the saved Playwright MCP entry as JSON.
    $ codex mcp get playwright --json
    {
      "name": "playwright",
      "enabled": true,
      "disabled_reason": null,
      "transport": {
        "type": "stdio",
        "command": "npx",
        "args": [
          "@playwright/mcp@latest"
        ],
        "env": null,
        "env_vars": [],
        "cwd": null
      },
      "enabled_tools": null,
      "disabled_tools": null,
      "startup_timeout_sec": null,
      "tool_timeout_sec": null
    }

    Confirm transport.type is stdio, transport.command is npx, and transport.args contains @playwright/mcp@latest.
    Related: How to get Codex MCP server details

  3. List configured MCP servers.
    $ codex mcp list
    Name        Command  Args                    Env  Cwd  Status   Auth       
    playwright  npx      @playwright/mcp@latest  -    -    enabled  Unsupported

    Unsupported under Auth is expected for this local stdio launcher because it does not use bearer-token or OAuth login.
    Related: How to list Codex MCP servers

  4. Start a new Codex session after saving the server.
    $ codex

    Run /mcp inside the terminal UI and check that playwright appears. Restart an already-open CLI or IDE session so it reloads the saved MCP configuration.

  5. Send a prompt that needs browser navigation.
    Open https://www.simplified.tools/check_my_browser?source=sg and tell me the browser name shown on the page.

    The first run may take longer while npx fetches @playwright/mcp. A working session can navigate to the page, read browser-visible text, and report the requested value. Approve the MCP tool call if Codex asks before opening the page.
    Tool: What Is My Browser