Pavel Feldman 7ce4f88a5b
chore: use zod for mcp tools schemas (#35245)
Signed-off-by: Pavel Feldman <pavel.feldman@gmail.com>
Co-authored-by: Yury Semikhatsky <yurys@chromium.org>
2025-03-17 19:17:05 -07:00

1.1 KiB

Playwright MCP

This package is experimental and not yet ready for production use. It is a subject to change and will not respect semver versioning.

Example config

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp",
        "--headless"
      ]
    }
  }
}

Running headed browser (Browser with GUI).

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp"
      ]
    }
  }
}

Running headed browser on Linux

When running headed browser on system w/o display or from worker processes of the IDEs, you can run Playwright in a client-server manner. You'll run the Playwright server from environment with the DISPLAY

npx playwright run-server

And then in MCP config, add following to the env:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp"
      ],
      "env": {
        // Use the endpoint from the output of the server above.
        "PLAYWRIGHT_WS_ENDPOINT": "ws://localhost:<port>/"
      }
    }
  }
}