playwright-mcp fails to start in Cursor after 0.0.19/0.0.20 (Client closed / Connection closed)
After switching the playwright MCP server to npx @playwright/mcp@latest, Cursor shows 'Error in MCP: Client closed' and 'MCP error -32000: Connection closed' when reloading the client. Pinning v0.0.18 works in Cursor 0.49.6, but the reporter wants a newer version running. What fixes it?
Originally asked on GitHub: https://github.com/microsoft/playwright-mcp/issues/344
6 answers
Status: fixed. A commenter reported that
@playwright/mcp@v0.0.22fixes the startup failure in Cursor, and the maintainers published 0.0.22 in response to the thread.The thread points to Node.js version as the variable. The reporter had Node 18.17 and upgraded to Node 20+, which still failed. One commenter suspected that Cursor's MCP loader does not activate nvm, so an older Node.js installed elsewhere on the system may be picked up. Another commenter said updating their nvm setup to Node 22 solved it, and a separate comment noted the change to v22 compatibility should be stated in package.json.
Steps from the thread:
- Pin the fixed version in your MCP config:
json"playwright": { "command": "npx", "args": [ "@playwright/mcp@v0.0.22" ] }-
Alternatively, make sure the Node.js that Cursor uses is version 22.x. One commenter fixed it by updating nvm to Node 22.
-
Reload the MCP client from the Cursor UI.
Note: one commenter still saw 'Client closed' with
@playwright/mcp@0.0.22while running Node v20.9.0, so check the Node version Cursor actually uses.Did this work for you?What @bordoni tried on GitHub (Didn't work)
Used
npx @playwright/mcp@latestwith Node 18.17; after upgrading to Node 20+, Cursor reload still failed with 'Connection closed'. Pinning@playwright/mcp@v0.0.18worked.Source: https://github.com/microsoft/playwright-mcp/issues/344 (opens external site)
Did this work for you?What @mxschmitt tried on GitHub (Outcome unclear)
Suggested that an older Node.js on the system is picked up because Cursor's MCP loader does not activate nvm; advised using a recent 18.x or 22.x.
Source: https://github.com/microsoft/playwright-mcp/issues/344#issuecomment-2849103518 (opens external site)
Did this work for you?What @hanan-monday tried on GitHub (Worked)
Updated nvm to use Node 22 on their system, after which the server started.
Source: https://github.com/microsoft/playwright-mcp/issues/344#issuecomment-2857368047 (opens external site)
Did this work for you?What @mxschmitt tried on GitHub (Outcome unclear)
A contributor suggested trying
@playwright/mcp@v0.0.22, which had just been published.Source: https://github.com/microsoft/playwright-mcp/issues/344#issuecomment-2858116489 (opens external site)
Did this work for you?What @lindon0390 tried on GitHub (Didn't work)
Tried
@playwright/mcp@0.0.22with Node v20.9.0 in Cursor 0.49.6; still got 'Client closed' and 'No server info found'.Source: https://github.com/microsoft/playwright-mcp/issues/344#issuecomment-2858166294 (opens external site)
Did this work for you?
Related questions
- Playwright MCP browser_take_screenshot shows no saved file or unreadable image in Cursor or VS Code
- Windows: playwright-mcp via Claude Desktop fails: Chromium distribution 'chrome' is not found
- Can I generate codegen-style Playwright test code from a prompt-driven playwright-mcp flow?
- Does Playwright MCP have a quiet mode to reduce page snapshot tokens?
- How to fix 'Browser window not found' when using playwright-mcp in headless mode?