@playdrop/playdrop-cli 0.14.7 → 0.14.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/config/client-meta.json +2 -2
  2. package/dist/commands/worker.d.ts +1 -1
  3. package/dist/commands/worker.js +29 -8
  4. package/dist/index.js +1 -1
  5. package/node_modules/@playdrop/config/client-meta.json +2 -2
  6. package/node_modules/@playwright/mcp/LICENSE +201 -0
  7. package/node_modules/@playwright/mcp/README.md +1592 -0
  8. package/node_modules/@playwright/mcp/cli.js +32 -0
  9. package/node_modules/@playwright/mcp/config.d.ts +239 -0
  10. package/node_modules/@playwright/mcp/index.d.ts +23 -0
  11. package/node_modules/@playwright/mcp/index.js +19 -0
  12. package/node_modules/@playwright/mcp/node_modules/playwright/LICENSE +202 -0
  13. package/node_modules/@playwright/mcp/node_modules/playwright/NOTICE +5 -0
  14. package/node_modules/@playwright/mcp/node_modules/playwright/README.md +318 -0
  15. package/node_modules/@playwright/mcp/node_modules/playwright/ThirdPartyNotices.txt +14 -0
  16. package/node_modules/@playwright/mcp/node_modules/playwright/cli.js +19 -0
  17. package/node_modules/@playwright/mcp/node_modules/playwright/index.d.ts +17 -0
  18. package/node_modules/@playwright/mcp/node_modules/playwright/index.js +17 -0
  19. package/node_modules/@playwright/mcp/node_modules/playwright/index.mjs +18 -0
  20. package/node_modules/@playwright/mcp/node_modules/playwright/jsx-runtime.js +42 -0
  21. package/node_modules/@playwright/mcp/node_modules/playwright/jsx-runtime.mjs +21 -0
  22. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/agentParser.js +89 -0
  23. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
  24. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/generateAgents.js +395 -0
  25. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
  26. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
  27. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
  28. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
  29. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +56 -0
  30. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
  31. package/node_modules/@playwright/mcp/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +74 -0
  32. package/node_modules/@playwright/mcp/node_modules/playwright/lib/cli/reportActions.js +78 -0
  33. package/node_modules/@playwright/mcp/node_modules/playwright/lib/cli/testActions.js +213 -0
  34. package/node_modules/@playwright/mcp/node_modules/playwright/lib/common/index.js +2966 -0
  35. package/node_modules/@playwright/mcp/node_modules/playwright/lib/common/index.js.txt +34 -0
  36. package/node_modules/@playwright/mcp/node_modules/playwright/lib/errorContext.js +129 -0
  37. package/node_modules/@playwright/mcp/node_modules/playwright/lib/globals.js +58 -0
  38. package/node_modules/@playwright/mcp/node_modules/playwright/lib/index.js +783 -0
  39. package/node_modules/@playwright/mcp/node_modules/playwright/lib/isomorphic.js +260 -0
  40. package/node_modules/@playwright/mcp/node_modules/playwright/lib/isomorphic.js.txt +9 -0
  41. package/node_modules/@playwright/mcp/node_modules/playwright/lib/loader/loaderProcessEntry.js +34 -0
  42. package/node_modules/@playwright/mcp/node_modules/playwright/lib/loader/loaderProcessEntry.js.txt +9 -0
  43. package/node_modules/@playwright/mcp/node_modules/playwright/lib/matchers/expect.js +13480 -0
  44. package/node_modules/@playwright/mcp/node_modules/playwright/lib/matchers/expect.js.LICENSE +640 -0
  45. package/node_modules/@playwright/mcp/node_modules/playwright/lib/matchers/expect.js.txt +67 -0
  46. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/browserBackend.js +125 -0
  47. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
  48. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/plannerTools.js +150 -0
  49. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/seed.js +82 -0
  50. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/streams.js +44 -0
  51. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
  52. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testContext.js +306 -0
  53. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
  54. package/node_modules/@playwright/mcp/node_modules/playwright/lib/mcp/test/testTools.js +98 -0
  55. package/node_modules/@playwright/mcp/node_modules/playwright/lib/package.js +47 -0
  56. package/node_modules/@playwright/mcp/node_modules/playwright/lib/program.js +237 -0
  57. package/node_modules/@playwright/mcp/node_modules/playwright/lib/runner/index.js +8154 -0
  58. package/node_modules/@playwright/mcp/node_modules/playwright/lib/runner/index.js.txt +59 -0
  59. package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/babelBundle.js +72275 -0
  60. package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/babelBundle.js.LICENSE +2384 -0
  61. package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/babelBundle.js.txt +325 -0
  62. package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/esmLoader.js +8060 -0
  63. package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/esmLoader.js.LICENSE +355 -0
  64. package/node_modules/@playwright/mcp/node_modules/playwright/lib/transform/esmLoader.js.txt +60 -0
  65. package/node_modules/@playwright/mcp/node_modules/playwright/lib/util.js +373 -0
  66. package/node_modules/@playwright/mcp/node_modules/playwright/lib/worker/workerProcessEntry.js +1850 -0
  67. package/node_modules/@playwright/mcp/node_modules/playwright/lib/worker/workerProcessEntry.js.txt +19 -0
  68. package/node_modules/@playwright/mcp/node_modules/playwright/package.json +58 -0
  69. package/node_modules/@playwright/mcp/node_modules/playwright/test.d.ts +18 -0
  70. package/node_modules/@playwright/mcp/node_modules/playwright/test.js +24 -0
  71. package/node_modules/@playwright/mcp/node_modules/playwright/test.mjs +35 -0
  72. package/node_modules/@playwright/mcp/node_modules/playwright/types/test.d.ts +10709 -0
  73. package/node_modules/@playwright/mcp/node_modules/playwright/types/testReporter.d.ts +908 -0
  74. package/node_modules/@playwright/mcp/node_modules/playwright-core/LICENSE +202 -0
  75. package/node_modules/@playwright/mcp/node_modules/playwright-core/NOTICE +5 -0
  76. package/node_modules/@playwright/mcp/node_modules/playwright-core/README.md +3 -0
  77. package/node_modules/@playwright/mcp/node_modules/playwright-core/ThirdPartyNotices.txt +13 -0
  78. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
  79. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
  80. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
  81. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
  82. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
  83. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
  84. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
  85. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
  86. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
  87. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
  88. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
  89. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
  90. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
  91. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
  92. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
  93. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
  94. package/node_modules/@playwright/mcp/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
  95. package/node_modules/@playwright/mcp/node_modules/playwright-core/browsers.json +81 -0
  96. package/node_modules/@playwright/mcp/node_modules/playwright-core/cli.js +21 -0
  97. package/node_modules/@playwright/mcp/node_modules/playwright-core/index.d.ts +17 -0
  98. package/node_modules/@playwright/mcp/node_modules/playwright-core/index.js +17 -0
  99. package/node_modules/@playwright/mcp/node_modules/playwright-core/index.mjs +28 -0
  100. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/bootstrap.js +88 -0
  101. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/coreBundle.js +74495 -0
  102. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/cliDaemon.js +5 -0
  103. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/dashboardApp.js +3 -0
  104. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/mcp.js +10 -0
  105. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/entry/oopBrowserDownload.js +3 -0
  106. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/package.js +50 -0
  107. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
  108. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/server/electron/loader.js +118 -0
  109. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/serverRegistry.js +7347 -0
  110. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/serverRegistry.js.LICENSE +354 -0
  111. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/channelSessions.js +141 -0
  112. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/cli.js +6 -0
  113. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/help.json +707 -0
  114. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/minimist.js +128 -0
  115. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/output.js +343 -0
  116. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/program.js +404 -0
  117. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/registry.js +176 -0
  118. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/session.js +258 -0
  119. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/SKILL.md +420 -0
  120. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/element-attributes.md +23 -0
  121. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/playwright-tests.md +39 -0
  122. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/request-mocking.md +87 -0
  123. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/running-code.md +241 -0
  124. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/session-management.md +225 -0
  125. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/storage-state.md +275 -0
  126. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/test-generation.md +433 -0
  127. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/tracing.md +139 -0
  128. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/cli-client/skill/references/video-recording.md +143 -0
  129. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/dashboard/appIcon.png +0 -0
  130. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/trace/SKILL.md +171 -0
  131. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/utils/extension.js +78 -0
  132. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/tools/utils/socketConnection.js +108 -0
  133. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/utilsBundle.js +90764 -0
  134. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/utilsBundle.js.LICENSE +2179 -0
  135. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/codicon-DCmgc-ay.ttf +0 -0
  136. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-1bWoP6pv.svg +1 -0
  137. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-beta-k3eOH_eK.svg +1 -0
  138. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/firefox-nightly-Cp5nfeDT.svg +1 -0
  139. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/index-CyWAfh-p.js +11 -0
  140. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/index-DhC616m4.css +1 -0
  141. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/assets/safari-na3_-uQk.svg +1 -0
  142. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/index.html +29 -0
  143. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/dashboard/playwright-logo.svg +24 -0
  144. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/htmlReport/index.html +16 -0
  145. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/htmlReport/report.css +2 -0
  146. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/htmlReport/report.js +32 -0
  147. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule--QdMvsKi.css +1 -0
  148. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BVGIAA-i.js +32 -0
  149. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
  150. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/index-BQ57a3QC.js +129 -0
  151. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/assets/index-l_lX622x.css +1 -0
  152. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
  153. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
  154. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-BSEO6m_i.js +32 -0
  155. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-CT5oRh4X.js +181 -0
  156. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/urlMatch-L3liM589.js +1 -0
  157. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-BN2nOuEV.js +7 -0
  158. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.-QdMvsKi.css +1 -0
  159. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
  160. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.BLFoOugd.css +1 -0
  161. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/index.B_TqY17P.css +1 -0
  162. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/index.DLSGjmWZ.js +1 -0
  163. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/index.html +44 -0
  164. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
  165. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
  166. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/snapshot.B_Jk1wbt.js +1 -0
  167. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +10 -0
  168. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +4 -0
  169. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/uiMode.C7UW1sC9.css +1 -0
  170. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/uiMode.CZvydVOh.js +5 -0
  171. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +18 -0
  172. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.kHJ-D0s7.css +1 -0
  173. package/node_modules/@playwright/mcp/node_modules/playwright-core/lib/xdg-open +1267 -0
  174. package/node_modules/@playwright/mcp/node_modules/playwright-core/package.json +34 -0
  175. package/node_modules/@playwright/mcp/node_modules/playwright-core/types/protocol.d.ts +24842 -0
  176. package/node_modules/@playwright/mcp/node_modules/playwright-core/types/structs.d.ts +45 -0
  177. package/node_modules/@playwright/mcp/node_modules/playwright-core/types/types.d.ts +26088 -0
  178. package/node_modules/@playwright/mcp/package.json +51 -0
  179. package/package.json +3 -1
