Skip to content

@playwright/mcp server fails to load tools in Cursor due to importAssertions warning #585

Open
@cy14700

Description

@cy14700

Describe the bug
When setting up the @playwright/mcp server in Cursor on Windows, the server shows a "green light" indicating a successful connection. However, none of the Playwright tools (e.g., browser_navigate) become available. The Cursor extension host console shows the following warning, which appears to be the root cause of the silent failure:
(node:...) ExperimentalWarning: Use 'importAttributes' instead of 'importAssertions'

This suggests the package or its dependencies are using an outdated syntax for import statements, which prevents the server from fully initializing, despite the process starting successfully.

To Reproduce

  1. Set up the following configuration in mcp.json on a Windows machine with a recent version of Cursor.
  2. Restart Cursor.
  3. Observe the green light for the Playwright MCP server.
  4. Attempt to call any Playwright tool, such as playwright_browser_navigate. The call will fail with "Tool not found".
  5. Check the Cursor developer console (Help > Toggle Developer Tools > Console). The importAssertions warning will be present.

mcp.json Configuration:

{
  "playwright": {
    "command": "cmd",
    "args": [
      "/c",
      "npx",
      "@playwright/mcp@latest"
    ]
  }
}

Expected behavior
The Playwright tools should be loaded and available for use in Cursor.

Key console error:

[Extension Host] (node:...) ExperimentalWarning: Use `importAttributes` instead of `importAssertions`
(Use `Cursor --trace-warnings ...` to show where the warning was created)

Desktop Environment:

  • OS: Windows 11

Additional context
Extensive troubleshooting has been performed, none of which resolved the issue:

  • Switched the npm registry to a reliable mirror (https://registry.npmmirror.com).
  • Initialized a full npm project (npm init -y, npm install @playwright/test).
  • Installed Playwright browsers (npx playwright install).
  • Cleared the npm cache (npm cache clean --force).

The issue appears to be inherent to the package's code and its compatibility with the Node.js environment used by Cursor's extension host.


Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions