Chrome DevTools Protocol endpoint URLs change every time such a browser is opened, making --cdp-endpoint an inviable argument for repeated testing, especially since both the user and the LLM could close the browser accidentally. The process for using a remote-debugging-enabled Chrome instance with the Playwright MCP server currently looks like this:
- Open a terminal and execute
cd "C:\Program Files\Google\Chrome\Application".
- Execute
.\chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\ChromeRemoteDebuggingUserData".
- In Chrome, navigate to
http://localhost:9222/json/version and copy the value of webSocketDebuggerUrl.
- Configure a "playwright" MCP server with command
npx @playwright/mcp@latest --cdp-endpoint=<webSocketDebuggerUrl>. The need to update this every time the Chrome browser is launched is the bottleneck that makes continued testing an issue.
The Chrome DevTools MCP server offers a --browser-url argument that accepts the value http://localhost:9222/, which allows it to connect to the browser instance without fail, even if it has been closed and re-opened. I propose that a similar argument be added to the Playwright MCP server.
Chrome DevTools Protocol endpoint URLs change every time such a browser is opened, making
--cdp-endpointan inviable argument for repeated testing, especially since both the user and the LLM could close the browser accidentally. The process for using a remote-debugging-enabled Chrome instance with the Playwright MCP server currently looks like this:cd "C:\Program Files\Google\Chrome\Application"..\chrome.exe --remote-debugging-port=9222 --user-data-dir="C:\ChromeRemoteDebuggingUserData".http://localhost:9222/json/versionand copy the value ofwebSocketDebuggerUrl.npx @playwright/mcp@latest --cdp-endpoint=<webSocketDebuggerUrl>. The need to update this every time the Chrome browser is launched is the bottleneck that makes continued testing an issue.The Chrome DevTools MCP server offers a
--browser-urlargument that accepts the valuehttp://localhost:9222/, which allows it to connect to the browser instance without fail, even if it has been closed and re-opened. I propose that a similar argument be added to the Playwright MCP server.