@@ -0,0 +1,1592 @@
1
+ ## Playwright MCP
2
+
3
+ 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.
4
+
5
+ ### Playwright MCP vs Playwright CLI
6
+
7
+ 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.
8
+
9
+ - **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)**.
10
+
11
+ - **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.
12
+
13
+ ### Key Features
14
+
15
+ - **Fast and lightweight**. Uses Playwright's accessibility tree, not pixel-based input.
16
+ - **LLM-friendly**. No vision models needed, operates purely on structured data.
17
+ - **Deterministic tool application**. Avoids ambiguity common with screenshot-based approaches.
18
+
19
+ ### Requirements
20
+ - Node.js 18 or newer
21
+ - VS Code, Cursor, Windsurf, Claude Desktop, Goose, Grok, Junie or any other MCP client
22
+
23
+ <!--
24
+ // Generate using:
25
+ node utils/generate-links.js
26
+ -->
27
+
28
+ ### Getting started
29
+
30
+ First, install the Playwright MCP server with your client.
31
+
32
+ **Standard config** works in most of the tools:
33
+
34
+ ```js
35
+ {
36
+ "mcpServers": {
37
+ "playwright": {
38
+ "command": "npx",
39
+ "args": [
40
+ "@playwright/mcp@latest"
41
+ ]
42
+ }
43
+ }
44
+ }
45
+ ```
46
+
47
+ [<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)
48
+
49
+ <details>
50
+ <summary>Amp</summary>
51
+
52
+ Add via the Amp VS Code extension settings screen or by updating your settings.json file:
53
+
54
+ ```json
55
+ "amp.mcpServers": {
56
+ "playwright": {
57
+ "command": "npx",
58
+ "args": [
59
+ "@playwright/mcp@latest"
60
+ ]
61
+ }
62
+ }
63
+ ```
64
+
65
+ **Amp CLI Setup:**
66
+
67
+ Add via the `amp mcp add`command below
68
+
69
+ ```bash
70
+ amp mcp add playwright -- npx @playwright/mcp@latest
71
+ ```
72
+
73
+ </details>
74
+
75
+ <details>
76
+ <summary>Antigravity</summary>
77
+
78
+ Add via the Antigravity settings or by updating your configuration file:
79
+
80
+ ```json
81
+ {
82
+ "mcpServers": {
83
+ "playwright": {
84
+ "command": "npx",
85
+ "args": [
86
+ "@playwright/mcp@latest"
87
+ ]
88
+ }
89
+ }
90
+ }
91
+ ```
92
+
93
+ </details>
94
+
95
+ <details>
96
+ <summary>Claude Code</summary>
97
+
98
+ Use the Claude Code CLI to add the Playwright MCP server:
99
+
100
+ ```bash
101
+ claude mcp add playwright npx @playwright/mcp@latest
102
+ ```
103
+ </details>
104
+
105
+ <details>
106
+ <summary>Claude Desktop</summary>
107
+
108
+ Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use the standard config above.
109
+
110
+ </details>
111
+
112
+ <details>
113
+ <summary>Cline</summary>
114
+
115
+ Follow the instruction in the section [Configuring MCP Servers](https://docs.cline.bot/mcp/configuring-mcp-servers)
116
+
117
+ **Example: Local Setup**
118
+
119
+ Add the following to your [`cline_mcp_settings.json`](https://docs.cline.bot/mcp/configuring-mcp-servers#editing-mcp-settings-files) file:
120
+
121
+ ```json
122
+ {
123
+ "mcpServers": {
124
+ "playwright": {
125
+ "type": "stdio",
126
+ "command": "npx",
127
+ "timeout": 30,
128
+ "args": [
129
+ "-y",
130
+ "@playwright/mcp@latest"
131
+ ],
132
+ "disabled": false
133
+ }
134
+ }
135
+ }
136
+ ```
137
+
138
+ </details>
139
+
140
+ <details>
141
+ <summary>Codex</summary>
142
+
143
+ Use the Codex CLI to add the Playwright MCP server:
144
+
145
+ ```bash
146
+ codex mcp add playwright npx "@playwright/mcp@latest"
147
+ ```
148
+
149
+ Alternatively, create or edit the configuration file `~/.codex/config.toml` and add:
150
+
151
+ ```toml
152
+ [mcp_servers.playwright]
153
+ command = "npx"
154
+ args = ["@playwright/mcp@latest"]
155
+ ```
156
+
157
+ For more information, see the [Codex MCP documentation](https://github.com/openai/codex/blob/main/codex-rs/config.md#mcp_servers).
158
+
159
+ </details>
160
+
161
+ <details>
162
+ <summary>Copilot</summary>
163
+
164
+ Use the Copilot CLI to interactively add the Playwright MCP server:
165
+
166
+ ```bash
167
+ /mcp add
168
+ ```
169
+
170
+ Alternatively, create or edit the configuration file `~/.copilot/mcp-config.json` and add:
171
+
172
+ ```json
173
+ {
174
+ "mcpServers": {
175
+ "playwright": {
176
+ "type": "local",
177
+ "command": "npx",
178
+ "tools": [
179
+ "*"
180
+ ],
181
+ "args": [
182
+ "@playwright/mcp@latest"
183
+ ]
184
+ }
185
+ }
186
+ }
187
+ ```
188
+
189
+ For more information, see the [Copilot CLI documentation](https://docs.github.com/en/copilot/concepts/agents/about-copilot-cli).
190
+
191
+ </details>
192
+
193
+ <details>
194
+ <summary>Cursor</summary>
195
+
196
+ #### Click the button to install:
197
+
198
+ [<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)
199
+
200
+ #### Or install manually:
201
+
202
+ 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`.
203
+
204
+ </details>
205
+
206
+ <details>
207
+ <summary>Factory</summary>
208
+
209
+ Use the Factory CLI to add the Playwright MCP server:
210
+
211
+ ```bash
212
+ droid mcp add playwright "npx @playwright/mcp@latest"
213
+ ```
214
+
215
+ Alternatively, type `/mcp` within Factory droid to open an interactive UI for managing MCP servers.
216
+
217
+ For more information, see the [Factory MCP documentation](https://docs.factory.ai/cli/configuration/mcp).
218
+
219
+ </details>
220
+
221
+ <details>
222
+ <summary>Gemini CLI</summary>
223
+
224
+ 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.
225
+
226
+ </details>
227
+
228
+ <details>
229
+ <summary>Goose</summary>
230
+
231
+ #### Click the button to install:
232
+
233
+ [![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)
234
+
235
+ #### Or install manually:
236
+
237
+ 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".
238
+ </details>
239
+
240
+ <details>
241
+ <summary>Grok</summary>
242
+
243
+ Use the Grok CLI to add the Playwright MCP server:
244
+
245
+ ```bash
246
+ grok mcp add playwright -- npx @playwright/mcp@latest
247
+ ```
248
+
249
+ Alternatively, create or edit the configuration file `~/.grok/config.toml` and add:
250
+
251
+ ```toml
252
+ [mcp_servers.playwright]
253
+ command = "npx"
254
+ args = ["@playwright/mcp@latest"]
255
+ ```
256
+
257
+ For more information, see the [Grok MCP documentation](https://docs.x.ai/build/features/mcp-servers).
258
+
259
+ </details>
260
+
261
+ <details>
262
+ <summary>Junie</summary>
263
+
264
+ To add the Playwright MCP server in Junie CLI:
265
+
266
+ 1. Type `/mcp`
267
+ 2. Press `Ctrl+A` to add a new MCP server
268
+ 3. Select **Playwright** from the list
269
+
270
+ Alternatively, add to `.junie/mcp/mcp.json`:
271
+
272
+ ```json
273
+ {
274
+ "mcpServers": {
275
+ "Playwright": {
276
+ "command": "npx",
277
+ "args": [
278
+ "-y",
279
+ "@playwright/mcp@latest"
280
+ ]
281
+ }
282
+ }
283
+ }
284
+ ```
285
+
286
+ For more information, see the [Junie MCP configuration documentation](https://junie.jetbrains.com/docs/junie-cli-mcp-configuration.html).
287
+
288
+ </details>
289
+
290
+ <details>
291
+ <summary>Kiro</summary>
292
+
293
+ [![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)
294
+
295
+ Follow the MCP Servers [documentation](https://kiro.dev/docs/mcp/). For example in `.kiro/settings/mcp.json`:
296
+
297
+ ```json
298
+ {
299
+ "mcpServers": {
300
+ "playwright": {
301
+ "command": "npx",
302
+ "args": [
303
+ "@playwright/mcp@latest"
304
+ ]
305
+ }
306
+ }
307
+ }
308
+ ```
309
+ </details>
310
+
311
+ <details>
312
+ <summary>LM Studio</summary>
313
+
314
+ #### Click the button to install:
315
+
316
+ [![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)
317
+
318
+ #### Or install manually:
319
+
320
+ Go to `Program` in the right sidebar -> `Install` -> `Edit mcp.json`. Use the standard config above.
321
+ </details>
322
+
323
+ <details>
324
+ <summary>opencode</summary>
325
+
326
+ Follow the MCP Servers [documentation](https://opencode.ai/docs/mcp-servers/). For example in `~/.config/opencode/opencode.json`:
327
+
328
+ ```json
329
+ {
330
+ "$schema": "https://opencode.ai/config.json",
331
+ "mcp": {
332
+ "playwright": {
333
+ "type": "local",
334
+ "command": [
335
+ "npx",
336
+ "@playwright/mcp@latest"
337
+ ],
338
+ "enabled": true
339
+ }
340
+ }
341
+ }
342
+
343
+ ```
344
+ </details>
345
+
346
+ <details>
347
+ <summary>Qodo Gen</summary>
348
+
349
+ 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.
350
+
351
+ Click <code>Save</code>.
352
+ </details>
353
+
354
+ <details>
355
+ <summary>VS Code</summary>
356
+
357
+ #### Click the button to install:
358
+
359
+ [<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)
360
+
361
+ #### Or install manually:
362
+
363
+ 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:
364
+
365
+ ```bash
366
+ # For VS Code
367
+ code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
368
+ ```
369
+
370
+ After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
371
+ </details>
372
+
373
+ <details>
374
+ <summary>Warp</summary>
375
+
376
+ 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.
377
+
378
+ Alternatively, use the slash command `/add-mcp` in the Warp prompt and paste the standard config from above:
379
+ ```js
380
+ {
381
+ "mcpServers": {
382
+ "playwright": {
383
+ "command": "npx",
384
+ "args": [
385
+ "@playwright/mcp@latest"
386
+ ]
387
+ }
388
+ }
389
+ }
390
+ ```
391
+
392
+ </details>
393
+
394
+ <details>
395
+ <summary>Windsurf</summary>
396
+
397
+ Follow Windsurf MCP [documentation](https://docs.windsurf.com/windsurf/cascade/mcp). Use the standard config above.
398
+
399
+ </details>
400
+
401
+ ### Configuration
402
+
403
+ Playwright MCP server supports following arguments. They can be provided in the JSON configuration above, as a part of the `"args"` list:
404
+
405
+ <!--- Options generated by update-readme.js -->
406
+
407
+ | Option | Description |
408
+ |--------|-------------|
409
+ | --allowed-hosts <hosts...> | comma-separated list of hosts this server is allowed to serve from. Defaults to the host the server is bound to. Pass '*' to disable the host check.<br>*env* `PLAYWRIGHT_MCP_ALLOWED_HOSTS` |
410
+ | --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` |
411
+ | --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` |
412
+ | --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` |
413
+ | --block-service-workers | block service workers<br>*env* `PLAYWRIGHT_MCP_BLOCK_SERVICE_WORKERS` |
414
+ | --browser <browser> | browser or chrome channel to use, possible values: chrome, firefox, webkit, msedge.<br>*env* `PLAYWRIGHT_MCP_BROWSER` |
415
+ | --caps <caps> | comma-separated list of additional capabilities to enable, possible values: vision, pdf, devtools.<br>*env* `PLAYWRIGHT_MCP_CAPS` |
416
+ | --cdp-endpoint <endpoint> | CDP endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_CDP_ENDPOINT` |
417
+ | --cdp-header <headers...> | CDP headers to send with the connect request, multiple can be specified.<br>*env* `PLAYWRIGHT_MCP_CDP_HEADERS` |
418
+ | --cdp-timeout <timeout> | timeout in milliseconds for connecting to CDP endpoint, defaults to 30000ms<br>*env* `PLAYWRIGHT_MCP_CDP_TIMEOUT` |
419
+ | --codegen <lang> | specify the language to use for code generation, possible values: "typescript", "none". Default is "typescript".<br>*env* `PLAYWRIGHT_MCP_CODEGEN` |
420
+ | --config <path> | path to the configuration file.<br>*env* `PLAYWRIGHT_MCP_CONFIG` |
421
+ | --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` |
422
+ | --device <device> | device to emulate, for example: "iPhone 15"<br>*env* `PLAYWRIGHT_MCP_DEVICE` |
423
+ | --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` |
424
+ | --executable-path <path> | path to the browser executable.<br>*env* `PLAYWRIGHT_MCP_EXECUTABLE_PATH` |
425
+ | --extension | Connect to a running browser instance (Edge/Chrome only). Requires the "Playwright Extension" to be installed.<br>*env* `PLAYWRIGHT_MCP_EXTENSION` |
426
+ | --endpoint <endpoint> | Bound browser endpoint to connect to.<br>*env* `PLAYWRIGHT_MCP_ENDPOINT` |
427
+ | --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` |
428
+ | --headless | run browser in headless mode, headed by default<br>*env* `PLAYWRIGHT_MCP_HEADLESS` |
429
+ | --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` |
430
+ | --ignore-https-errors | ignore https errors<br>*env* `PLAYWRIGHT_MCP_IGNORE_HTTPS_ERRORS` |
431
+ | --init-page <path...> | path to TypeScript file to evaluate on Playwright page object<br>*env* `PLAYWRIGHT_MCP_INIT_PAGE` |
432
+ | --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` |
433
+ | --isolated | keep the browser profile in memory, do not save it to disk.<br>*env* `PLAYWRIGHT_MCP_ISOLATED` |
434
+ | --image-responses <mode> | whether to send image responses to the client. Can be "allow" or "omit", Defaults to "allow".<br>*env* `PLAYWRIGHT_MCP_IMAGE_RESPONSES` |
435
+ | --no-sandbox | disable the sandbox for all process types that are normally sandboxed.<br>*env* `PLAYWRIGHT_MCP_NO_SANDBOX` |
436
+ | --output-dir <path> | path to the directory for output files.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_DIR` |
437
+ | --output-max-size <bytes> | Threshold for evicting old output files, in bytes.<br>*env* `PLAYWRIGHT_MCP_OUTPUT_MAX_SIZE` |
438
+ | --output-mode <mode> | whether to save snapshots, console messages, network logs to a file or to the standard output. Can be "file" or "stdout". Default is "stdout".<br>*env* `PLAYWRIGHT_MCP_OUTPUT_MODE` |
439
+ | --port <port> | port to listen on for SSE transport.<br>*env* `PLAYWRIGHT_MCP_PORT` |
440
+ | --proxy-bypass <bypass> | comma-separated domains to bypass proxy, for example ".com,chromium.org,.domain.com"<br>*env* `PLAYWRIGHT_MCP_PROXY_BYPASS` |
441
+ | --proxy-server <proxy> | specify proxy server, for example "http://myproxy:3128" or "socks5://myproxy:8080"<br>*env* `PLAYWRIGHT_MCP_PROXY_SERVER` |
442
+ | --sandbox | enable the sandbox for all process types that are normally not sandboxed.<br>*env* `PLAYWRIGHT_MCP_SANDBOX` |
443
+ | --save-session | Whether to save the Playwright MCP session into the output directory.<br>*env* `PLAYWRIGHT_MCP_SAVE_SESSION` |
444
+ | --secrets <path> | path to a file containing secrets in the dotenv format<br>*env* `PLAYWRIGHT_MCP_SECRETS_FILE` |
445
+ | --shared-browser-context | reuse the same browser context between all connected HTTP clients.<br>*env* `PLAYWRIGHT_MCP_SHARED_BROWSER_CONTEXT` |
446
+ | --snapshot-mode <mode> | when taking snapshots for responses, specifies the mode to use. Can be "full" or "none". Default is "full".<br>*env* `PLAYWRIGHT_MCP_SNAPSHOT_MODE` |
447
+ | --storage-state <path> | path to the storage state file for isolated sessions.<br>*env* `PLAYWRIGHT_MCP_STORAGE_STATE` |
448
+ | --test-id-attribute <attribute> | specify the attribute to use for test ids, defaults to "data-testid"<br>*env* `PLAYWRIGHT_MCP_TEST_ID_ATTRIBUTE` |
449
+ | --timeout-action <timeout> | specify action timeout in milliseconds, defaults to 5000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_ACTION` |
450
+ | --timeout-navigation <timeout> | specify navigation timeout in milliseconds, defaults to 60000ms<br>*env* `PLAYWRIGHT_MCP_TIMEOUT_NAVIGATION` |
451
+ | --user-agent <ua string> | specify user agent string<br>*env* `PLAYWRIGHT_MCP_USER_AGENT` |
452
+ | --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` |
453
+ | --viewport-size <size> | specify browser viewport size in pixels, for example "1280x720"<br>*env* `PLAYWRIGHT_MCP_VIEWPORT_SIZE` |
454
+
455
+ <!--- End of options generated section -->
456
+
457
+ ### User profile
458
+
459
+ 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.
460
+
461
+ **Persistent profile**
462
+
463
+ 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.
464
+ Persistent profile is located at the following locations and you can override it with the `--user-data-dir` argument.
465
+
466
+ ```bash
467
+ # Windows
468
+ %USERPROFILE%\AppData\Local\ms-playwright\mcp-{channel}-{workspace-hash}
469
+
470
+ # macOS
471
+ - ~/Library/Caches/ms-playwright/mcp-{channel}-{workspace-hash}
472
+
473
+ # Linux
474
+ - ~/.cache/ms-playwright/mcp-{channel}-{workspace-hash}
475
+ ```
476
+
477
+ `{workspace-hash}` is derived from the MCP client's workspace root, so different projects get separate profiles automatically.
478
+
479
+ > [!IMPORTANT]
480
+ > 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`.
481
+
482
+ **Isolated**
483
+
484
+ In the isolated mode, each session is started in the isolated profile. Every time you ask MCP to close the browser,
485
+ the session is closed and all the storage state for this session is lost. You can provide initial storage state
486
+ to the browser via the config's `contextOptions` or via the `--storage-state` argument. Learn more about the storage
487
+ state [here](https://playwright.dev/docs/auth).
488
+
489
+ ```js
490
+ {
491
+ "mcpServers": {
492
+ "playwright": {
493
+ "command": "npx",
494
+ "args": [
495
+ "@playwright/mcp@latest",
496
+ "--isolated",
497
+ "--storage-state={path/to/storage.json}"
498
+ ]
499
+ }
500
+ }
501
+ }
502
+ ```
503
+
504
+ **Browser Extension**
505
+
506
+ 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.
507
+
508
+ ### Initial state
509
+
510
+ There are multiple ways to provide the initial state to the browser context or a page.
511
+
512
+ For the storage state, you can either:
513
+ - Start with a user data directory using the `--user-data-dir` argument. This will persist all browser data between the sessions.
514
+ - 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.
515
+
516
+ For the page state, you can use:
517
+
518
+ - `--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.
519
+
520
+ ```ts
521
+ // init-page.ts
522
+ export default async ({ page }) => {
523
+ await page.context().grantPermissions(['geolocation']);
524
+ await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
525
+ await page.setViewportSize({ width: 1280, height: 720 });
526
+ };
527
+ ```
528
+
529
+ - `--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.
530
+ This is useful for overriding browser APIs or setting up the environment.
531
+
532
+ ```js
533
+ // init-script.js
534
+ window.isPlaywrightMCP = true;
535
+ ```
536
+
537
+ ### Configuration file
538
+
539
+ The Playwright MCP server can be configured using a JSON configuration file. You can specify the configuration file
540
+ using the `--config` command line option:
541
+
542
+ ```bash
543
+ npx @playwright/mcp@latest --config path/to/config.json
544
+ ```
545
+
546
+ <details>
547
+ <summary>Configuration file schema</summary>
548
+
549
+ <!--- Config generated by update-readme.js -->
550
+
551
+ ```typescript
552
+ {
553
+ /**
554
+ * The browser to use.
555
+ */
556
+ browser?: {
557
+ /**
558
+ * The type of browser to use.
559
+ */
560
+ browserName?: 'chromium' | 'firefox' | 'webkit';
561
+
562
+ /**
563
+ * Keep the browser profile in memory, do not save it to disk.
564
+ */
565
+ isolated?: boolean;
566
+
567
+ /**
568
+ * Path to a user data directory for browser profile persistence.
569
+ * Temporary directory is created by default.
570
+ */
571
+ userDataDir?: string;
572
+
573
+ /**
574
+ * Launch options passed to
575
+ * @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context
576
+ *
577
+ * This is useful for settings options like `channel`, `headless`, `executablePath`, etc.
578
+ */
579
+ launchOptions?: playwright.LaunchOptions;
580
+
581
+ /**
582
+ * Context options for the browser context.
583
+ *
584
+ * This is useful for settings options like `viewport`.
585
+ */
586
+ contextOptions?: playwright.BrowserContextOptions;
587
+
588
+ /**
589
+ * Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.
590
+ */
591
+ cdpEndpoint?: string;
592
+
593
+ /**
594
+ * CDP headers to send with the connect request.
595
+ */
596
+ cdpHeaders?: Record<string, string>;
597
+
598
+ /**
599
+ * Timeout in milliseconds for connecting to CDP endpoint. Defaults to 30000 (30 seconds). Pass 0 to disable timeout.
600
+ */
601
+ cdpTimeout?: number;
602
+
603
+ /**
604
+ * Remote endpoint to connect to an existing Playwright server. May be a
605
+ * WebSocket URL string, or a [ConnectOptions] object that mirrors the
606
+ * `connectOptions` shape used by the test runner. When passed as an object,
607
+ * `exposeNetwork`, `headers`, `slowMo`, and `timeout` are forwarded to the
608
+ * underlying connect call.
609
+ */
610
+ remoteEndpoint?: string | playwright.ConnectOptions & { endpoint: string };
611
+
612
+ /**
613
+ * Paths to TypeScript files to add as initialization scripts for Playwright page.
614
+ */
615
+ initPage?: string[];
616
+
617
+ /**
618
+ * Paths to JavaScript files to add as initialization scripts.
619
+ * The scripts will be evaluated in every page before any of the page's scripts.
620
+ */
621
+ initScript?: string[];
622
+ },
623
+
624
+ /**
625
+ * Connect to a running browser instance (Edge/Chrome only). If specified, `browser`
626
+ * config is ignored.
627
+ * Requires the "Playwright Extension" to be installed.
628
+ */
629
+ extension?: boolean;
630
+
631
+ server?: {
632
+ /**
633
+ * The port to listen on for SSE or MCP transport.
634
+ */
635
+ port?: number;
636
+
637
+ /**
638
+ * The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
639
+ */
640
+ host?: string;
641
+
642
+ /**
643
+ * The hosts this server is allowed to serve from. Defaults to the host server is bound to.
644
+ * This is not for CORS, but rather for the DNS rebinding protection.
645
+ */
646
+ allowedHosts?: string[];
647
+ },
648
+
649
+ /**
650
+ * List of enabled tool capabilities. Possible values:
651
+ * - 'core': Core browser automation features.
652
+ * - 'pdf': PDF generation and manipulation.
653
+ * - 'vision': Coordinate-based interactions.
654
+ * - 'devtools': Developer tools features.
655
+ */
656
+ capabilities?: ToolCapability[];
657
+
658
+ /**
659
+ * Whether to save the Playwright session into the output directory.
660
+ */
661
+ saveSession?: boolean;
662
+
663
+ /**
664
+ * Reuse the same browser context between all connected HTTP clients.
665
+ */
666
+ sharedBrowserContext?: boolean;
667
+
668
+ /**
669
+ * Secrets are used to replace matching plain text in the tool responses to prevent the LLM
670
+ * from accidentally getting sensitive data. It is a convenience and not a security feature,
671
+ * make sure to always examine information coming in and from the tool on the client.
672
+ */
673
+ secrets?: Record<string, string>;
674
+
675
+ /**
676
+ * The directory to save output files.
677
+ */
678
+ outputDir?: string;
679
+
680
+ /**
681
+ * Threshold for evicting old output files, in bytes.
682
+ */
683
+ outputMaxSize?: number;
684
+
685
+ console?: {
686
+ /**
687
+ * The level of console messages to return. Each level includes the messages of more severe levels. Defaults to "info".
688
+ */
689
+ level?: 'error' | 'warning' | 'info' | 'debug';
690
+ },
691
+
692
+ network?: {
693
+ /**
694
+ * List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
695
+ *
696
+ * Supported formats:
697
+ * - Full origin: `https://example.com:8080` - matches only that origin
698
+ * - Wildcard port: `http://localhost:*` - matches any port on localhost with http protocol
699
+ */
700
+ allowedOrigins?: string[];
701
+
702
+ /**
703
+ * List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
704
+ *
705
+ * Supported formats:
706
+ * - Full origin: `https://example.com:8080` - matches only that origin
707
+ * - Wildcard port: `http://localhost:*` - matches any port on localhost with http protocol
708
+ */
709
+ blockedOrigins?: string[];
710
+ };
711
+
712
+ /**
713
+ * Specify the attribute to use for test ids, defaults to "data-testid".
714
+ */
715
+ testIdAttribute?: string;
716
+
717
+ timeouts?: {
718
+ /*
719
+ * Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.
720
+ */
721
+ action?: number;
722
+
723
+ /*
724
+ * Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.
725
+ */
726
+ navigation?: number;
727
+
728
+ /**
729
+ * Configures default expect timeout: https://playwright.dev/docs/test-timeouts#expect-timeout. Defaults to 5000ms.
730
+ */
731
+ expect?: number;
732
+ };
733
+
734
+ /**
735
+ * Whether to send image responses to the client. Can be "allow", "omit", or "auto". Defaults to "auto", which sends images if the client can display them.
736
+ */
737
+ imageResponses?: 'allow' | 'omit';
738
+
739
+ snapshot?: {
740
+ /**
741
+ * When taking snapshots for responses, specifies the mode to use.
742
+ */
743
+ mode?: 'full' | 'none';
744
+ };
745
+
746
+ /**
747
+ * allowUnrestrictedFileAccess acts as a guardrail to prevent the LLM from accidentally
748
+ * wandering outside its intended workspace. It is a convenience defense to catch unintended
749
+ * file access, not a secure boundary; a deliberate attempt to reach other directories can be
750
+ * easily worked around, so always rely on client-level permissions for true security.
751
+ */
752
+ allowUnrestrictedFileAccess?: boolean;
753
+
754
+ /**
755
+ * Specify the language to use for code generation.
756
+ */
757
+ codegen?: 'typescript' | 'none';
758
+ }
759
+ ```
760
+
761
+ <!--- End of config generated section -->
762
+
763
+ </details>
764
+
765
+ ### Standalone MCP server
766
+
767
+ When running headed browser on system w/o display or from worker processes of the IDEs,
768
+ run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable HTTP transport.
769
+
770
+ ```bash
771
+ npx @playwright/mcp@latest --port 8931
772
+ ```
773
+
774
+ And then in MCP client config, set the `url` to the HTTP endpoint:
775
+
776
+ ```js
777
+ {
778
+ "mcpServers": {
779
+ "playwright": {
780
+ "url": "http://localhost:8931/mcp"
781
+ }
782
+ }
783
+ }
784
+ ```
785
+
786
+ ## Security
787
+
788
+ 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.
789
+
790
+ <details>
791
+ <summary><b>Docker</b></summary>
792
+
793
+ **NOTE:** The Docker implementation only supports headless chromium at the moment.
794
+
795
+ ```js
796
+ {
797
+ "mcpServers": {
798
+ "playwright": {
799
+ "command": "docker",
800
+ "args": ["run", "-i", "--rm", "--init", "--pull=always", "mcr.microsoft.com/playwright/mcp"]
801
+ }
802
+ }
803
+ }
804
+ ```
805
+
806
+ Or If you prefer to run the container as a long-lived service instead of letting the MCP client spawn it, use:
807
+
808
+ ```
809
+ docker run -d -i --rm --init --pull=always \
810
+ --entrypoint node \
811
+ --name playwright \
812
+ -p 8931:8931 \
813
+ mcr.microsoft.com/playwright/mcp \
814
+ /app/cli.js --headless --browser chromium --no-sandbox --port 8931 --host 0.0.0.0
815
+ ```
816
+
817
+ The server will listen on host port **8931** and can be reached by any MCP client.
818
+
819
+ You can build the Docker image yourself.
820
+
821
+ ```
822
+ docker build -t mcr.microsoft.com/playwright/mcp .
823
+ ```
824
+ </details>
825
+
826
+ <details>
827
+ <summary><b>Programmatic usage</b></summary>
828
+
829
+ ```js
830
+ import http from 'http';
831
+
832
+ import { createConnection } from '@playwright/mcp';
833
+ import { SSEServerTransport } from '@modelcontextprotocol/sdk/server/sse.js';
834
+
835
+ http.createServer(async (req, res) => {
836
+ // ...
837
+
838
+ // Creates a headless Playwright MCP server with SSE transport
839
+ const connection = await createConnection({ browser: { launchOptions: { headless: true } } });
840
+ const transport = new SSEServerTransport('/messages', res);
841
+ await connection.connect(transport);
842
+
843
+ // ...
844
+ });
845
+ ```
846
+ </details>
847
+
848
+ ### Tools
849
+
850
+ <!--- Tools generated by update-readme.js -->
851
+
852
+ <details>
853
+ <summary><b>Core automation</b></summary>
854
+
855
+ <!-- NOTE: This has been generated via update-readme.js -->
856
+
857
+ - **browser_click**
858
+ - Title: Click
859
+ - Description: Perform click on a web page
860
+ - Parameters:
861
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
862
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
863
+ - `doubleClick` (boolean, optional): Whether to perform a double click instead of a single click
864
+ - `button` (string, optional): Button to click, defaults to left
865
+ - `modifiers` (array, optional): Modifier keys to press
866
+ - Read-only: **false**
867
+
868
+ <!-- NOTE: This has been generated via update-readme.js -->
869
+
870
+ - **browser_close**
871
+ - Title: Close browser
872
+ - Description: Close the page
873
+ - Parameters: None
874
+ - Read-only: **false**
875
+
876
+ <!-- NOTE: This has been generated via update-readme.js -->
877
+
878
+ - **browser_console_messages**
879
+ - Title: Get console messages
880
+ - Description: Returns all console messages
881
+ - Parameters:
882
+ - `level` (string): Level of the console messages to return. Each level includes the messages of more severe levels. Defaults to "info".
883
+ - `all` (boolean, optional): Return all console messages since the beginning of the session, not just since the last navigation. Defaults to false.
884
+ - `filename` (string, optional): Filename to save the console messages to. If not provided, messages are returned as text.
885
+ - Read-only: **true**
886
+
887
+ <!-- NOTE: This has been generated via update-readme.js -->
888
+
889
+ - **browser_drag**
890
+ - Title: Drag mouse
891
+ - Description: Perform drag and drop between two elements
892
+ - Parameters:
893
+ - `startElement` (string, optional): Human-readable source element description used to obtain the permission to interact with the element
894
+ - `startTarget` (string): Exact target element reference from the page snapshot, or a unique element selector
895
+ - `endElement` (string, optional): Human-readable target element description used to obtain the permission to interact with the element
896
+ - `endTarget` (string): Exact target element reference from the page snapshot, or a unique element selector
897
+ - Read-only: **false**
898
+
899
+ <!-- NOTE: This has been generated via update-readme.js -->
900
+
901
+ - **browser_drop**
902
+ - Title: Drop files or data onto an element
903
+ - 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.
904
+ - Parameters:
905
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
906
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
907
+ - `paths` (array, optional): Absolute paths to files to drop onto the element.
908
+ - `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"}).
909
+ - Read-only: **false**
910
+
911
+ <!-- NOTE: This has been generated via update-readme.js -->
912
+
913
+ - **browser_evaluate**
914
+ - Title: Evaluate JavaScript
915
+ - Description: Evaluate JavaScript expression on page or element
916
+ - Parameters:
917
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
918
+ - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
919
+ - `function` (string): () => { /* code */ } or (element) => { /* code */ } when element is provided
920
+ - `filename` (string, optional): Filename to save the result to. If not provided, result is returned as text.
921
+ - Read-only: **false**
922
+
923
+ <!-- NOTE: This has been generated via update-readme.js -->
924
+
925
+ - **browser_file_upload**
926
+ - Title: Upload files
927
+ - Description: Upload one or multiple files
928
+ - Parameters:
929
+ - `paths` (array, optional): The absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled.
930
+ - Read-only: **false**
931
+
932
+ <!-- NOTE: This has been generated via update-readme.js -->
933
+
934
+ - **browser_fill_form**
935
+ - Title: Fill form
936
+ - Description: Fill multiple form fields
937
+ - Parameters:
938
+ - `fields` (array): Fields to fill in
939
+ - Read-only: **false**
940
+
941
+ <!-- NOTE: This has been generated via update-readme.js -->
942
+
943
+ - **browser_find**
944
+ - Title: Find in page snapshot
945
+ - 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.
946
+ - Parameters:
947
+ - `text` (string, optional): Plain text to search for in the page snapshot (case-insensitive substring match). Provide either text or regex, not both.
948
+ - `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.
949
+ - Read-only: **true**
950
+
951
+ <!-- NOTE: This has been generated via update-readme.js -->
952
+
953
+ - **browser_handle_dialog**
954
+ - Title: Handle a dialog
955
+ - Description: Handle a dialog
956
+ - Parameters:
957
+ - `accept` (boolean): Whether to accept the dialog.
958
+ - `promptText` (string, optional): The text of the prompt in case of a prompt dialog.
959
+ - Read-only: **false**
960
+
961
+ <!-- NOTE: This has been generated via update-readme.js -->
962
+
963
+ - **browser_hover**
964
+ - Title: Hover mouse
965
+ - Description: Hover over element on page
966
+ - Parameters:
967
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
968
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
969
+ - Read-only: **false**
970
+
971
+ <!-- NOTE: This has been generated via update-readme.js -->
972
+
973
+ - **browser_navigate**
974
+ - Title: Navigate to a URL
975
+ - Description: Navigate to a URL
976
+ - Parameters:
977
+ - `url` (string): The URL to navigate to
978
+ - Read-only: **false**
979
+
980
+ <!-- NOTE: This has been generated via update-readme.js -->
981
+
982
+ - **browser_navigate_back**
983
+ - Title: Go back
984
+ - Description: Go back to the previous page in the history
985
+ - Parameters: None
986
+ - Read-only: **false**
987
+
988
+ <!-- NOTE: This has been generated via update-readme.js -->
989
+
990
+ - **browser_network_request**
991
+ - Title: Show network request details
992
+ - 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.
993
+ - Parameters:
994
+ - `index` (integer): 1-based index of the request, as printed by browser_network_requests.
995
+ - `part` (string, optional): Return only this part of the request. Omit to return full details.
996
+ - `filename` (string, optional): Filename to save the result to. If not provided, output is returned as text.
997
+ - Read-only: **true**
998
+
999
+ <!-- NOTE: This has been generated via update-readme.js -->
1000
+
1001
+ - **browser_network_requests**
1002
+ - Title: List network requests
1003
+ - Description: Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.
1004
+ - Parameters:
1005
+ - `static` (boolean): Whether to include successful static resources like images, fonts, scripts, etc. Defaults to false.
1006
+ - `filter` (string, optional): Only return requests whose URL matches this regexp (e.g. "/api/.*user").
1007
+ - `filename` (string, optional): Filename to save the network requests to. If not provided, requests are returned as text.
1008
+ - Read-only: **true**
1009
+
1010
+ <!-- NOTE: This has been generated via update-readme.js -->
1011
+
1012
+ - **browser_press_key**
1013
+ - Title: Press a key
1014
+ - Description: Press a key on the keyboard
1015
+ - Parameters:
1016
+ - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
1017
+ - Read-only: **false**
1018
+
1019
+ <!-- NOTE: This has been generated via update-readme.js -->
1020
+
1021
+ - **browser_resize**
1022
+ - Title: Resize browser window
1023
+ - Description: Resize the browser window
1024
+ - Parameters:
1025
+ - `width` (number): Width of the browser window
1026
+ - `height` (number): Height of the browser window
1027
+ - Read-only: **false**
1028
+
1029
+ <!-- NOTE: This has been generated via update-readme.js -->
1030
+
1031
+ - **browser_run_code_unsafe**
1032
+ - Title: Run Playwright code (unsafe)
1033
+ - Description: Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.
1034
+ - Parameters:
1035
+ - `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(); }`
1036
+ - `filename` (string, optional): Load code from the specified file. If both code and filename are provided, code will be ignored.
1037
+ - Read-only: **false**
1038
+
1039
+ <!-- NOTE: This has been generated via update-readme.js -->
1040
+
1041
+ - **browser_select_option**
1042
+ - Title: Select option
1043
+ - Description: Select an option in a dropdown
1044
+ - Parameters:
1045
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
1046
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
1047
+ - `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.
1048
+ - Read-only: **false**
1049
+
1050
+ <!-- NOTE: This has been generated via update-readme.js -->
1051
+
1052
+ - **browser_snapshot**
1053
+ - Title: Page snapshot
1054
+ - Description: Capture accessibility snapshot of the current page, this is better than screenshot
1055
+ - Parameters:
1056
+ - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
1057
+ - `filename` (string, optional): Save snapshot to markdown file instead of returning it in the response.
1058
+ - `depth` (number, optional): Limit the depth of the snapshot tree
1059
+ - `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)
1060
+ - Read-only: **true**
1061
+
1062
+ <!-- NOTE: This has been generated via update-readme.js -->
1063
+
1064
+ - **browser_take_screenshot**
1065
+ - Title: Take a screenshot
1066
+ - Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
1067
+ - Parameters:
1068
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
1069
+ - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
1070
+ - `type` (string): Image format for the screenshot. Default is png.
1071
+ - `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. Prefer relative file names to stay within the output directory.
1072
+ - `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.
1073
+ - `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.
1074
+ - Read-only: **true**
1075
+
1076
+ <!-- NOTE: This has been generated via update-readme.js -->
1077
+
1078
+ - **browser_type**
1079
+ - Title: Type text
1080
+ - Description: Type text into editable element
1081
+ - Parameters:
1082
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
1083
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
1084
+ - `text` (string): Text to type into the element
1085
+ - `submit` (boolean, optional): Whether to submit entered text (press Enter after)
1086
+ - `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.
1087
+ - Read-only: **false**
1088
+
1089
+ <!-- NOTE: This has been generated via update-readme.js -->
1090
+
1091
+ - **browser_wait_for**
1092
+ - Title: Wait for
1093
+ - Description: Wait for text to appear or disappear or a specified time to pass
1094
+ - Parameters:
1095
+ - `time` (number, optional): The time to wait in seconds
1096
+ - `text` (string, optional): The text to wait for
1097
+ - `textGone` (string, optional): The text to wait for to disappear
1098
+ - Read-only: **false**
1099
+
1100
+ </details>
1101
+
1102
+ <details>
1103
+ <summary><b>Tab management</b></summary>
1104
+
1105
+ <!-- NOTE: This has been generated via update-readme.js -->
1106
+
1107
+ - **browser_tabs**
1108
+ - Title: Manage tabs
1109
+ - Description: List, create, close, or select a browser tab.
1110
+ - Parameters:
1111
+ - `action` (string): Operation to perform
1112
+ - `index` (number, optional): Tab index, used for close/select. If omitted for close, current tab is closed.
1113
+ - `url` (string, optional): URL to navigate to in the new tab, used for new.
1114
+ - Read-only: **false**
1115
+
1116
+ </details>
1117
+
1118
+ <details>
1119
+ <summary><b>Browser installation</b></summary>
1120
+
1121
+ </details>
1122
+
1123
+ <details>
1124
+ <summary><b>Configuration (opt-in via --caps=config)</b></summary>
1125
+
1126
+ <!-- NOTE: This has been generated via update-readme.js -->
1127
+
1128
+ - **browser_get_config**
1129
+ - Title: Get config
1130
+ - Description: Get the final resolved config after merging CLI options, environment variables and config file.
1131
+ - Parameters: None
1132
+ - Read-only: **true**
1133
+
1134
+ </details>
1135
+
1136
+ <details>
1137
+ <summary><b>Network (opt-in via --caps=network)</b></summary>
1138
+
1139
+ <!-- NOTE: This has been generated via update-readme.js -->
1140
+
1141
+ - **browser_network_state_set**
1142
+ - Title: Set network state
1143
+ - Description: Sets the browser network state to online or offline. When offline, all network requests will fail.
1144
+ - Parameters:
1145
+ - `state` (string): Set to "offline" to simulate offline mode, "online" to restore network connectivity
1146
+ - Read-only: **false**
1147
+
1148
+ <!-- NOTE: This has been generated via update-readme.js -->
1149
+
1150
+ - **browser_route**
1151
+ - Title: Mock network requests
1152
+ - Description: Set up a route to mock network requests matching a URL pattern
1153
+ - Parameters:
1154
+ - `pattern` (string): URL pattern to match (e.g., "**/api/users", "**/*.{png,jpg}")
1155
+ - `status` (number, optional): HTTP status code to return (default: 200)
1156
+ - `body` (string, optional): Response body (text or JSON string)
1157
+ - `contentType` (string, optional): Content-Type header (e.g., "application/json", "text/html")
1158
+ - `headers` (array, optional): Headers to add in "Name: Value" format
1159
+ - `removeHeaders` (string, optional): Comma-separated list of header names to remove from request
1160
+ - Read-only: **false**
1161
+
1162
+ <!-- NOTE: This has been generated via update-readme.js -->
1163
+
1164
+ - **browser_route_list**
1165
+ - Title: List network routes
1166
+ - Description: List all active network routes
1167
+ - Parameters: None
1168
+ - Read-only: **true**
1169
+
1170
+ <!-- NOTE: This has been generated via update-readme.js -->
1171
+
1172
+ - **browser_unroute**
1173
+ - Title: Remove network routes
1174
+ - Description: Remove network routes matching a pattern (or all routes if no pattern specified)
1175
+ - Parameters:
1176
+ - `pattern` (string, optional): URL pattern to unroute (omit to remove all routes)
1177
+ - Read-only: **false**
1178
+
1179
+ </details>
1180
+
1181
+ <details>
1182
+ <summary><b>Storage (opt-in via --caps=storage)</b></summary>
1183
+
1184
+ <!-- NOTE: This has been generated via update-readme.js -->
1185
+
1186
+ - **browser_cookie_clear**
1187
+ - Title: Clear cookies
1188
+ - Description: Clear all cookies
1189
+ - Parameters: None
1190
+ - Read-only: **false**
1191
+
1192
+ <!-- NOTE: This has been generated via update-readme.js -->
1193
+
1194
+ - **browser_cookie_delete**
1195
+ - Title: Delete cookie
1196
+ - Description: Delete a specific cookie
1197
+ - Parameters:
1198
+ - `name` (string): Cookie name to delete
1199
+ - Read-only: **false**
1200
+
1201
+ <!-- NOTE: This has been generated via update-readme.js -->
1202
+
1203
+ - **browser_cookie_get**
1204
+ - Title: Get cookie
1205
+ - Description: Get a specific cookie by name
1206
+ - Parameters:
1207
+ - `name` (string): Cookie name to get
1208
+ - Read-only: **true**
1209
+
1210
+ <!-- NOTE: This has been generated via update-readme.js -->
1211
+
1212
+ - **browser_cookie_list**
1213
+ - Title: List cookies
1214
+ - Description: List all cookies (optionally filtered by domain/path)
1215
+ - Parameters:
1216
+ - `domain` (string, optional): Filter cookies by domain
1217
+ - `path` (string, optional): Filter cookies by path
1218
+ - Read-only: **true**
1219
+
1220
+ <!-- NOTE: This has been generated via update-readme.js -->
1221
+
1222
+ - **browser_cookie_set**
1223
+ - Title: Set cookie
1224
+ - Description: Set a cookie with optional flags (domain, path, expires, httpOnly, secure, sameSite)
1225
+ - Parameters:
1226
+ - `name` (string): Cookie name
1227
+ - `value` (string): Cookie value
1228
+ - `domain` (string, optional): Cookie domain
1229
+ - `path` (string, optional): Cookie path
1230
+ - `expires` (number, optional): Cookie expiration as Unix timestamp
1231
+ - `httpOnly` (boolean, optional): Whether the cookie is HTTP only
1232
+ - `secure` (boolean, optional): Whether the cookie is secure
1233
+ - `sameSite` (string, optional): Cookie SameSite attribute
1234
+ - Read-only: **false**
1235
+
1236
+ <!-- NOTE: This has been generated via update-readme.js -->
1237
+
1238
+ - **browser_localstorage_clear**
1239
+ - Title: Clear localStorage
1240
+ - Description: Clear all localStorage
1241
+ - Parameters: None
1242
+ - Read-only: **false**
1243
+
1244
+ <!-- NOTE: This has been generated via update-readme.js -->
1245
+
1246
+ - **browser_localstorage_delete**
1247
+ - Title: Delete localStorage item
1248
+ - Description: Delete a localStorage item
1249
+ - Parameters:
1250
+ - `key` (string): Key to delete
1251
+ - Read-only: **false**
1252
+
1253
+ <!-- NOTE: This has been generated via update-readme.js -->
1254
+
1255
+ - **browser_localstorage_get**
1256
+ - Title: Get localStorage item
1257
+ - Description: Get a localStorage item by key
1258
+ - Parameters:
1259
+ - `key` (string): Key to get
1260
+ - Read-only: **true**
1261
+
1262
+ <!-- NOTE: This has been generated via update-readme.js -->
1263
+
1264
+ - **browser_localstorage_list**
1265
+ - Title: List localStorage
1266
+ - Description: List all localStorage key-value pairs
1267
+ - Parameters: None
1268
+ - Read-only: **true**
1269
+
1270
+ <!-- NOTE: This has been generated via update-readme.js -->
1271
+
1272
+ - **browser_localstorage_set**
1273
+ - Title: Set localStorage item
1274
+ - Description: Set a localStorage item
1275
+ - Parameters:
1276
+ - `key` (string): Key to set
1277
+ - `value` (string): Value to set
1278
+ - Read-only: **false**
1279
+
1280
+ <!-- NOTE: This has been generated via update-readme.js -->
1281
+
1282
+ - **browser_sessionstorage_clear**
1283
+ - Title: Clear sessionStorage
1284
+ - Description: Clear all sessionStorage
1285
+ - Parameters: None
1286
+ - Read-only: **false**
1287
+
1288
+ <!-- NOTE: This has been generated via update-readme.js -->
1289
+
1290
+ - **browser_sessionstorage_delete**
1291
+ - Title: Delete sessionStorage item
1292
+ - Description: Delete a sessionStorage item
1293
+ - Parameters:
1294
+ - `key` (string): Key to delete
1295
+ - Read-only: **false**
1296
+
1297
+ <!-- NOTE: This has been generated via update-readme.js -->
1298
+
1299
+ - **browser_sessionstorage_get**
1300
+ - Title: Get sessionStorage item
1301
+ - Description: Get a sessionStorage item by key
1302
+ - Parameters:
1303
+ - `key` (string): Key to get
1304
+ - Read-only: **true**
1305
+
1306
+ <!-- NOTE: This has been generated via update-readme.js -->
1307
+
1308
+ - **browser_sessionstorage_list**
1309
+ - Title: List sessionStorage
1310
+ - Description: List all sessionStorage key-value pairs
1311
+ - Parameters: None
1312
+ - Read-only: **true**
1313
+
1314
+ <!-- NOTE: This has been generated via update-readme.js -->
1315
+
1316
+ - **browser_sessionstorage_set**
1317
+ - Title: Set sessionStorage item
1318
+ - Description: Set a sessionStorage item
1319
+ - Parameters:
1320
+ - `key` (string): Key to set
1321
+ - `value` (string): Value to set
1322
+ - Read-only: **false**
1323
+
1324
+ <!-- NOTE: This has been generated via update-readme.js -->
1325
+
1326
+ - **browser_set_storage_state**
1327
+ - Title: Restore storage state
1328
+ - Description: Restore storage state (cookies, local storage) from a file. This clears existing cookies and local storage before restoring.
1329
+ - Parameters:
1330
+ - `filename` (string): Path to the storage state file to restore from
1331
+ - Read-only: **false**
1332
+
1333
+ <!-- NOTE: This has been generated via update-readme.js -->
1334
+
1335
+ - **browser_storage_state**
1336
+ - Title: Save storage state
1337
+ - Description: Save storage state (cookies, local storage) to a file for later reuse
1338
+ - Parameters:
1339
+ - `filename` (string, optional): File name to save the storage state to. Defaults to `storage-state-{timestamp}.json` if not specified.
1340
+ - Read-only: **true**
1341
+
1342
+ </details>
1343
+
1344
+ <details>
1345
+ <summary><b>DevTools (opt-in via --caps=devtools)</b></summary>
1346
+
1347
+ <!-- NOTE: This has been generated via update-readme.js -->
1348
+
1349
+ - **browser_annotate**
1350
+ - Title: Annotate the current page
1351
+ - 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.
1352
+ - Parameters: None
1353
+ - Read-only: **true**
1354
+
1355
+ <!-- NOTE: This has been generated via update-readme.js -->
1356
+
1357
+ - **browser_hide_highlight**
1358
+ - Title: Hide element highlight
1359
+ - Description: Remove a highlight overlay previously added for the element.
1360
+ - Parameters:
1361
+ - `element` (string, optional): Human-readable element description used when adding the highlight; must match the value passed to browser_highlight.
1362
+ - `target` (string, optional): Exact target element reference from the page snapshot, or a unique element selector
1363
+ - Read-only: **true**
1364
+
1365
+ <!-- NOTE: This has been generated via update-readme.js -->
1366
+
1367
+ - **browser_highlight**
1368
+ - Title: Highlight element
1369
+ - Description: Show a persistent highlight overlay around the element on the page.
1370
+ - Parameters:
1371
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
1372
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
1373
+ - `style` (string, optional): Additional inline CSS applied to the highlight overlay, e.g. "outline: 2px dashed red".
1374
+ - Read-only: **true**
1375
+
1376
+ <!-- NOTE: This has been generated via update-readme.js -->
1377
+
1378
+ - **browser_resume**
1379
+ - Title: Resume paused script execution
1380
+ - Description: Resume script execution after it was paused. When called with step set to true, execution will pause again before the next action.
1381
+ - Parameters:
1382
+ - `step` (boolean, optional): When true, execution will pause again before the next action, allowing step-by-step debugging.
1383
+ - `location` (string, optional): Pause execution at a specific <file>:<line>, e.g. "example.spec.ts:42".
1384
+ - Read-only: **false**
1385
+
1386
+ <!-- NOTE: This has been generated via update-readme.js -->
1387
+
1388
+ - **browser_start_tracing**
1389
+ - Title: Start tracing
1390
+ - Description: Start trace recording
1391
+ - Parameters: None
1392
+ - Read-only: **true**
1393
+
1394
+ <!-- NOTE: This has been generated via update-readme.js -->
1395
+
1396
+ - **browser_start_video**
1397
+ - Title: Start video
1398
+ - Description: Start video recording
1399
+ - Parameters:
1400
+ - `filename` (string, optional): Filename to save the video.
1401
+ - `size` (object, optional): Video size
1402
+ - Read-only: **true**
1403
+
1404
+ <!-- NOTE: This has been generated via update-readme.js -->
1405
+
1406
+ - **browser_stop_tracing**
1407
+ - Title: Stop tracing
1408
+ - Description: Stop trace recording
1409
+ - Parameters: None
1410
+ - Read-only: **true**
1411
+
1412
+ <!-- NOTE: This has been generated via update-readme.js -->
1413
+
1414
+ - **browser_stop_video**
1415
+ - Title: Stop video
1416
+ - Description: Stop video recording
1417
+ - Parameters: None
1418
+ - Read-only: **true**
1419
+
1420
+ <!-- NOTE: This has been generated via update-readme.js -->
1421
+
1422
+ - **browser_video_chapter**
1423
+ - Title: Video chapter
1424
+ - Description: Add a chapter marker to the video recording. Shows a full-screen chapter card with blurred backdrop.
1425
+ - Parameters:
1426
+ - `title` (string): Chapter title
1427
+ - `description` (string, optional): Chapter description
1428
+ - `duration` (number, optional): Duration in milliseconds to show the chapter card
1429
+ - Read-only: **true**
1430
+
1431
+ <!-- NOTE: This has been generated via update-readme.js -->
1432
+
1433
+ - **browser_video_hide_actions**
1434
+ - Title: Hide action overlays
1435
+ - Description: Stop annotating actions performed on the page.
1436
+ - Parameters: None
1437
+ - Read-only: **true**
1438
+
1439
+ <!-- NOTE: This has been generated via update-readme.js -->
1440
+
1441
+ - **browser_video_show_actions**
1442
+ - Title: Show action overlays
1443
+ - Description: Annotate subsequent actions performed on the page with a callout that names the action and highlights the target element. Useful while video recording or screencasting.
1444
+ - Parameters:
1445
+ - `duration` (number, optional): How long each action annotation stays on screen, in milliseconds. Defaults to 500.
1446
+ - `position` (string, optional): Where to place the action title relative to the page. Defaults to top-right.
1447
+ - `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.
1448
+ - Read-only: **true**
1449
+
1450
+ </details>
1451
+
1452
+ <details>
1453
+ <summary><b>Coordinate-based (opt-in via --caps=vision)</b></summary>
1454
+
1455
+ <!-- NOTE: This has been generated via update-readme.js -->
1456
+
1457
+ - **browser_mouse_click_xy**
1458
+ - Title: Click
1459
+ - Description: Click mouse button at a given position
1460
+ - Parameters:
1461
+ - `x` (number): X coordinate
1462
+ - `y` (number): Y coordinate
1463
+ - `button` (string, optional): Button to click, defaults to left
1464
+ - `clickCount` (number, optional): Number of clicks, defaults to 1
1465
+ - `delay` (number, optional): Time to wait between mouse down and mouse up in milliseconds, defaults to 0
1466
+ - Read-only: **false**
1467
+
1468
+ <!-- NOTE: This has been generated via update-readme.js -->
1469
+
1470
+ - **browser_mouse_down**
1471
+ - Title: Press mouse down
1472
+ - Description: Press mouse down
1473
+ - Parameters:
1474
+ - `button` (string, optional): Button to press, defaults to left
1475
+ - Read-only: **false**
1476
+
1477
+ <!-- NOTE: This has been generated via update-readme.js -->
1478
+
1479
+ - **browser_mouse_drag_xy**
1480
+ - Title: Drag mouse
1481
+ - Description: Drag left mouse button to a given position
1482
+ - Parameters:
1483
+ - `startX` (number): Start X coordinate
1484
+ - `startY` (number): Start Y coordinate
1485
+ - `endX` (number): End X coordinate
1486
+ - `endY` (number): End Y coordinate
1487
+ - Read-only: **false**
1488
+
1489
+ <!-- NOTE: This has been generated via update-readme.js -->
1490
+
1491
+ - **browser_mouse_move_xy**
1492
+ - Title: Move mouse
1493
+ - Description: Move mouse to a given position
1494
+ - Parameters:
1495
+ - `x` (number): X coordinate
1496
+ - `y` (number): Y coordinate
1497
+ - Read-only: **false**
1498
+
1499
+ <!-- NOTE: This has been generated via update-readme.js -->
1500
+
1501
+ - **browser_mouse_up**
1502
+ - Title: Press mouse up
1503
+ - Description: Press mouse up
1504
+ - Parameters:
1505
+ - `button` (string, optional): Button to press, defaults to left
1506
+ - Read-only: **false**
1507
+
1508
+ <!-- NOTE: This has been generated via update-readme.js -->
1509
+
1510
+ - **browser_mouse_wheel**
1511
+ - Title: Scroll mouse wheel
1512
+ - Description: Scroll mouse wheel
1513
+ - Parameters:
1514
+ - `deltaX` (number): X delta
1515
+ - `deltaY` (number): Y delta
1516
+ - Read-only: **false**
1517
+
1518
+ </details>
1519
+
1520
+ <details>
1521
+ <summary><b>PDF generation (opt-in via --caps=pdf)</b></summary>
1522
+
1523
+ <!-- NOTE: This has been generated via update-readme.js -->
1524
+
1525
+ - **browser_pdf_save**
1526
+ - Title: Save as PDF
1527
+ - Description: Save page as PDF
1528
+ - Parameters:
1529
+ - `filename` (string, optional): File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified. Prefer relative file names to stay within the output directory.
1530
+ - Read-only: **true**
1531
+
1532
+ </details>
1533
+
1534
+ <details>
1535
+ <summary><b>Test assertions (opt-in via --caps=testing)</b></summary>
1536
+
1537
+ <!-- NOTE: This has been generated via update-readme.js -->
1538
+
1539
+ - **browser_generate_locator**
1540
+ - Title: Create locator for element
1541
+ - Description: Generate locator for the given element to use in tests
1542
+ - Parameters:
1543
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
1544
+ - `target` (string): Exact target element reference from the page snapshot, or a unique element selector
1545
+ - Read-only: **true**
1546
+
1547
+ <!-- NOTE: This has been generated via update-readme.js -->
1548
+
1549
+ - **browser_verify_element_visible**
1550
+ - Title: Verify element visible
1551
+ - Description: Verify element is visible on the page
1552
+ - Parameters:
1553
+ - `role` (string): ROLE of the element. Can be found in the snapshot like this: `- {ROLE} "Accessible Name":`
1554
+ - `accessibleName` (string): ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role "{ACCESSIBLE_NAME}"`
1555
+ - Read-only: **false**
1556
+
1557
+ <!-- NOTE: This has been generated via update-readme.js -->
1558
+
1559
+ - **browser_verify_list_visible**
1560
+ - Title: Verify list visible
1561
+ - Description: Verify list is visible on the page
1562
+ - Parameters:
1563
+ - `element` (string): Human-readable list description
1564
+ - `target` (string): Exact target element reference that points to the list
1565
+ - `items` (array): Items to verify
1566
+ - Read-only: **false**
1567
+
1568
+ <!-- NOTE: This has been generated via update-readme.js -->
1569
+
1570
+ - **browser_verify_text_visible**
1571
+ - Title: Verify text visible
1572
+ - Description: Verify text is visible on the page. Prefer browser_verify_element_visible if possible.
1573
+ - Parameters:
1574
+ - `text` (string): TEXT to verify. Can be found in the snapshot like this: `- role "Accessible Name": {TEXT}` or like this: `- text: {TEXT}`
1575
+ - Read-only: **false**
1576
+
1577
+ <!-- NOTE: This has been generated via update-readme.js -->
1578
+
1579
+ - **browser_verify_value**
1580
+ - Title: Verify value
1581
+ - Description: Verify element value
1582
+ - Parameters:
1583
+ - `type` (string): Type of the element
1584
+ - `element` (string): Human-readable element description
1585
+ - `target` (string): Exact target element reference from the page snapshot
1586
+ - `value` (string): Value to verify. For checkbox, use "true" or "false".
1587
+ - Read-only: **false**
1588
+
1589
+ </details>
1590
+
1591
+
1592
+ <!--- End of tools generated section -->