Windows - Playwright MCP issue

Resolved 💬 4 comments Opened Aug 20, 2025 by tomasmarekk Closed Sep 3, 2025
💡 Likely answer: A maintainer (gpeal, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.23.0

Which model were you using?

gpt-5

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What steps can reproduce the bug?

I understand that Codex CLI on Windows isn’t ideal, but it would be great if you could fix the Playwright MCP functionality as soon as possible, since it’s one of the most important MCP servers for AI development.

I’m not sure whether this affects other Codex MCP configurations on Windows, but I’m having trouble setting up this MCP correctly. I’ve tried many options and I keep getting the following error in Codex:

Prompt: "go to http://localhost:3000/ and investigate Next.js error."

tool failed, duration: 3ms
playwright.browser_navigate({"url":"http://localhost:3000/"})
### ResultError: listen UNKNOWN: unknown error 0.0.0.0

This is my config.toml file:

[mcp_servers.playwright]
command = "C:\\Program Files\\nodejs\\node.exe"
args = ["C:\\Users\\xxxx\\AppData\\Roaming\\npm\\node_modules\\@playwright\\mcp\\cli.js", "--headless", "--browser", "chromium"]

What is the expected behavior?

_No response_

What do you see instead?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

tomasmarekk · 1 year ago

So I found a way to configure config.toml so that Playwright MCP works in the Windows binary without any problems.

I had to add this .env structure, and after that everything works great.


[mcp_servers.playwright]
command = "C:\\Program Files\\nodejs\\node.exe"
args = ["C:\\Users\\xxxx\\AppData\\Roaming\\npm\\node_modules\\@playwright\\mcp\\cli.js"]
[mcp_servers.playwright.env]
LOCALAPPDATA = 'C:\Users\xxxx\AppData\Local'
APPDATA = 'C:\Users\xxxx\AppData\Roaming'
PROGRAMFILES = 'C:\Program Files'
"PROGRAMFILES(X86)" = 'C:\Program Files (x86)'
SYSTEMROOT = 'C:\Windows'
WINDIR = 'C:\Windows'
HOMEDRIVE = 'C:'
HOMEPATH = '\Users\xxxx'
HOME = 'C:\Users\xxxx'

I understand you’re probably still tweaking Windows support, so let me know if anything changes and I’ll update it again 👍

gpeal contributor · 11 months ago

Thanks for posting a fix/workaround @marektomas-cz

mikekidder · 11 months ago

FYI -- If someone lands here looking for workaround until fixed.

I've tested workaround and got it working with just one playwright env needed on Windows 11

[mcp_servers.playwright]
command = "C:\\\Users\\\xxxxx\\\AppData\\\Roaming\\\npm\\\npx.cmd"
args = ["@playwright/mcp@latest"]

[mcp_servers.playwright.env]
SYSTEMROOT = 'C:\Windows'

berlinjudas · 11 months ago
FYI -- If someone lands here looking for workaround until fixed. I've tested workaround and got it working with just one playwright env needed on Windows 11 [mcp_servers.playwright] command = "C:\\Users\\xxxxx\\AppData\\Roaming\\npm\\npx.cmd" args = ["@playwright/mcp@latest"] [mcp_servers.playwright.env] SYSTEMROOT = 'C:\Windows'

@mikekidder thank you very much! Countless hours I tried to solve this under Windows 11. But only your solutions brought success.

This is my config.toml

[projects."C:/Users/xxxxx"]
trust_level = "trusted"

[mcp_servers.playwright]
command = 'C:\\Program Files\\nodejs\\npx.cmd'
args = ["-y", "@playwright/mcp@latest", "--extension", "--browser", "chrome", "--executable-path", "C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe", "--timeout-navigation", "30000", "--timeout-action", "10000", "--image-responses", "omit"]

[mcp_servers.playwright.env]
SYSTEMROOT = 'C:\\Windows'