How do I get Codex to use the browser?

Good qeustion.

Note: I have never used playwright or used an AI to control or access a browser, just trying to help.

Checked the Issues both open and closed

For example:

by simonegiacomelli (Simone) · GitHub

Just for reference, below the excerpt that fixed the issue for me.

Pertinent section from ~/.codex/config.toml:

[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]
env_vars = ["DISPLAY", "WAYLAND_DISPLAY", "XAUTHORITY", "XDG_RUNTIME_DIR"]

HTH


FYI for others