Skip to content
Back to search

playwright-mcp

Playwright MCP server

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/microsoft/playwright-mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/microsoft/playwright-mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/microsoft--playwright-mcp/badge.svg)](/listings/microsoft--playwright-mcp)

HTML

<a href="/listings/microsoft--playwright-mcp"><img src="/api/listings/microsoft--playwright-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

First, install the Playwright MCP server with your client.

**Standard config** works in most of the tools:

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

[<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)

<details> <summary>Amp</summary>

Add via the Amp VS Code extension settings screen or by updating your settings.json file:

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

**Amp CLI Setup:**

Add via the `amp mcp add` command below

amp mcp add playwright -- npx @playwright/mcp@latest

</details>

<details> <summary>Antigravity</summary>

Add via the Antigravity settings or by updating your configuration file:

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

</details>

<details> <summary>Claude Code</summary>

Use the Claude Code CLI to add the Playwright MCP server:

claude mcp add playwright npx @playwright/mcp@latest

</details>

<details> <summary>Claude Desktop</summary>

Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use the standard config above.

</details>

<details> <summary>Cline</summary>

Follow the instruction in the section [Configuring MCP Servers](https://docs.cline.bot/mcp/configuring-mcp-servers)

**Example: Local Setup**

Add the following to your [`cline_mcp_settings.json`](https://docs.cline.bot/mcp/configuring-mcp-servers#editing-mcp-settings-files) file:

{
  "mcpServers": {
    "playwright": {
      "type": "stdio",
      "command": "npx",
      "timeout": 30,
      "args": [
        "-y",
        "@playwright/mcp@latest"
      ],
      "disabled": false
    }
  }
}

</details>

<details> <summary>Codex</summary>

Use the Codex CLI to add the Playwright MCP server:

codex mcp add playwright npx "@playwright/mcp@latest"

Alternatively, create or edit the configuration file `~/.codex/config.toml` and add:

[mcp_servers.playwright]
command = "npx"
args = ["@playwright/mcp@latest"]

For more information, see the [Codex MCP documentation](https://github.com/openai/codex/blob/main/codex-rs/config.md#mcp_servers).

</details>

<details> <summary>Copilot</summary>

Use the Copilot CLI to interactively add the Playwright MCP server:

/mcp add

Alternatively, create or edit the configuration file `~/.copilot/mcp-config.json` and add:

{
  "mcpServers": {
    "playwright": {
      "type": "local",
      "command": "npx",
      "tools": [
        "*"
      ],
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}

For more information, see the [Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli).

</details>

<details> <summary>Cursor</summary>

Click the button to install:

[<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=Playwright&config=eyJjb21tYW5kIjoibnB4IEBwbGF5d3JpZ2h0L21jcEBsYXRlc3QifQ%3D%3D)

Or install manually:

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 1,703 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. ## Playwright MCP
  2. A Model Context Protocol (MCP) server that provides browser automation capabilities using [Playwright](https://playwright.dev). This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
  3. ### Playwright MCP vs Playwright CLI
  4. This package provides MCP interface into Playwright. If you are using a **coding agent**, you might benefit from using the [CLI+SKILLS](https://github.com/microsoft/playwright-cli) instead.
  5. - **CLI**: Modern **coding agents** increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.<br>**Learn more about [Playwright CLI with SKILLS](https://github.com/microsoft/playwright-cli)**.
  6. - **MCP**: MCP remains relevant for specialized agentic loops that benefit from persistent state, rich introspection, and iterative reasoning over page structure, such as exploratory automation, self-healing tests, or long-running autonomous workflows where maintaining continuous browser context outweighs token cost concerns.
  7. ### Key Features
  8. - **Fast and lightweight**. Uses Playwright's accessibility tree, not pixel-based input.
  9. - **LLM-friendly**. No vision models needed, operates purely on structured data.
  10. - **Deterministic tool application**. Avoids ambiguity common with screenshot-based approaches.
  11. ### Requirements
  12. - Node.js 20 or newer
  13. - VS Code, Cursor, Windsurf, Claude Desktop, Goose, Grok, Junie or any other MCP client
  14. <!--
  15. // Generate using:
  16. node utils/generate-links.js
  17. -->
  18. ### Getting started
  19. First, install the Playwright MCP server with your client.
  20. **Standard config** works in most of the tools:
  21. ```js
  22. {
  23. "mcpServers": {
  24. "playwright": {
  25. "command": "npx",
  26. "args": [
  27. "@playwright/mcp@latest"
  28. ]
  29. }
  30. }
  31. }
  32. ```
  33. [<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)
  34. <details>
  35. <summary>Amp</summary>
  36. Add via the Amp VS Code extension settings screen or by updating your settings.json file:
  37. ```json
  38. "amp.mcpServers": {
  39. "playwright": {
  40. "command": "npx",
  41. "args": [
  42. "@playwright/mcp@latest"
  43. ]
  44. }
  45. }
  46. ```
  47. **Amp CLI Setup:**
  48. Add via the `amp mcp add` command below
  49. ```bash
  50. amp mcp add playwright -- npx @playwright/mcp@latest
  51. ```
  52. </details>
  53. <details>
  54. <summary>Antigravity</summary>
  55. Add via the Antigravity settings or by updating your configuration file:
  56. ```json
  57. {
  58. "mcpServers": {
  59. "playwright": {
  60. "command": "npx",
  61. "args": [
  62. "@playwright/mcp@latest"
  63. ]
  64. }
  65. }
  66. }
  67. ```
  68. </details>
  69. <details>
  70. <summary>Claude Code</summary>
  71. Use the Claude Code CLI to add the Playwright MCP server:
  72. ```bash
  73. claude mcp add playwright npx @playwright/mcp@latest
  74. ```
  75. </details>
  76. <details>
  77. <summary>Claude Desktop</summary>
  78. Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use the standard config above.
  79. </details>
  80. <details>
  81. <summary>Cline</summary>
  82. Follow the instruction in the section [Configuring MCP Servers](https://docs.cline.bot/mcp/configuring-mcp-servers)
  83. **Example: Local Setup**
  84. Add the following to your [`cline_mcp_settings.json`](https://docs.cline.bot/mcp/configuring-mcp-servers#editing-mcp-settings-files) file:
  85. ```json
  86. {
  87. "mcpServers": {
  88. "playwright": {
  89. "type": "stdio",
  90. "command": "npx",
  91. "timeout": 30,
  92. "args": [
  93. "-y",
  94. "@playwright/mcp@latest"
  95. ],
  96. "disabled": false
  97. }
  98. }
  99. }
  100. ```
  101. </details>
  102. <details>
  103. <summary>Codex</summary>
  104. Use the Codex CLI to add the Playwright MCP server:
  105. ```bash
  106. codex mcp add playwright npx "@playwright/mcp@latest"
  107. ```
  108. Alternatively, create or edit the configuration file `~/.codex/config.toml` and add:
  109. ```toml
  110. [mcp_servers.playwright]
  111. command = "npx"
  112. args = ["@playwright/mcp@latest"]
  113. ```
  114. For more information, see the [Codex MCP documentation](https://github.com/openai/codex/blob/main/codex-rs/config.md#mcp_servers).
  115. </details>
  116. <details>
  117. <summary>Copilot</summary>
  118. Use the Copilot CLI to interactively add the Playwright MCP server:
  119. ```bash
  120. /mcp add
  121. ```
  122. Alternatively, create or edit the configuration file `~/.copilot/mcp-config.json` and add:
  123. ```json
  124. {
  125. "mcpServers": {
  126. "playwright": {
  127. "type": "local",
  128. "command": "npx",
  129. "tools": [
  130. "*"
  131. ],
  132. "args": [
  133. "@playwright/mcp@latest"
  134. ]
  135. }
  136. }
  137. }
  138. ```
  139. For more information, see the [Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli).
  140. </details>
  141. <details>
  142. <summary>Cursor</summary>
  143. #### Click the button to install:
  144. [<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=Playwright&config=eyJjb21tYW5kIjoibnB4IEBwbGF5d3JpZ2h0L21jcEBsYXRlc3QifQ%3D%3D)
  145. #### Or install manually:
  146. Go to `Cursor Settings` -> `MCP` -> `Add new MCP Server`. Name to your liking, use `command` type with the command `npx @playwright/mcp@latest`. You can also verify config or add command like arguments via clicking `Edit`.
  147. </details>
  148. <details>
  149. <summary>Factory</summary>
  150. Use the Factory CLI to add the Playwright MCP server:
  151. ```bash
  152. droid mcp add playwright "npx @playwright/mcp@latest"
  153. ```
  154. Alternatively, type `/mcp` within Factory droid to open an interactive UI for managing MCP servers.
  155. For more information, see the [Factory MCP documentation](https://docs.factory.ai/cli/configuration/mcp).
  156. </details>
  157. <details>
  158. <summary>Gemini CLI</summary>
  159. Follow the MCP install [guide](https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md#configure-the-mcp-server-in-settingsjson), use the standard config above.
  160. </details>
  161. <details>
  162. <summary>Goose</summary>
  163. #### Click the button to install:
  164. [![Install in Goose](https://block.github.io/goose/img/extension-install-dark.svg)](https://block.github.io/goose/extension?cmd=npx&arg=%40playwright%2Fmcp%40latest&id=playwright&name=Playwright&description=Interact%20with%20web%20pages%20through%20structured%20accessibility%20snapshots%20using%20Playwright)
  165. #### Or install manually:
  166. Go to `Advanced settings` -> `Extensions` -> `Add custom extension`. Name to your liking, use type `STDIO`, and set the `command` to `npx @playwright/mcp`. Click "Add Extension".
  167. </details>
  168. <details>
  169. <summary>Grok</summary>
  170. Use the Grok CLI to add the Playwright MCP server:
  171. ```bash
  172. grok mcp add playwright -- npx @playwright/mcp@latest
  173. ```
  174. Alternatively, create or edit the configuration file `~/.grok/config.toml` and add:
  175. ```toml
  176. [mcp_servers.playwright]
  177. command = "npx"
  178. args = ["@playwright/mcp@latest"]
  179. ```
  180. For more information, see the [Grok MCP documentation](https://docs.x.ai/build/features/mcp-servers).
  181. </details>
  182. <details>
  183. <summary>Junie</summary>
  184. To add the Playwright MCP server in Junie CLI:
  185. 1. Type `/mcp`
  186. 2. Press `Ctrl+A` to add a new MCP server
  187. 3. Select **Playwright** from the list
  188. Alternatively, add to `.junie/mcp/mcp.json`:
  189. ```json
  190. {
  191. "mcpServers": {
  192. "Playwright": {
  193. "command": "npx",
  194. "args": [
  195. "-y",
  196. "@playwright/mcp@latest"
  197. ]
  198. }
  199. }
  200. }
  201. ```
  202. For more information, see the [Junie MCP configuration documentation](https://junie.jetbrains.com/docs/junie-cli-mcp-configuration.html).
  203. </details>
  204. <details>
  205. <summary>Kiro</summary>
  206. [![Add to Kiro](https://kiro.dev/images/add-to-kiro.svg)](https://kiro.dev/launch/mcp/add?name=playwright&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22%40playwright%2Fmcp%40latest%22%5D%7D)
  207. Follow the MCP Servers [documentation](https://kiro.dev/docs/mcp/). For example in `.kiro/settings/mcp.json`:
  208. ```json
  209. {
  210. "mcpServers": {
  211. "playwright": {
  212. "command": "npx",
  213. "args": [
  214. "@playwright/mcp@latest"
  215. ]
  216. }
  217. }
  218. }
  219. ```
  220. </details>
  221. <details>
  222. <summary>LM Studio</summary>
  223. #### Click the button to install:
  224. [![Add MCP Server playwright to LM Studio](https://files.lmstudio.ai/deeplink/mcp-install-light.svg)](https://lmstudio.ai/install-mcp?name=playwright&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAcGxheXdyaWdodC9tY3BAbGF0ZXN0Il19)
  225. #### Or install manually:
  226. Go to `Program` in the right sidebar -> `Install` -> `Edit mcp.json`. Use the standard config above.
  227. </details>
  228. <details>
  229. <summary>opencode</summary>
  230. Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
  231. ```json
  232. {
  233. "$schema": "https://opencode.ai/config.json",
  234. "mcp": {
  235. "playwright": {
  236. "type": "local",
  237. "command": [
  238. "npx",
  239. "@playwright/mcp@latest"
  240. ],
  241. "enabled": true
  242. }
  243. }
  244. }
  245. ```
  246. </details>
  247. <details>
  248. <summary>Qodo Gen</summary>
  249. Open [Qodo Gen](https://docs.qodo.ai/qodo-documentation/qodo-gen) chat panel in VSCode or IntelliJ → Connect more tools → + Add new MCP → Paste the standard config above.
  250. Click <code>Save</code>.
  251. </details>
  252. <details>
  253. <summary>VS Code</summary>
  254. #### Click the button to install:
  255. [<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)
  256. #### Or install manually:
  257. Follow the MCP install [guide](https://code.visualstudio.com/docs/copilot/chat/mcp-servers#_add-an-mcp-server), use the standard config above. You can also install the Playwright MCP server using the VS Code CLI:
  258. ```bash
  259. # For VS Code
  260. code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
  261. ```
  262. After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
  263. </details>
  264. <details>
  265. <summary>Warp</summary>
  266. Go to `Settings` -> `AI` -> `Manage MCP Servers` -> `+ Add` to [add an MCP Server](https://docs.warp.dev/knowledge-and-collaboration/mcp#adding-an-mcp-server). Use the standard config above.
  267. Alternatively, use the slash command `/add-mcp` in the Warp prompt and paste the standard config from above:
  268. ```js
  269. {
  270. "mcpServers": {
  271. "playwright": {
  272. "command": "npx",
  273. "args": [
  274. "@playwright/mcp@latest"
  275. ]
  276. }
  277. }
  278. }
  279. ```
  280. </details>
  281. <details>
  282. <summary>Windsurf</summary>
  283. Follow Windsurf MCP [documentation](https://docs.windsurf.com/windsurf/cascade/mcp). Use the standard config above.
  284. </details>
  285. ### Configuration
  286. Playwright MCP server supports following arguments. They can be provided in the JSON configuration above, as a part of the `"args"` list:
  287. <!--- Options generated by update-readme.js -->
  288. | Option | Description |
  289. |--------|-------------|
  290. | --allowed-hosts <hosts...> | comma-separated list of hosts this server is allowed to serve from. Defaults to localhost, loopback IPs and the host passed via --host; other hosts must be listed explicitly. Pass '*' to disable the host check.<br>*env* `PLAYWRIGHT_MCP_ALLOWED_HOSTS` |
  291. | --allowed-origins <origins> | semicolon-separated list of TRUSTED origins to allow the browser to request. Default is to allow all. Important: *does not* serve as a security boundary and *does not* affect redirects.<br>*env* `PLAYWRIGHT_MCP_ALLOWED_ORIGINS` |
  292. | --allow-unrestricted-file-access | allow access to files outside of the workspace roots. Also allows unrestricted access to file:// URLs. By default access to file system is restricted to workspace root directories (or cwd if no roots are configured) only, and navigation to file:// URLs is blocked.<br>*env* `PLAYWRIGHT_MCP_ALLOW_UNRESTRICTED_FILE_ACCESS` |
  293. | --blocked-origins <origins> | semicolon-separated list of origins to block the browser from requesting. Blocklist is evaluated before allowlist. If used without the allowlist, requests not matching the blocklist are still allowed. Important: *does not* serve as a security boundary and *does not* affect redirects.<br>*env* `PLAYWRIGHT_MCP_BLOCKED_ORIGINS` |
  294. | --block-service-workers | block service workers<br>*env* `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` |
  295. | --browser <browser> | browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.<br>*env* `PLAYWRIGHT_MCP_BROWSER` |
  296. | --caps <caps> | comma-separated list of additional capabilities to enable, possible values: vision, pdf, devtools.<br>*env* `PLAYWRIGHT_MCP_CAPS` |
  297. | --cdp-endpoint <endpoint> | CDP endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |
  298. | --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified.<br>*env* `PLAYWRIGHT_MCP_CDP_HEADERS` |
  299. | --cdp-timeout <timeout> | timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms<br>*env* `PLAYWRIGHT_MCP_CDP_TIMEOUT` |
  300. | --codegen <lang> | specify the language to use for code generation, possible values: "typescript", "python", "java", "csharp", "none". Default is "typescript".<br>*env* `PLAYWRIGHT_MCP_CODEGEN` |
  301. | --config <path> | path to the configuration file.<br>*env* `PLAYWRIGHT_MCP_CONFIG` |
  302. | --console-level <level> | level of console messages to return: "error", "warning", "info", "debug". Each level includes the messages of more severe levels.<br>*env* `PLAYWRIGHT_MCP_CONSOLE_LEVEL` |
  303. | --device <device> | device to emulate, for example: "iPhone 15"<br>*env* `PLAYWRIGHT_MCP_DEVICE` |
  304. | --mobile | emulate a generic mobile device (Pixel 10 for Chromium, iPhone 17 for WebKit). Mobile pages are usually lighter, which saves tokens. Cannot be combined with --device.<br>*env* `PLAYWRIGHT_MCP_MOBILE` |
  305. | --executable-path <path> | path to the browser executable.<br>*env* `PLAYWRIGHT_MCP_EXECUTABLE_PATH` |
  306. | --extension | Connect to a running browser instance (Edge/Chrome only). Requires the "Playwright Extension" to be installed.<br>*env* `PLAYWRIGHT_MCP_EXTENSION` |
  307. | --endpoint <endpoint> | Bound browser endpoint to connect to. |
  308. | --file-paths <mode> | how file paths are rendered in tool results, "relative" to the workspace root or "absolute". Default is "relative".<br>*env* `PLAYWRIGHT_MCP_FILE_PATHS` |
  309. | --grant-permissions <permissions...> | List of permissions to grant to the browser context, for example "geolocation", "clipboard-read", "clipboard-write".<br>*env* `PLAYWRIGHT_MCP_GRANT_PERMISSIONS` |
  310. | --headless | run browser in headless mode, headed by default<br>*env* `PLAYWRIGHT_MCP_HEADLESS` |
  311. | --host <host> | host to bind server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.<br>*env* `PLAYWRIGHT_MCP_HOST` |
  312. | --idle-timeout <timeout> | close the browser after this many milliseconds without a completed tool call, the next tool call relaunches it. Defaults to one hour for headless browsers, never for headed ones, 0 disables.<br>*env* `PLAYWRIGHT_MCP_IDLE_TIMEOUT` |
  313. | --ignore-https-errors | ignore https errors<br>*env* `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` |
  314. | --ignore-roots | do not ask the client for its workspace roots, use the current working directory as the workspace root instead. Use this with clients that advertise roots, but can not answer the roots request.<br>*env* `PLAYWRIGHT_MCP_IGNORE_ROOTS` |
  315. | --init-page <path...> | path to TypeScript file to evaluate on Playwright page object<br>*env* `PLAYWRIGHT_MCP_INIT_PAGE` |
  316. | --init-script <path...> | path to JavaScript file to add as an initialization script. The script will be evaluated in every page before any of the page's scripts. Can be specified multiple times.<br>*env* `PLAYWRIGHT_MCP_INIT_SCRIPT` |
  317. | --isolated | keep the browser profile in memory, do not save it to disk.<br>*env* `PLAYWRIGHT_MCP_ISOLATED` |
  318. | --image-responses <mode> | whether to send image responses to the client. Can be "allow", "omit" or "only". With "only", a response that carries an image consists of the image parts alone, without the text part. Defaults to "allow".<br>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |
  319. | --no-sandbox | disable the sandbox for all process types that are normally sandboxed.<br>*env* `PLAYWRIGHT_MCP_SANDBOX=false` |
  320. | --background | do not activate controlled tabs or focus the browser window when using --extension.<br>*env* `PLAYWRIGHT_MCP_BACKGROUND` |
  321. | --no-tab-group | do not group controlled tabs when using --extension.<br>*env* `PLAYWRIGHT_MCP_NO_TAB_GROUP` |
  322. | --no-webmcp | do not collect or expose the tools that a page registers through the WebMCP API.<br>*env* `PLAYWRIGHT_MCP_WEBMCP=false` |
  323. | --output-dir <path> | path to the directory for automatically named output files, for example a screenshot taken without an explicit file name. Files with an explicit name are resolved against the workspace root instead and are not affected by this option.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |
  324. | --output-max-size <bytes> | Threshold for evicting old output files, in bytes.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE` |
  325. | --port <port> | port to listen on for SSE transport.<br>*env* `PLAYWRIGHT_MCP_PORT` |
  326. | --profile-dir-name <name> | name of the profile directory in the user data dir to connect to with --extension, for example "Profile 1". Defaults to the last used profile that has the extension installed.<br>*env* `PLAYWRIGHT_MCP_PROFILE_DIR_NAME` |
  327. | --proxy-bypass <bypass> | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |
  328. | --proxy-server <proxy> | specify proxy server, for example "http://myproxy:3128", "http://user:password@myproxy:3128" or "socks5://myproxy:8080"<br>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |
  329. | --redact-url-params <names> | comma-separated list of URL query and fragment parameter names, for example "access_token,code", whose values are replaced with <redacted> in the tool responses.<br>*env* `PLAYWRIGHT_MCP_REDACT_URL_PARAMS` |
  330. | --sandbox | enable the sandbox for all process types that are normally not sandboxed.<br>*env* `PLAYWRIGHT_MCP_SANDBOX` |
  331. | --save-session | Whether to save the Playwright MCP session into the output directory. |
  332. | --secrets <path> | path to a file containing secrets in the dotenv format<br>*env* `PLAYWRIGHT_MCP_SECRETS_FILE` |
  333. | --shared-browser-context | reuse the same browser context between all connected HTTP clients. |
  334. | --snapshot-boxes | include each element's bounding box as [box=x,y,width,height] in snapshots. Coordinates are viewport-relative, in CSS pixels. |
  335. | --snapshot-mode <mode> | when taking snapshots for responses, specifies the mode to use. Can be "full" or "none". Default is "full". |
  336. | --storage-state <path> | path to the storage state file for isolated sessions.<br>*env* `PLAYWRIGHT_MCP_STORAGE_STATE` |
  337. | --test-id-attribute <attribute> | specify the attribute to use for test ids, defaults to "data-testid"<br>*env* `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` |
  338. | --timeout-action <timeout> | specify action timeout in milliseconds, defaults to 5000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_ACTION` |
  339. | --timeout-navigation <timeout> | specify navigation timeout in milliseconds, defaults to 60000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` |
  340. | --timeout-settle <timeout> | how long to wait after each action for triggered work to settle, in milliseconds, defaults to 500ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_SETTLE` |
  341. | --user-agent <ua string> | specify user agent string<br>*env* `PLAYWRIGHT_MCP_USER_AGENT` |
  342. | --user-data-dir <path> | path to the user data directory. If not specified, a temporary directory will be created.<br>*env* `PLAYWRIGHT_MCP_USER_DATA_DIR` |
  343. | --viewport-size <size> | specify browser viewport size in pixels, for example "1280x720"<br>*env* `PLAYWRIGHT_MCP_VIEWPORT_SIZE` |
  344. <!--- End of options generated section -->
  345. ### User profile
  346. You can run Playwright MCP with persistent profile like a regular browser (default), in isolated contexts for testing sessions, or connect to your existing browser using the browser extension.
  347. **Persistent profile**
  348. All the logged in information will be stored in the persistent profile, you can delete it between sessions if you'd like to clear the offline state.
  349. Persistent profile is located at the following locations and you can override it with the `--user-data-dir` argument.
  350. ```bash
  351. # Windows
  352. %USERPROFILE%\AppData\Local\ms-playwright\mcp-{channel}-{workspace-hash}
  353. # macOS
  354. - ~/Library/Caches/ms-playwright/mcp-{channel}-{workspace-hash}
  355. # Linux
  356. - ~/.cache/ms-playwright/mcp-{channel}-{workspace-hash}
  357. ```
  358. `{workspace-hash}` is derived from the MCP client's workspace root, so different projects get separate profiles automatically.
  359. > [!IMPORTANT]
  360. > A persistent profile can only be used by one browser instance at a time, so concurrent MCP clients sharing the same workspace will conflict. To run several clients in parallel, start each additional client with `--isolated` or point it at a distinct `--user-data-dir`.
  361. **Isolated**
  362. In the isolated mode, each session is started in the isolated profile. Every time you ask MCP to close the browser,
  363. the session is closed and all the storage state for this session is lost. You can provide initial storage state
  364. to the browser via the config's `contextOptions` or via the `--storage-state` argument. Learn more about the storage
  365. state [here](https://playwright.dev/docs/auth).
  366. ```js
  367. {
  368. "mcpServers": {
  369. "playwright": {
  370. "command": "npx",
  371. "args": [
  372. "@playwright/mcp@latest",
  373. "--isolated",
  374. "--storage-state={path/to/storage.json}"
  375. ]
  376. }
  377. }
  378. }
  379. ```
  380. **Browser Extension**
  381. The Playwright MCP Chrome Extension allows you to connect to existing browser tabs and leverage your logged-in sessions and browser state. See [microsoft/playwright › packages/extension](https://github.com/microsoft/playwright/tree/main/packages/extension#readme) for installation and setup instructions.
  382. ### Initial state
  383. There are multiple ways to provide the initial state to the browser context or a page.
  384. For the storage state, you can either:
  385. - Start with a user data directory using the `--user-data-dir` argument. This will persist all browser data between the sessions.
  386. - Start with a storage state file using the `--storage-state` argument. This will load cookies and local storage from the file into an isolated browser context.
  387. For the page state, you can use:
  388. - `--init-page` to point to a TypeScript file that will be evaluated on the Playwright page object. This allows you to run arbitrary code to set up the page.
  389. ```ts
  390. // init-page.ts
  391. export default async ({ page }) => {
  392. await page.context().grantPermissions(['geolocation']);
  393. await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
  394. await page.setViewportSize({ width: 1280, height: 720 });
  395. };
  396. ```
  397. - `--init-script` to point to a JavaScript file that will be added as an initialization script. The script will be evaluated in every page before any of the page's scripts.
  398. This is useful for overriding browser APIs or setting up the environment.
  399. ```js
  400. // init-script.js
  401. window.isPlaywrightMCP = true;
  402. ```
  403. ### Configuration file
  404. The Playwright MCP server can be configured using a JSON configuration file. You can specify the configuration file
  405. using the `--config` command line option:
  406. ```bash
  407. npx @playwright/mcp@latest --config path/to/config.json
  408. ```
  409. <details>
  410. <summary>Configuration file schema</summary>
  411. <!--- Config generated by update-readme.js -->
  412. ```typescript
  413. {
  414. /**
  415. * The browser to use.
  416. */
  417. browser?: {
  418. /**
  419. * The type of browser to use.
  420. */
  421. browserName?: 'chromium' | 'firefox' | 'webkit';
  422. /**
  423. * Keep the browser profile in memory, do not save it to disk.
  424. */
  425. isolated?: boolean;
  426. /**
  427. * Path to a user data directory for browser profile persistence.
  428. * Temporary directory is created by default.
  429. * Relative paths are resolved against the config file's directory.
  430. */
  431. userDataDir?: string;
  432. /**
  433. * Launch options passed to
  434. * @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context
  435. *
  436. * This is useful for settings options like `channel`, `headless`, `executablePath`, etc.
  437. * Relative paths are resolved against the config file's directory.
  438. */
  439. launchOptions?: playwright.LaunchOptions;
  440. /**
  441. * Context options for the browser context.
  442. *
  443. * This is useful for settings options like `viewport`.
  444. * Relative paths are resolved against the config file's directory.
  445. */
  446. contextOptions?: playwright.BrowserContextOptions;
  447. /**
  448. * Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.
  449. */
  450. cdpEndpoint?: string;
  451. /**
  452. * CDP headers to send with the connect request.
  453. */
  454. cdpHeaders?: Record<string, string>;
  455. /**
  456. * Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
  457. */
  458. cdpTimeout?: number;
  459. /**
  460. * Remote endpoint to connect to an existing Playwright server. May be a
  461. * WebSocket URL string, or a [ConnectOptions] object that mirrors the
  462. * `connectOptions` shape used by the test runner. When passed as an object,
  463. * `exposeNetwork`, `headers`, `slowMo`, and `timeout` are forwarded to the
  464. * underlying connect call.
  465. */
  466. remoteEndpoint?: string | playwright.ConnectOptions & { endpoint: string };
  467. /**
  468. * Paths to TypeScript files to add as initialization scripts for Playwright page.
  469. * Relative paths are resolved against the config file's directory.
  470. */
  471. initPage?: string[];
  472. /**
  473. * Paths to JavaScript files to add as initialization scripts.
  474. * The scripts will be evaluated in every page before any of the page's scripts.
  475. * Relative paths are resolved against the config file's directory.
  476. */
  477. initScript?: string[];
  478. },
  479. /**
  480. * Connect to a running browser instance (Edge/Chrome only). If specified, `browser`
  481. * config is ignored.
  482. * Requires the "Playwright Extension" to be installed.
  483. */
  484. extension?: boolean;
  485. /**
  486. * Group controlled tabs when using the extension. Defaults to true.
  487. */
  488. tabGroup?: boolean;
  489. /**
  490. * Do not activate controlled tabs or focus the browser window when using the extension.
  491. * Defaults to false.
  492. */
  493. background?: boolean;
  494. server?: {
  495. /**
  496. * The port to listen on for SSE or MCP transport.
  497. */
  498. port?: number;
  499. /**
  500. * The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
  501. */
  502. host?: string;
  503. /**
  504. * The hosts this server is allowed to serve from. Defaults to localhost, loopback IPs and the host passed via --host; other hosts must be listed explicitly.
  505. * This is not for CORS, but rather for the DNS rebinding protection.
  506. */
  507. allowedHosts?: string[];
  508. },
  509. /**
  510. * List of enabled tool capabilities. Possible values:
  511. * - 'core': Core browser automation features.
  512. * - 'pdf': PDF generation and manipulation.
  513. * - 'vision': Coordinate-based interactions.
  514. * - 'devtools': Developer tools features.
  515. */
  516. capabilities?: ToolCapability[];
  517. /**
  518. * Whether to save the Playwright session into the output directory.
  519. */
  520. saveSession?: boolean;
  521. /**
  522. * Whether to collect and expose the tools that a page registers through the
  523. * experimental WebMCP API. Enabled by default.
  524. */
  525. webmcp?: boolean;
  526. /**
  527. * Reuse the same browser context between all connected HTTP clients.
  528. */
  529. sharedBrowserContext?: boolean;
  530. /**
  531. * Secrets are used to replace matching plain text in the tool responses to prevent the LLM
  532. * from accidentally getting sensitive data. It is a convenience and not a security feature,
  533. * make sure to always examine information coming in and from the tool on the client.
  534. */
  535. secrets?: Record<string, string>;
  536. /**
  537. * Names of URL query and fragment parameters, for example `access_token` or `code`, whose values
  538. * are replaced with `<redacted>` in the tool responses. Use it for session and grant values that
  539. * are minted at runtime and cannot be listed in `secrets`. Like `secrets`, it is a convenience
  540. * and not a security feature.
  541. */
  542. redactUrlParams?: string[];
  543. /**
  544. * The directory for automatically named output files, for example a screenshot taken without an
  545. * explicit file name. Files with an explicit name are resolved against the workspace root instead
  546. * and are not affected by this option.
  547. * Relative paths are resolved against the config file's directory.
  548. */
  549. outputDir?: string;
  550. /**
  551. * Threshold for evicting old output files, in bytes.
  552. */
  553. outputMaxSize?: number;
  554. console?: {
  555. /**
  556. * The level of console messages to return. Each level includes the messages of more severe levels. Defaults to "info".
  557. */
  558. level?: 'error' | 'warning' | 'info' | 'debug';
  559. },
  560. network?: {
  561. /**
  562. * List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
  563. *
  564. * Supported formats:
  565. * - Full origin: `https://example.com:8080` - matches only that origin
  566. * - Wildcard port: `http://localhost:*` - matches any port on localhost with http protocol
  567. */
  568. allowedOrigins?: string[];
  569. /**
  570. * List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
  571. *
  572. * Supported formats:
  573. * - Full origin: `https://example.com:8080` - matches only that origin
  574. * - Wildcard port: `http://localhost:*` - matches any port on localhost with http protocol
  575. */
  576. blockedOrigins?: string[];
  577. };
  578. /**
  579. * Specify the attribute to use for test ids, defaults to "data-testid".
  580. */
  581. testIdAttribute?: string;
  582. timeouts?: {
  583. /*
  584. * Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.
  585. */
  586. action?: number;
  587. /*
  588. * Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.
  589. */
  590. navigation?: number;
  591. /**
  592. * Configures default expect timeout: https://playwright.dev/docs/test-timeouts#expect-timeout. Defaults to 5000ms.
  593. */
  594. expect?: number;
  595. /**
  596. * How long to wait after each action for triggered work (navigations, requests) to settle before responding. Defaults to 500ms.
  597. */
  598. settle?: number;
  599. /**
  600. * Close the browser after this many milliseconds without a tool call, and relaunch it on the next one.
  601. * Defaults to one hour for headless browsers Playwright launched, and to no timeout for headed or attached ones. Pass 0 to disable.
  602. * The CLI shuts the whole session down instead of relaunching.
  603. */
  604. idle?: number;
  605. };
  606. /**
  607. * Whether to send image responses to the client. Can be "allow", "omit", or "only". Defaults to "allow".
  608. * With "only", a response that carries an image consists of the image parts alone, without the text part.
  609. */
  610. imageResponses?: 'allow' | 'omit' | 'only';
  611. /**
  612. * How file paths are rendered in tool results. Can be "relative" to the workspace root or "absolute". Defaults to "relative".
  613. */
  614. filePaths?: 'relative' | 'absolute';
  615. snapshot?: {
  616. /**
  617. * When taking snapshots for responses, specifies the mode to use.
  618. */
  619. mode?: 'full' | 'none';
  620. /**
  621. * Whether to include each element's bounding box as [box=x,y,width,height] in snapshots.
  622. * Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect).
  623. */
  624. boxes?: boolean;
  625. };
  626. /**
  627. * allowUnrestrictedFileAccess acts as a guardrail to prevent the LLM from accidentally
  628. * wandering outside its intended workspace. It is a convenience defense to catch unintended
  629. * file access, not a secure boundary; a deliberate attempt to reach other directories can be
  630. * easily worked around, so always rely on client-level permissions for true security.
  631. */
  632. allowUnrestrictedFileAccess?: boolean;
  633. /**
  634. * Do not ask the client for its workspace roots, use the current working directory
  635. * as the workspace root instead. Use this with clients that advertise roots, but
  636. * can not answer the roots request.
  637. */
  638. ignoreRoots?: boolean;
  639. /**
  640. * Specify the language to use for code generation.
  641. */
  642. codegen?: 'typescript' | 'python' | 'java' | 'csharp' | 'none';
  643. }
  644. ```
  645. <!--- End of config generated section -->
  646. </details>
  647. ### Standalone MCP server
  648. When running headed browser on system w/o display or from worker processes of the IDEs,
  649. run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable HTTP transport.
  650. ```bash
  651. npx @playwright/mcp@latest --port 8931
  652. ```
  653. And then in MCP client config, set the `url` to the HTTP endpoint:
  654. ```js
  655. {
  656. "mcpServers": {
  657. "playwright": {
  658. "url": "http://localhost:8931/mcp"
  659. }
  660. }
  661. }
  662. ```
  663. ## Security
  664. Playwright MCP is **not** a security boundary. See [MCP Security Best Practices](https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices) for guidance on securing your deployment.
  665. <details>
  666. <summary><b>Docker</b></summary>
  667. **NOTE:** The Docker implementation only supports headless chromium at the moment.
  668. ```js
  669. {
  670. "mcpServers": {
  671. "playwright": {
  672. "command": "docker",
  673. "args": ["run", "-i", "--rm", "--init", "--pull=always", "mcr.microsoft.com/playwright/mcp"]
  674. }
  675. }
  676. }
  677. ```
  678. Or If you prefer to run the container as a long-lived service instead of letting the MCP client spawn it, use:
  679. ```
  680. docker run -d -i --rm --init --pull=always \
  681. --entrypoint node \
  682. --name playwright \
  683. -p 8931:8931 \
  684. mcr.microsoft.com/playwright/mcp \
  685. /app/cli.js --headless --browser chromium --no-sandbox --port 8931 --host 0.0.0.0
  686. ```
  687. The server will listen on host port **8931** and can be reached by any MCP client.
  688. You can build the Docker image yourself.
  689. ```
  690. docker build -t mcr.microsoft.com/playwright/mcp .
  691. ```
  692. </details>
  693. <details>
  694. <summary><b>Programmatic usage</b></summary>
  695. ```js
  696. import http from 'http';
  697. import { createConnection } from '@playwright/mcp';
  698. import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
  699. http.createServer(async (req, res) => {
  700. // ...
  701. // Creates a headless Playwright MCP server with SSE transport
  702. const connection = await createConnection({ browser: { launchOptions: { headless: true } } });
  703. const transport = new SSEServerTransport('/messages', res);
  704. await connection.connect(transport);
  705. // ...
  706. });
  707. ```
  708. </details>
  709. ### Tools
  710. <!--- Tools generated by update-readme.js -->
  711. <details>
  712. <summary><b>Core automation</b></summary>
  713. <!-- NOTE: This has been generated via update-readme.js -->
  714. - **browser_click**
  715. - Title: Click
  716. - Description: Perform click on a web page
  717. - Parameters:
  718. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  719. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  720. - `doubleClick` (boolean, optional): Whether to perform a double click instead of a single click
  721. - `button` (string, optional): Button to click, defaults to left
  722. - `modifiers` (array, optional): Modifier keys to press
  723. - Read-only: **false**
  724. <!-- NOTE: This has been generated via update-readme.js -->
  725. - **browser_close**
  726. - Title: Close browser
  727. - Description: Close the page
  728. - Parameters: None
  729. - Read-only: **false**
  730. <!-- NOTE: This has been generated via update-readme.js -->
  731. - **browser_console_messages**
  732. - Title: Get console messages
  733. - Description: Returns all console messages
  734. - Parameters:
  735. - `level` (string): Level of the console messages to return. Each level includes the messages of more severe levels. Defaults to "info".
  736. - `all` (boolean, optional): Return all console messages since the beginning of the session, not just since the last navigation. Defaults to false.
  737. - `filename` (string, optional): File name to save the console messages to. Relative file names are resolved against the workspace root. If not provided, messages are returned as text.
  738. - Read-only: **true**
  739. <!-- NOTE: This has been generated via update-readme.js -->
  740. - **browser_drag**
  741. - Title: Drag mouse
  742. - Description: Perform drag and drop between two elements
  743. - Parameters:
  744. - `startElement` (string, optional): Human-readable source element description used to obtain the permission to interact with the element
  745. - `startTarget` (string): Exact target element reference from the page snapshot, or a unique element selector
  746. - `endElement` (string, optional): Human-readable target element description used to obtain the permission to interact with the element
  747. - `endTarget` (string): Exact target element reference from the page snapshot, or a unique element selector
  748. - Read-only: **false**
  749. <!-- NOTE: This has been generated via update-readme.js -->
  750. - **browser_drop**
  751. - Title: Drop files or data onto an element
  752. - Description: Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.
  753. - Parameters:
  754. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  755. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  756. - `paths` (array, optional): Absolute paths to files to drop onto the element.
  757. - `data` (object, optional): Data to drop, as a map of MIME type to string value (e.g. {"text/plain": "hello", "text/uri-list": "https://example.com"}).
  758. - Read-only: **false**
  759. <!-- NOTE: This has been generated via update-readme.js -->
  760. - **browser_emulate_media**
  761. - Title: Emulate media features
  762. - Description: Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.
  763. - Parameters:
  764. - `colorScheme` (optional): Emulates the prefers-color-scheme media feature
  765. - `reducedMotion` (optional): Emulates the prefers-reduced-motion media feature
  766. - `forcedColors` (optional): Emulates the forced-colors media feature
  767. - `contrast` (optional): Emulates the prefers-contrast media feature
  768. - `media` (optional): Changes the CSS media type of the page
  769. - Read-only: **false**
  770. <!-- NOTE: This has been generated via update-readme.js -->
  771. - **browser_evaluate**
  772. - Title: Evaluate JavaScript
  773. - Description: Evaluate JavaScript expression on page or element
  774. - Parameters:
  775. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  776. - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
  777. - `function` (string): () => { /* code */ } or (element) => { /* code */ } when element is provided
  778. - `filename` (string, optional): File name to save the result to. Relative file names are resolved against the workspace root. If not provided, result is returned as text.
  779. - Read-only: **false**
  780. <!-- NOTE: This has been generated via update-readme.js -->
  781. - **browser_file_upload**
  782. - Title: Upload files
  783. - Description: Upload one or multiple files
  784. - Parameters:
  785. - `paths` (array, optional): The absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled.
  786. - Read-only: **false**
  787. <!-- NOTE: This has been generated via update-readme.js -->
  788. - **browser_fill_form**
  789. - Title: Fill form
  790. - Description: Fill multiple form fields
  791. - Parameters:
  792. - `fields` (array): Fields to fill in
  793. - Read-only: **false**
  794. <!-- NOTE: This has been generated via update-readme.js -->
  795. - **browser_find**
  796. - Title: Find in page snapshot
  797. - Description: Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you only need to locate an element and its ref.
  798. - Parameters:
  799. - `text` (string, optional): Plain text to search for in the page snapshot (case-insensitive substring match). Provide either text or regex, not both.
  800. - `regex` (string, optional): Regular expression to search for in the page snapshot. Matching is case-sensitive by default; wrap the pattern in slashes to add flags, e.g. "/error/i" for case-insensitive. Provide either text or regex, not both.
  801. - `maxResults` (number, optional): Maximum number of matching items to return. Defaults to returning all matches.
  802. - `filename` (string, optional): Save results to a file instead of returning them in the response. Relative file names are resolved against the workspace root.
  803. - Read-only: **true**
  804. <!-- NOTE: This has been generated via update-readme.js -->
  805. - **browser_handle_dialog**
  806. - Title: Handle a dialog
  807. - Description: Handle a dialog
  808. - Parameters:
  809. - `accept` (boolean): Whether to accept the dialog.
  810. - `promptText` (string, optional): The text of the prompt in case of a prompt dialog.
  811. - Read-only: **false**
  812. <!-- NOTE: This has been generated via update-readme.js -->
  813. - **browser_hover**
  814. - Title: Hover mouse
  815. - Description: Hover over element on page
  816. - Parameters:
  817. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  818. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  819. - Read-only: **false**
  820. <!-- NOTE: This has been generated via update-readme.js -->
  821. - **browser_navigate**
  822. - Title: Navigate to a URL
  823. - Description: Navigate to a URL
  824. - Parameters:
  825. - `url` (string): The URL to navigate to
  826. - Read-only: **false**
  827. <!-- NOTE: This has been generated via update-readme.js -->
  828. - **browser_navigate_back**
  829. - Title: Go back
  830. - Description: Go back to the previous page in the history
  831. - Parameters: None
  832. - Read-only: **false**
  833. <!-- NOTE: This has been generated via update-readme.js -->
  834. - **browser_network_request**
  835. - Title: Show network request details
  836. - Description: Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.
  837. - Parameters:
  838. - `index` (integer): 1-based index of the request, as printed by browser_network_requests.
  839. - `part` (string, optional): Return only this part of the request. Omit to return full details.
  840. - `filename` (string, optional): File name to save the result to. Relative file names are resolved against the workspace root. If not provided, output is returned as text.
  841. - Read-only: **true**
  842. <!-- NOTE: This has been generated via update-readme.js -->
  843. - **browser_network_requests**
  844. - Title: List network requests
  845. - Description: Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.
  846. - Parameters:
  847. - `static` (boolean): Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false.
  848. - `filter` (string, optional): Only return requests whose URL matches this regexp (e.g. "/api/.*user").
  849. - `all` (boolean, optional): Return all network requests since the beginning of the session, not just since the last navigation. Defaults to false.
  850. - `filename` (string, optional): File name to save the network requests to. Relative file names are resolved against the workspace root. If not provided, requests are returned as text.
  851. - Read-only: **true**
  852. <!-- NOTE: This has been generated via update-readme.js -->
  853. - **browser_press_key**
  854. - Title: Press a key
  855. - Description: Press a key on the keyboard
  856. - Parameters:
  857. - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
  858. - Read-only: **false**
  859. <!-- NOTE: This has been generated via update-readme.js -->
  860. - **browser_resize**
  861. - Title: Resize browser window
  862. - Description: Resize the browser window
  863. - Parameters:
  864. - `width` (number): Width of the browser window
  865. - `height` (number): Height of the browser window
  866. - Read-only: **false**
  867. <!-- NOTE: This has been generated via update-readme.js -->
  868. - **browser_run_code_unsafe**
  869. - Title: Run Playwright code (unsafe)
  870. - Description: Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.
  871. - Parameters:
  872. - `code` (string, optional): A JavaScript function containing Playwright code to execute. It will be invoked with a single argument, page, which you can use for any page interaction. For example: `async (page) => { await page.getByRole('button', { name: 'Submit' }).click(); return await page.title(); }`
  873. - `filename` (string, optional): Load code from the specified file. Relative file names are resolved against the workspace root. If both code and filename are provided, code will be ignored.
  874. - Read-only: **false**
  875. <!-- NOTE: This has been generated via update-readme.js -->
  876. - **browser_select_option**
  877. - Title: Select option
  878. - Description: Select an option in a dropdown
  879. - Parameters:
  880. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  881. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  882. - `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.
  883. - Read-only: **false**
  884. <!-- NOTE: This has been generated via update-readme.js -->
  885. - **browser_snapshot**
  886. - Title: Page snapshot
  887. - Description: Capture accessibility snapshot of the current page, this is better than screenshot
  888. - Parameters:
  889. - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
  890. - `filename` (string, optional): Save snapshot to a file instead of returning it in the response. Relative file names are resolved against the workspace root.
  891. - `depth` (number, optional): Limit the depth of the snapshot tree
  892. - `boxes` (boolean, optional): Include each element's bounding box as [box=x,y,width,height] in the snapshot. Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect)
  893. - Read-only: **true**
  894. <!-- NOTE: This has been generated via update-readme.js -->
  895. - **browser_take_screenshot**
  896. - Title: Take a screenshot
  897. - Description: Take a screenshot of the current page. Use browser_snapshot for actions by default. With the vision capability enabled, use screenshot coordinates with the coordinate-based mouse tools for elements not exposed in the accessibility snapshot.
  898. - Parameters:
  899. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  900. - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
  901. - `type` (string, optional): Image format for the screenshot. If unset, inferred from the filename extension, otherwise png.
  902. - `filename` (string, optional): File name to save the screenshot to. Relative file names are resolved against the workspace root. If not specified, the screenshot is saved into the output directory as `page-{timestamp}.{png|jpeg|webp}`.
  903. - `fullPage` (boolean, optional): When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.
  904. - `scale` (string): Image resolution scale. "css" produces a screenshot sized in CSS pixels (smaller, consistent across devices). "device" produces a high-resolution screenshot using device pixels (larger, accounts for the device pixel ratio). Default is css.
  905. - Read-only: **true**
  906. <!-- NOTE: This has been generated via update-readme.js -->
  907. - **browser_type**
  908. - Title: Type text
  909. - Description: Type text into editable element
  910. - Parameters:
  911. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  912. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  913. - `text` (string): Text to type into the element
  914. - `submit` (boolean, optional): Whether to submit entered text (press Enter after)
  915. - `slowly` (boolean, optional): Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.
  916. - Read-only: **false**
  917. <!-- NOTE: This has been generated via update-readme.js -->
  918. - **browser_wait_for**
  919. - Title: Wait for
  920. - Description: Wait for text to appear or disappear or a specified time to pass. When both text and textGone are provided, waits for the first one to happen
  921. - Parameters:
  922. - `time` (number, optional): The time to wait in seconds, at most 30. When combined with text or textGone, serves as a timeout for them instead of the default action timeout
  923. - `text` (string, optional): The text to wait for
  924. - `textGone` (string, optional): The text to wait for to disappear
  925. - Read-only: **false**
  926. </details>
  927. <details>
  928. <summary><b>Tab management</b></summary>
  929. <!-- NOTE: This has been generated via update-readme.js -->
  930. - **browser_tabs**
  931. - Title: Manage tabs
  932. - Description: List, create, close, or select a browser tab.
  933. - Parameters:
  934. - `action` (string): Operation to perform
  935. - `index` (number, optional): Tab index, used for close/select. If omitted for close, current tab is closed.
  936. - `url` (string, optional): URL to navigate to in the new tab, used for new.
  937. - `isolatedContext` (string, optional): Name of an isolated browser context to create the new tab in, used for new. Tabs in the same isolated context share cookies and storage, tabs in different contexts are fully isolated. If omitted or "default", the tab is created in the default context.
  938. - Read-only: **false**
  939. </details>
  940. <details>
  941. <summary><b>Browser installation</b></summary>
  942. </details>
  943. <details>
  944. <summary><b>Configuration (opt-in via --caps=config)</b></summary>
  945. <!-- NOTE: This has been generated via update-readme.js -->
  946. - **browser_get_config**
  947. - Title: Get config
  948. - Description: Get the final resolved config after merging CLI options, environment variables and config file.
  949. - Parameters: None
  950. - Read-only: **true**
  951. </details>
  952. <details>
  953. <summary><b>Network (opt-in via --caps=network)</b></summary>
  954. <!-- NOTE: This has been generated via update-readme.js -->
  955. - **browser_network_state_set**
  956. - Title: Set network state
  957. - Description: Sets the browser network state to online or offline. When offline, all network requests will fail.
  958. - Parameters:
  959. - `state` (string): Set to "offline" to simulate offline mode, "online" to restore network connectivity
  960. - Read-only: **false**
  961. <!-- NOTE: This has been generated via update-readme.js -->
  962. - **browser_route**
  963. - Title: Mock network requests
  964. - Description: Set up a route to mock network requests matching a URL pattern
  965. - Parameters:
  966. - `pattern` (string): URL pattern to match (e.g., "**/api/users", "**/*.{png,jpg}")
  967. - `status` (number, optional): HTTP status code to return (default: 200)
  968. - `body` (string, optional): Response body (text or JSON string)
  969. - `contentType` (string, optional): Content-Type header (e.g., "application/json", "text/html")
  970. - `headers` (array, optional): Headers to add in "Name: Value" format
  971. - `removeHeaders` (string, optional): Comma-separated list of header names to remove from request
  972. - Read-only: **false**
  973. <!-- NOTE: This has been generated via update-readme.js -->
  974. - **browser_route_list**
  975. - Title: List network routes
  976. - Description: List all active network routes
  977. - Parameters: None
  978. - Read-only: **true**
  979. <!-- NOTE: This has been generated via update-readme.js -->
  980. - **browser_unroute**
  981. - Title: Remove network routes
  982. - Description: Remove network routes matching a pattern (or all routes if no pattern specified)
  983. - Parameters:
  984. - `pattern` (string, optional): URL pattern to unroute (omit to remove all routes)
  985. - Read-only: **false**
  986. </details>
  987. <details>
  988. <summary><b>Storage (opt-in via --caps=storage)</b></summary>
  989. <!-- NOTE: This has been generated via update-readme.js -->
  990. - **browser_cookie_clear**
  991. - Title: Clear cookies
  992. - Description: Clear all cookies
  993. - Parameters: None
  994. - Read-only: **false**
  995. <!-- NOTE: This has been generated via update-readme.js -->
  996. - **browser_cookie_delete**
  997. - Title: Delete cookie
  998. - Description: Delete a specific cookie (optionally only on a given domain/path)
  999. - Parameters:
  1000. - `name` (string): Cookie name to delete
  1001. - `domain` (string, optional): Only delete the cookie on this domain
  1002. - `path` (string, optional): Only delete the cookie on this path
  1003. - Read-only: **false**
  1004. <!-- NOTE: This has been generated via update-readme.js -->
  1005. - **browser_cookie_get**
  1006. - Title: Get cookie
  1007. - Description: Get a specific cookie by name
  1008. - Parameters:
  1009. - `name` (string): Cookie name to get
  1010. - Read-only: **true**
  1011. <!-- NOTE: This has been generated via update-readme.js -->
  1012. - **browser_cookie_list**
  1013. - Title: List cookies
  1014. - Description: List all cookies (optionally filtered by domain/path)
  1015. - Parameters:
  1016. - `domain` (string, optional): Filter cookies by domain
  1017. - `path` (string, optional): Filter cookies by path
  1018. - Read-only: **true**
  1019. <!-- NOTE: This has been generated via update-readme.js -->
  1020. - **browser_cookie_set**
  1021. - Title: Set cookie
  1022. - Description: Set a cookie with optional flags (domain, path, expires, httpOnly, secure, sameSite)
  1023. - Parameters:
  1024. - `name` (string): Cookie name
  1025. - `value` (string): Cookie value
  1026. - `domain` (string, optional): Cookie domain
  1027. - `path` (string, optional): Cookie path
  1028. - `expires` (number, optional): Cookie expiration as Unix timestamp
  1029. - `httpOnly` (boolean, optional): Whether the cookie is HTTP only
  1030. - `secure` (boolean, optional): Whether the cookie is secure
  1031. - `sameSite` (string, optional): Cookie SameSite attribute
  1032. - Read-only: **false**
  1033. <!-- NOTE: This has been generated via update-readme.js -->
  1034. - **browser_localstorage_clear**
  1035. - Title: Clear localStorage
  1036. - Description: Clear all localStorage
  1037. - Parameters: None
  1038. - Read-only: **false**
  1039. <!-- NOTE: This has been generated via update-readme.js -->
  1040. - **browser_localstorage_delete**
  1041. - Title: Delete localStorage item
  1042. - Description: Delete a localStorage item
  1043. - Parameters:
  1044. - `key` (string): Key to delete
  1045. - Read-only: **false**
  1046. <!-- NOTE: This has been generated via update-readme.js -->
  1047. - **browser_localstorage_get**
  1048. - Title: Get localStorage item
  1049. - Description: Get a localStorage item by key
  1050. - Parameters:
  1051. - `key` (string): Key to get
  1052. - Read-only: **true**
  1053. <!-- NOTE: This has been generated via update-readme.js -->
  1054. - **browser_localstorage_list**
  1055. - Title: List localStorage
  1056. - Description: List all localStorage key-value pairs
  1057. - Parameters: None
  1058. - Read-only: **true**
  1059. <!-- NOTE: This has been generated via update-readme.js -->
  1060. - **browser_localstorage_set**
  1061. - Title: Set localStorage item
  1062. - Description: Set a localStorage item
  1063. - Parameters:
  1064. - `key` (string): Key to set
  1065. - `value` (string): Value to set
  1066. - Read-only: **false**
  1067. <!-- NOTE: This has been generated via update-readme.js -->
  1068. - **browser_sessionstorage_clear**
  1069. - Title: Clear sessionStorage
  1070. - Description: Clear all sessionStorage
  1071. - Parameters: None
  1072. - Read-only: **false**
  1073. <!-- NOTE: This has been generated via update-readme.js -->
  1074. - **browser_sessionstorage_delete**
  1075. - Title: Delete sessionStorage item
  1076. - Description: Delete a sessionStorage item
  1077. - Parameters:
  1078. - `key` (string): Key to delete
  1079. - Read-only: **false**
  1080. <!-- NOTE: This has been generated via update-readme.js -->
  1081. - **browser_sessionstorage_get**
  1082. - Title: Get sessionStorage item
  1083. - Description: Get a sessionStorage item by key
  1084. - Parameters:
  1085. - `key` (string): Key to get
  1086. - Read-only: **true**
  1087. <!-- NOTE: This has been generated via update-readme.js -->
  1088. - **browser_sessionstorage_list**
  1089. - Title: List sessionStorage
  1090. - Description: List all sessionStorage key-value pairs
  1091. - Parameters: None
  1092. - Read-only: **true**
  1093. <!-- NOTE: This has been generated via update-readme.js -->
  1094. - **browser_sessionstorage_set**
  1095. - Title: Set sessionStorage item
  1096. - Description: Set a sessionStorage item
  1097. - Parameters:
  1098. - `key` (string): Key to set
  1099. - `value` (string): Value to set
  1100. - Read-only: **false**
  1101. <!-- NOTE: This has been generated via update-readme.js -->
  1102. - **browser_set_storage_state**
  1103. - Title: Restore storage state
  1104. - Description: Restore storage state (cookies, local storage) from a file. This clears existing cookies and local storage before restoring.
  1105. - Parameters:
  1106. - `filename` (string): Path to the storage state file to restore from. Relative file names are resolved against the workspace root.
  1107. - Read-only: **false**
  1108. <!-- NOTE: This has been generated via update-readme.js -->
  1109. - **browser_storage_state**
  1110. - Title: Save storage state
  1111. - Description: Save storage state (cookies, local storage) to a file for later reuse
  1112. - Parameters:
  1113. - `filename` (string, optional): File name to save the storage state to. Relative file names are resolved against the workspace root. If not specified, the storage state is saved into the output directory as `storage-state-{timestamp}.json`.
  1114. - Read-only: **true**
  1115. </details>
  1116. <details>
  1117. <summary><b>DevTools (opt-in via --caps=devtools)</b></summary>
  1118. <!-- NOTE: This has been generated via update-readme.js -->
  1119. - **browser_annotate**
  1120. - Title: Annotate the current page
  1121. - Description: Open the Playwright Dashboard in annotation mode for the current page and wait for the user to draw annotations. Returns the annotated screenshot, ARIA snapshot, and the list of annotations.
  1122. - Parameters: None
  1123. - Read-only: **true**
  1124. <!-- NOTE: This has been generated via update-readme.js -->
  1125. - **browser_hide_highlight**
  1126. - Title: Hide element highlight
  1127. - Description: Remove a highlight overlay previously added for the element.
  1128. - Parameters:
  1129. - `element` (string, optional): Human-readable element description used when adding the highlight; must match the value passed to browser_highlight.
  1130. - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
  1131. - Read-only: **true**
  1132. <!-- NOTE: This has been generated via update-readme.js -->
  1133. - **browser_highlight**
  1134. - Title: Highlight element
  1135. - Description: Show a persistent highlight overlay around the element on the page.
  1136. - Parameters:
  1137. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  1138. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  1139. - `style` (string, optional): Additional inline CSS applied to the highlight overlay, e.g. "outline: 2px dashed red".
  1140. - Read-only: **true**
  1141. <!-- NOTE: This has been generated via update-readme.js -->
  1142. - **browser_resume**
  1143. - Title: Resume paused script execution
  1144. - Description: Resume script execution after it was paused. When called with step set to true, execution will pause again before the next action.
  1145. - Parameters:
  1146. - `step` (boolean, optional): When true, execution will pause again before the next action, allowing step-by-step debugging.
  1147. - `location` (string, optional): Pause execution at a specific <file>:<line>, e.g. "example.spec.ts:42".
  1148. - Read-only: **false**
  1149. <!-- NOTE: This has been generated via update-readme.js -->
  1150. - **browser_start_recording**
  1151. - Title: Start recording user actions
  1152. - Description: Start recording actions that the user performs in the browser as Playwright code. Use it when the user wants to demonstrate a flow manually. Call browser_stop_recording when the user says they are done to retrieve the recorded actions.
  1153. - Parameters: None
  1154. - Read-only: **true**
  1155. <!-- NOTE: This has been generated via update-readme.js -->
  1156. - **browser_start_tracing**
  1157. - Title: Start tracing
  1158. - Description: Start trace recording
  1159. - Parameters: None
  1160. - Read-only: **true**
  1161. <!-- NOTE: This has been generated via update-readme.js -->
  1162. - **browser_start_video**
  1163. - Title: Start video
  1164. - Description: Start video recording
  1165. - Parameters:
  1166. - `filename` (string, optional): File name to save the video to. Relative file names are resolved against the workspace root. If not specified, the video is saved into the output directory as `video-{timestamp}.webm`.
  1167. - `size` (object, optional): Video size
  1168. - `fps` (number, optional): Video frame rate in frames per second, defaults to 25
  1169. - `cursor` (boolean, optional): Render an animated mouse cursor that travels to each action point. Paces actions by 800ms so that the cursor has time to travel.
  1170. - Read-only: **true**
  1171. <!-- NOTE: This has been generated via update-readme.js -->
  1172. - **browser_stop_recording**
  1173. - Title: Stop recording user actions
  1174. - Description: Stop the recording started with browser_start_recording and return the recorded actions as Playwright code.
  1175. - Parameters: None
  1176. - Read-only: **true**
  1177. <!-- NOTE: This has been generated via update-readme.js -->
  1178. - **browser_stop_tracing**
  1179. - Title: Stop tracing
  1180. - Description: Stop trace recording
  1181. - Parameters: None
  1182. - Read-only: **true**
  1183. <!-- NOTE: This has been generated via update-readme.js -->
  1184. - **browser_stop_video**
  1185. - Title: Stop video
  1186. - Description: Stop video recording
  1187. - Parameters: None
  1188. - Read-only: **true**
  1189. <!-- NOTE: This has been generated via update-readme.js -->
  1190. - **browser_video_chapter**
  1191. - Title: Video chapter
  1192. - Description: Add a chapter marker to the video recording. Shows a full-screen chapter card with blurred backdrop.
  1193. - Parameters:
  1194. - `title` (string): Chapter title
  1195. - `description` (string, optional): Chapter description
  1196. - `duration` (number, optional): Duration in milliseconds to show the chapter card
  1197. - Read-only: **true**
  1198. <!-- NOTE: This has been generated via update-readme.js -->
  1199. - **browser_video_hide_actions**
  1200. - Title: Hide action overlays
  1201. - Description: Stop annotating actions performed on the page.
  1202. - Parameters: None
  1203. - Read-only: **true**
  1204. <!-- NOTE: This has been generated via update-readme.js -->
  1205. - **browser_video_show_actions**
  1206. - Title: Show action overlays
  1207. - Description: Annotate subsequent actions performed on the page with a callout that names the action and, when styled, marks the action point and highlights the target element. Useful while video recording or screencasting.
  1208. - Parameters:
  1209. - `duration` (number, optional): How long each action annotation stays on screen, in milliseconds. Defaults to 500.
  1210. - `position` (string, optional): Where to place the action title relative to the page. Defaults to top-right.
  1211. - `cursor` (string, optional): Cursor decoration for pointer actions. "pointer" (default) animates a mouse pointer from the previous action point to the next one; "none" disables the cursor decoration.
  1212. - `style` (object, optional): Styles of the action decorations.
  1213. - Read-only: **true**
  1214. </details>
  1215. <details>
  1216. <summary><b>Coordinate-based (opt-in via --caps=vision)</b></summary>
  1217. <!-- NOTE: This has been generated via update-readme.js -->
  1218. - **browser_mouse_click_xy**
  1219. - Title: Click
  1220. - Description: Click mouse button at a given position
  1221. - Parameters:
  1222. - `x` (number): X coordinate
  1223. - `y` (number): Y coordinate
  1224. - `button` (string, optional): Button to click, defaults to left
  1225. - `clickCount` (number, optional): Number of clicks, defaults to 1
  1226. - `delay` (number, optional): Time to wait between mouse down and mouse up in milliseconds, defaults to 0
  1227. - Read-only: **false**
  1228. <!-- NOTE: This has been generated via update-readme.js -->
  1229. - **browser_mouse_down**
  1230. - Title: Press mouse down
  1231. - Description: Press mouse down
  1232. - Parameters:
  1233. - `button` (string, optional): Button to press, defaults to left
  1234. - Read-only: **false**
  1235. <!-- NOTE: This has been generated via update-readme.js -->
  1236. - **browser_mouse_drag_xy**
  1237. - Title: Drag mouse
  1238. - Description: Drag left mouse button to a given position
  1239. - Parameters:
  1240. - `startX` (number): Start X coordinate
  1241. - `startY` (number): Start Y coordinate
  1242. - `endX` (number): End X coordinate
  1243. - `endY` (number): End Y coordinate
  1244. - Read-only: **false**
  1245. <!-- NOTE: This has been generated via update-readme.js -->
  1246. - **browser_mouse_move_xy**
  1247. - Title: Move mouse
  1248. - Description: Move mouse to a given position
  1249. - Parameters:
  1250. - `x` (number): X coordinate
  1251. - `y` (number): Y coordinate
  1252. - Read-only: **false**
  1253. <!-- NOTE: This has been generated via update-readme.js -->
  1254. - **browser_mouse_up**
  1255. - Title: Press mouse up
  1256. - Description: Press mouse up
  1257. - Parameters:
  1258. - `button` (string, optional): Button to press, defaults to left
  1259. - Read-only: **false**
  1260. <!-- NOTE: This has been generated via update-readme.js -->
  1261. - **browser_mouse_wheel**
  1262. - Title: Scroll mouse wheel
  1263. - Description: Scroll mouse wheel
  1264. - Parameters:
  1265. - `deltaX` (number): X delta
  1266. - `deltaY` (number): Y delta
  1267. - Read-only: **false**
  1268. </details>
  1269. <details>
  1270. <summary><b>PDF generation (opt-in via --caps=pdf)</b></summary>
  1271. <!-- NOTE: This has been generated via update-readme.js -->
  1272. - **browser_pdf_save**
  1273. - Title: Save as PDF
  1274. - Description: Save page as PDF
  1275. - Parameters:
  1276. - `filename` (string, optional): File name to save the pdf to. Relative file names are resolved against the workspace root. If not specified, the pdf is saved into the output directory as `page-{timestamp}.pdf`.
  1277. - Read-only: **true**
  1278. </details>
  1279. <details>
  1280. <summary><b>Test assertions (opt-in via --caps=testing)</b></summary>
  1281. <!-- NOTE: This has been generated via update-readme.js -->
  1282. - **browser_generate_locator**
  1283. - Title: Create locator for element
  1284. - Description: Generate locator for the given element to use in tests
  1285. - Parameters:
  1286. - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
  1287. - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
  1288. - Read-only: **true**
  1289. <!-- NOTE: This has been generated via update-readme.js -->
  1290. - **browser_verify_element_visible**
  1291. - Title: Verify element visible
  1292. - Description: Verify element is visible on the page
  1293. - Parameters:
  1294. - `role` (string): ROLE of the element. Can be found in the snapshot like this: `- {ROLE} "Accessible Name":`
  1295. - `accessibleName` (string): ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role "{ACCESSIBLE_NAME}"`
  1296. - Read-only: **false**
  1297. <!-- NOTE: This has been generated via update-readme.js -->
  1298. - **browser_verify_list_visible**
  1299. - Title: Verify list visible
  1300. - Description: Verify list is visible on the page
  1301. - Parameters:
  1302. - `element` (string): Human-readable list description
  1303. - `target` (string): Exact target element reference that points to the list
  1304. - `items` (array): Items to verify
  1305. - Read-only: **false**
  1306. <!-- NOTE: This has been generated via update-readme.js -->
  1307. - **browser_verify_text_visible**
  1308. - Title: Verify text visible
  1309. - Description: Verify text is visible on the page. Prefer browser_verify_element_visible if possible.
  1310. - Parameters:
  1311. - `text` (string): TEXT to verify. Can be found in the snapshot like this: `- role "Accessible Name": {TEXT}` or like this: `- text: {TEXT}`
  1312. - Read-only: **false**
  1313. <!-- NOTE: This has been generated via update-readme.js -->
  1314. - **browser_verify_value**
  1315. - Title: Verify value
  1316. - Description: Verify element value
  1317. - Parameters:
  1318. - `type` (string): Type of the element
  1319. - `element` (string): Human-readable element description
  1320. - `target` (string): Exact target element reference from the page snapshot
  1321. - `value` (string): Value to verify. For checkbox, use "true" or "false".
  1322. - Read-only: **false**
  1323. </details>
  1324. <!--- End of tools generated section -->

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.