@playwright/mcp 0.0.30 → 0.0.32

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 (54) hide show
  1. package/README.md +180 -320
  2. package/config.d.ts +5 -14
  3. package/index.d.ts +1 -6
  4. package/lib/browserContextFactory.js +3 -35
  5. package/lib/browserServerBackend.js +54 -0
  6. package/lib/config.js +64 -7
  7. package/lib/context.js +50 -163
  8. package/lib/extension/cdpRelay.js +370 -0
  9. package/lib/extension/main.js +33 -0
  10. package/lib/httpServer.js +20 -182
  11. package/lib/index.js +3 -2
  12. package/lib/log.js +21 -0
  13. package/lib/loop/loop.js +69 -0
  14. package/lib/loop/loopClaude.js +152 -0
  15. package/lib/loop/loopOpenAI.js +141 -0
  16. package/lib/loop/main.js +60 -0
  17. package/lib/loopTools/context.js +66 -0
  18. package/lib/loopTools/main.js +49 -0
  19. package/lib/loopTools/perform.js +32 -0
  20. package/lib/loopTools/snapshot.js +29 -0
  21. package/lib/loopTools/tool.js +18 -0
  22. package/lib/mcp/inProcessTransport.js +72 -0
  23. package/lib/mcp/server.js +88 -0
  24. package/lib/{transport.js → mcp/transport.js} +30 -42
  25. package/lib/package.js +3 -3
  26. package/lib/program.js +47 -17
  27. package/lib/response.js +98 -0
  28. package/lib/sessionLog.js +70 -0
  29. package/lib/tab.js +166 -21
  30. package/lib/tools/common.js +13 -25
  31. package/lib/tools/console.js +4 -15
  32. package/lib/tools/dialogs.js +14 -19
  33. package/lib/tools/evaluate.js +53 -0
  34. package/lib/tools/files.js +13 -19
  35. package/lib/tools/install.js +4 -8
  36. package/lib/tools/keyboard.js +51 -17
  37. package/lib/tools/mouse.js +99 -0
  38. package/lib/tools/navigate.js +22 -42
  39. package/lib/tools/network.js +5 -15
  40. package/lib/tools/pdf.js +8 -15
  41. package/lib/tools/screenshot.js +29 -30
  42. package/lib/tools/snapshot.js +49 -109
  43. package/lib/tools/tabs.js +21 -52
  44. package/lib/tools/tool.js +14 -0
  45. package/lib/tools/utils.js +7 -6
  46. package/lib/tools/wait.js +8 -11
  47. package/lib/tools.js +15 -26
  48. package/package.json +12 -5
  49. package/lib/browserServer.js +0 -151
  50. package/lib/connection.js +0 -82
  51. package/lib/pageSnapshot.js +0 -43
  52. package/lib/server.js +0 -48
  53. package/lib/tools/testing.js +0 -60
  54. package/lib/tools/vision.js +0 -189
package/README.md CHANGED
@@ -19,7 +19,9 @@ node utils/generate-links.js
19
19
 
20
20
  ### Getting started
21
21
 
22
- First, install the Playwright MCP server with your client. A typical configuration looks like this:
22
+ First, install the Playwright MCP server with your client.
23
+
24
+ **Standard config** works in most of the tools:
23
25
 
24
26
  ```js
25
27
  {
@@ -37,20 +39,25 @@ First, install the Playwright MCP server with your client. A typical configurati
37
39
  [<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)
38
40
 
39
41
 
40
- <details><summary><b>Install in VS Code</b></summary>
42
+ <details>
43
+ <summary>Claude Code</summary>
41
44
 
42
- You can also install the Playwright MCP server using the VS Code CLI:
45
+ Use the Claude Code CLI to add the Playwright MCP server:
43
46
 
44
47
  ```bash
45
- # For VS Code
46
- code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
48
+ claude mcp add playwright npx @playwright/mcp@latest
47
49
  ```
50
+ </details>
51
+
52
+ <details>
53
+ <summary>Claude Desktop</summary>
54
+
55
+ Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use the standard config above.
48
56
 
49
- After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
50
57
  </details>
51
58
 
52
59
  <details>
53
- <summary><b>Install in Cursor</b></summary>
60
+ <summary>Cursor</summary>
54
61
 
55
62
  #### Click the button to install:
56
63
 
@@ -60,118 +67,71 @@ After installation, the Playwright MCP server will be available for use with you
60
67
 
61
68
  Go to `Cursor Settings` -> `MCP` -> `Add new MCP Server`. Name to your liking, use `command` type with the command `npx @playwright/mcp`. You can also verify config or add command like arguments via clicking `Edit`.
62
69
 
63
- ```js
64
- {
65
- "mcpServers": {
66
- "playwright": {
67
- "command": "npx",
68
- "args": [
69
- "@playwright/mcp@latest"
70
- ]
71
- }
72
- }
73
- }
74
- ```
75
70
  </details>
76
71
 
77
72
  <details>
78
- <summary><b>Install in Windsurf</b></summary>
73
+ <summary>Gemini CLI</summary>
79
74
 
80
- Follow Windsurf MCP [documentation](https://docs.windsurf.com/windsurf/cascade/mcp). Use following configuration:
75
+ 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.
81
76
 
82
- ```js
83
- {
84
- "mcpServers": {
85
- "playwright": {
86
- "command": "npx",
87
- "args": [
88
- "@playwright/mcp@latest"
89
- ]
90
- }
91
- }
92
- }
93
- ```
94
77
  </details>
95
78
 
96
79
  <details>
97
- <summary><b>Install in Claude Desktop</b></summary>
98
-
99
- Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use following configuration:
80
+ <summary>Goose</summary>
100
81
 
101
- ```js
102
- {
103
- "mcpServers": {
104
- "playwright": {
105
- "command": "npx",
106
- "args": [
107
- "@playwright/mcp@latest"
108
- ]
109
- }
110
- }
111
- }
112
- ```
113
- </details>
82
+ #### Click the button to install:
114
83
 
115
- <details>
116
- <summary><b>Install in Claude Code</b></summary>
84
+ [![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)
117
85
 
118
- Use the Claude Code CLI to add the Playwright MCP server:
86
+ #### Or install manually:
119
87
 
120
- ```bash
121
- claude mcp add playwright npx @playwright/mcp@latest
122
- ```
88
+ 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".
123
89
  </details>
124
90
 
125
91
  <details>
126
- <summary><b>Install in Goose</b></summary>
92
+ <summary>LM Studio</summary>
127
93
 
128
94
  #### Click the button to install:
129
95
 
130
- [![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)
96
+ [![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)
131
97
 
132
98
  #### Or install manually:
133
99
 
134
- 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".
100
+ Go to `Program` in the right sidebar -> `Install` -> `Edit mcp.json`. Use the standard config above.
135
101
  </details>
136
102
 
137
103
  <details>
138
- <summary><b>Install in Qodo Gen</b></summary>
139
-
140
- 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 following configuration:
104
+ <summary>Qodo Gen</summary>
141
105
 
142
- ```js
143
- {
144
- "mcpServers": {
145
- "playwright": {
146
- "command": "npx",
147
- "args": [
148
- "@playwright/mcp@latest"
149
- ]
150
- }
151
- }
152
- }
153
- ```
106
+ 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.
154
107
 
155
108
  Click <code>Save</code>.
156
109
  </details>
157
110
 
158
111
  <details>
159
- <summary><b>Install in Gemini CLI</b></summary>
112
+ <summary>VS Code</summary>
160
113
 
161
- 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 following configuration:
114
+ #### Click the button to install:
162
115
 
163
- ```js
164
- {
165
- "mcpServers": {
166
- "playwright": {
167
- "command": "npx",
168
- "args": [
169
- "@playwright/mcp@latest"
170
- ]
171
- }
172
- }
173
- }
116
+ [<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)
117
+
118
+ #### Or install manually:
119
+
120
+ 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:
121
+
122
+ ```bash
123
+ # For VS Code
124
+ code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
174
125
  ```
126
+
127
+ After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
128
+ </details>
129
+
130
+ <details>
131
+ <summary>Windsurf</summary>
132
+
133
+ Follow Windsurf MCP [documentation](https://docs.windsurf.com/windsurf/cascade/mcp). Use the standard config above.
134
+
175
135
  </details>
176
136
 
177
137
  ### Configuration
@@ -192,10 +152,8 @@ Playwright MCP server supports following arguments. They can be provided in the
192
152
  --block-service-workers block service workers
193
153
  --browser <browser> browser or chrome channel to use, possible
194
154
  values: chrome, firefox, webkit, msedge.
195
- --browser-agent <endpoint> Use browser agent (experimental).
196
- --caps <caps> comma-separated list of capabilities to enable,
197
- possible values: tabs, pdf, history, wait, files,
198
- install. Default is all.
155
+ --caps <caps> comma-separated list of additional capabilities
156
+ to enable, possible values: vision, pdf.
199
157
  --cdp-endpoint <endpoint> CDP endpoint to connect to.
200
158
  --config <path> path to the configuration file.
201
159
  --device <device> device to emulate, for example: "iPhone 15"
@@ -207,9 +165,7 @@ Playwright MCP server supports following arguments. They can be provided in the
207
165
  --isolated keep the browser profile in memory, do not save
208
166
  it to disk.
209
167
  --image-responses <mode> whether to send image responses to the client.
210
- Can be "allow", "omit", or "auto". Defaults to
211
- "auto", which sends images if the client can
212
- display them.
168
+ Can be "allow" or "omit", Defaults to "allow".
213
169
  --no-sandbox disable the sandbox for all process types that
214
170
  are normally sandboxed.
215
171
  --output-dir <path> path to the directory for output files.
@@ -218,6 +174,8 @@ Playwright MCP server supports following arguments. They can be provided in the
218
174
  example ".com,chromium.org,.domain.com"
219
175
  --proxy-server <proxy> specify proxy server, for example
220
176
  "http://myproxy:3128" or "socks5://myproxy:8080"
177
+ --save-session Whether to save the Playwright MCP session into
178
+ the output directory.
221
179
  --save-trace Whether to save the Playwright Trace of the
222
180
  session into the output directory.
223
181
  --storage-state <path> path to the storage state file for isolated
@@ -227,8 +185,6 @@ Playwright MCP server supports following arguments. They can be provided in the
227
185
  specified, a temporary directory will be created.
228
186
  --viewport-size <size> specify browser viewport size in pixels, for
229
187
  example "1280, 720"
230
- --vision Run server that uses screenshots (Aria snapshots
231
- are used by default)
232
188
  ```
233
189
 
234
190
  <!--- End of options generated section -->
@@ -329,21 +285,14 @@ npx @playwright/mcp@latest --config path/to/config.json
329
285
  host?: string; // Host to bind to (default: localhost)
330
286
  },
331
287
 
332
- // List of enabled capabilities
288
+ // List of additional capabilities
333
289
  capabilities?: Array<
334
- 'core' | // Core browser automation
335
290
  'tabs' | // Tab management
336
- 'pdf' | // PDF generation
337
- 'history' | // Browser history
338
- 'wait' | // Wait utilities
339
- 'files' | // File handling
340
291
  'install' | // Browser installation
341
- 'testing' // Testing
292
+ 'pdf' | // PDF generation
293
+ 'vision' | // Coordinate-based interactions
342
294
  >;
343
295
 
344
- // Enable vision mode (screenshots instead of accessibility snapshots)
345
- vision?: boolean;
346
-
347
296
  // Directory for output files
348
297
  outputDir?: string;
349
298
 
@@ -357,10 +306,10 @@ npx @playwright/mcp@latest --config path/to/config.json
357
306
  };
358
307
 
359
308
  /**
360
- * Whether to send image responses to the client. Can be "allow", "omit", or "auto".
361
- * Defaults to "auto", images are omitted for Cursor clients and sent for all other clients.
309
+ * Whether to send image responses to the client. Can be "allow" or "omit".
310
+ * Defaults to "allow".
362
311
  */
363
- imageResponses?: 'allow' | 'omit' | 'auto';
312
+ imageResponses?: 'allow' | 'omit';
364
313
  }
365
314
  ```
366
315
  </details>
@@ -368,19 +317,19 @@ npx @playwright/mcp@latest --config path/to/config.json
368
317
  ### Standalone MCP server
369
318
 
370
319
  When running headed browser on system w/o display or from worker processes of the IDEs,
371
- run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable SSE transport.
320
+ run the MCP server from environment with the DISPLAY and pass the `--port` flag to enable HTTP transport.
372
321
 
373
322
  ```bash
374
323
  npx @playwright/mcp@latest --port 8931
375
324
  ```
376
325
 
377
- And then in MCP client config, set the `url` to the SSE endpoint:
326
+ And then in MCP client config, set the `url` to the HTTP endpoint:
378
327
 
379
328
  ```js
380
329
  {
381
330
  "mcpServers": {
382
331
  "playwright": {
383
- "url": "http://localhost:8931/sse"
332
+ "url": "http://localhost:8931/mcp"
384
333
  }
385
334
  }
386
335
  }
@@ -433,42 +382,10 @@ http.createServer(async (req, res) => {
433
382
 
434
383
  ### Tools
435
384
 
436
- The tools are available in two modes:
437
-
438
- 1. **Snapshot Mode** (default): Uses accessibility snapshots for better performance and reliability
439
- 2. **Vision Mode**: Uses screenshots for visual-based interactions
440
-
441
- To use Vision Mode, add the `--vision` flag when starting the server:
442
-
443
- ```js
444
- {
445
- "mcpServers": {
446
- "playwright": {
447
- "command": "npx",
448
- "args": [
449
- "@playwright/mcp@latest",
450
- "--vision"
451
- ]
452
- }
453
- }
454
- }
455
- ```
456
-
457
- Vision Mode works best with the computer use models that are able to interact with elements using
458
- X Y coordinate space, based on the provided screenshot.
459
-
460
385
  <!--- Tools generated by update-readme.js -->
461
386
 
462
387
  <details>
463
- <summary><b>Interactions</b></summary>
464
-
465
- <!-- NOTE: This has been generated via update-readme.js -->
466
-
467
- - **browser_snapshot**
468
- - Title: Page snapshot
469
- - Description: Capture accessibility snapshot of the current page, this is better than screenshot
470
- - Parameters: None
471
- - Read-only: **true**
388
+ <summary><b>Core automation</b></summary>
472
389
 
473
390
  <!-- NOTE: This has been generated via update-readme.js -->
474
391
 
@@ -479,76 +396,50 @@ X Y coordinate space, based on the provided screenshot.
479
396
  - `element` (string): Human-readable element description used to obtain permission to interact with the element
480
397
  - `ref` (string): Exact target element reference from the page snapshot
481
398
  - `doubleClick` (boolean, optional): Whether to perform a double click instead of a single click
399
+ - `button` (string, optional): Button to click, defaults to left
482
400
  - Read-only: **false**
483
401
 
484
402
  <!-- NOTE: This has been generated via update-readme.js -->
485
403
 
486
- - **browser_drag**
487
- - Title: Drag mouse
488
- - Description: Perform drag and drop between two elements
489
- - Parameters:
490
- - `startElement` (string): Human-readable source element description used to obtain the permission to interact with the element
491
- - `startRef` (string): Exact source element reference from the page snapshot
492
- - `endElement` (string): Human-readable target element description used to obtain the permission to interact with the element
493
- - `endRef` (string): Exact target element reference from the page snapshot
494
- - Read-only: **false**
495
-
496
- <!-- NOTE: This has been generated via update-readme.js -->
497
-
498
- - **browser_hover**
499
- - Title: Hover mouse
500
- - Description: Hover over element on page
501
- - Parameters:
502
- - `element` (string): Human-readable element description used to obtain permission to interact with the element
503
- - `ref` (string): Exact target element reference from the page snapshot
404
+ - **browser_close**
405
+ - Title: Close browser
406
+ - Description: Close the page
407
+ - Parameters: None
504
408
  - Read-only: **true**
505
409
 
506
410
  <!-- NOTE: This has been generated via update-readme.js -->
507
411
 
508
- - **browser_type**
509
- - Title: Type text
510
- - Description: Type text into editable element
511
- - Parameters:
512
- - `element` (string): Human-readable element description used to obtain permission to interact with the element
513
- - `ref` (string): Exact target element reference from the page snapshot
514
- - `text` (string): Text to type into the element
515
- - `submit` (boolean, optional): Whether to submit entered text (press Enter after)
516
- - `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.
517
- - Read-only: **false**
412
+ - **browser_console_messages**
413
+ - Title: Get console messages
414
+ - Description: Returns all console messages
415
+ - Parameters: None
416
+ - Read-only: **true**
518
417
 
519
418
  <!-- NOTE: This has been generated via update-readme.js -->
520
419
 
521
- - **browser_select_option**
522
- - Title: Select option
523
- - Description: Select an option in a dropdown
420
+ - **browser_drag**
421
+ - Title: Drag mouse
422
+ - Description: Perform drag and drop between two elements
524
423
  - Parameters:
525
- - `element` (string): Human-readable element description used to obtain permission to interact with the element
526
- - `ref` (string): Exact target element reference from the page snapshot
527
- - `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.
424
+ - `startElement` (string): Human-readable source element description used to obtain the permission to interact with the element
425
+ - `startRef` (string): Exact source element reference from the page snapshot
426
+ - `endElement` (string): Human-readable target element description used to obtain the permission to interact with the element
427
+ - `endRef` (string): Exact target element reference from the page snapshot
528
428
  - Read-only: **false**
529
429
 
530
430
  <!-- NOTE: This has been generated via update-readme.js -->
531
431
 
532
- - **browser_press_key**
533
- - Title: Press a key
534
- - Description: Press a key on the keyboard
432
+ - **browser_evaluate**
433
+ - Title: Evaluate JavaScript
434
+ - Description: Evaluate JavaScript expression on page or element
535
435
  - Parameters:
536
- - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
436
+ - `function` (string): () => { /* code */ } or (element) => { /* code */ } when element is provided
437
+ - `element` (string, optional): Human-readable element description used to obtain permission to interact with the element
438
+ - `ref` (string, optional): Exact target element reference from the page snapshot
537
439
  - Read-only: **false**
538
440
 
539
441
  <!-- NOTE: This has been generated via update-readme.js -->
540
442
 
541
- - **browser_wait_for**
542
- - Title: Wait for
543
- - Description: Wait for text to appear or disappear or a specified time to pass
544
- - Parameters:
545
- - `time` (number, optional): The time to wait in seconds
546
- - `text` (string, optional): The text to wait for
547
- - `textGone` (string, optional): The text to wait for to disappear
548
- - Read-only: **true**
549
-
550
- <!-- NOTE: This has been generated via update-readme.js -->
551
-
552
443
  - **browser_file_upload**
553
444
  - Title: Upload files
554
445
  - Description: Upload one or multiple files
@@ -566,10 +457,15 @@ X Y coordinate space, based on the provided screenshot.
566
457
  - `promptText` (string, optional): The text of the prompt in case of a prompt dialog.
567
458
  - Read-only: **false**
568
459
 
569
- </details>
460
+ <!-- NOTE: This has been generated via update-readme.js -->
570
461
 
571
- <details>
572
- <summary><b>Navigation</b></summary>
462
+ - **browser_hover**
463
+ - Title: Hover mouse
464
+ - Description: Hover over element on page
465
+ - Parameters:
466
+ - `element` (string): Human-readable element description used to obtain permission to interact with the element
467
+ - `ref` (string): Exact target element reference from the page snapshot
468
+ - Read-only: **true**
573
469
 
574
470
  <!-- NOTE: This has been generated via update-readme.js -->
575
471
 
@@ -596,83 +492,102 @@ X Y coordinate space, based on the provided screenshot.
596
492
  - Parameters: None
597
493
  - Read-only: **true**
598
494
 
599
- </details>
495
+ <!-- NOTE: This has been generated via update-readme.js -->
600
496
 
601
- <details>
602
- <summary><b>Resources</b></summary>
497
+ - **browser_network_requests**
498
+ - Title: List network requests
499
+ - Description: Returns all network requests since loading the page
500
+ - Parameters: None
501
+ - Read-only: **true**
603
502
 
604
503
  <!-- NOTE: This has been generated via update-readme.js -->
605
504
 
606
- - **browser_take_screenshot**
607
- - Title: Take a screenshot
608
- - Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
505
+ - **browser_press_key**
506
+ - Title: Press a key
507
+ - Description: Press a key on the keyboard
609
508
  - Parameters:
610
- - `raw` (boolean, optional): Whether to return without compression (in PNG format). Default is false, which returns a JPEG image.
611
- - `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified.
612
- - `element` (string, optional): Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too.
613
- - `ref` (string, optional): Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.
614
- - Read-only: **true**
509
+ - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
510
+ - Read-only: **false**
615
511
 
616
512
  <!-- NOTE: This has been generated via update-readme.js -->
617
513
 
618
- - **browser_pdf_save**
619
- - Title: Save as PDF
620
- - Description: Save page as PDF
514
+ - **browser_resize**
515
+ - Title: Resize browser window
516
+ - Description: Resize the browser window
621
517
  - Parameters:
622
- - `filename` (string, optional): File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified.
518
+ - `width` (number): Width of the browser window
519
+ - `height` (number): Height of the browser window
623
520
  - Read-only: **true**
624
521
 
625
522
  <!-- NOTE: This has been generated via update-readme.js -->
626
523
 
627
- - **browser_network_requests**
628
- - Title: List network requests
629
- - Description: Returns all network requests since loading the page
630
- - Parameters: None
631
- - Read-only: **true**
524
+ - **browser_select_option**
525
+ - Title: Select option
526
+ - Description: Select an option in a dropdown
527
+ - Parameters:
528
+ - `element` (string): Human-readable element description used to obtain permission to interact with the element
529
+ - `ref` (string): Exact target element reference from the page snapshot
530
+ - `values` (array): Array of values to select in the dropdown. This can be a single value or multiple values.
531
+ - Read-only: **false**
632
532
 
633
533
  <!-- NOTE: This has been generated via update-readme.js -->
634
534
 
635
- - **browser_console_messages**
636
- - Title: Get console messages
637
- - Description: Returns all console messages
535
+ - **browser_snapshot**
536
+ - Title: Page snapshot
537
+ - Description: Capture accessibility snapshot of the current page, this is better than screenshot
638
538
  - Parameters: None
639
539
  - Read-only: **true**
640
540
 
641
- </details>
642
-
643
- <details>
644
- <summary><b>Utilities</b></summary>
645
-
646
541
  <!-- NOTE: This has been generated via update-readme.js -->
647
542
 
648
- - **browser_install**
649
- - Title: Install the browser specified in the config
650
- - Description: Install the browser specified in the config. Call this if you get an error about the browser not being installed.
651
- - Parameters: None
652
- - Read-only: **false**
543
+ - **browser_take_screenshot**
544
+ - Title: Take a screenshot
545
+ - Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
546
+ - Parameters:
547
+ - `raw` (boolean, optional): Whether to return without compression (in PNG format). Default is false, which returns a JPEG image.
548
+ - `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified.
549
+ - `element` (string, optional): Human-readable element description used to obtain permission to screenshot the element. If not provided, the screenshot will be taken of viewport. If element is provided, ref must be provided too.
550
+ - `ref` (string, optional): Exact target element reference from the page snapshot. If not provided, the screenshot will be taken of viewport. If ref is provided, element must be provided too.
551
+ - `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.
552
+ - Read-only: **true**
653
553
 
654
554
  <!-- NOTE: This has been generated via update-readme.js -->
655
555
 
656
- - **browser_close**
657
- - Title: Close browser
658
- - Description: Close the page
659
- - Parameters: None
660
- - Read-only: **true**
556
+ - **browser_type**
557
+ - Title: Type text
558
+ - Description: Type text into editable element
559
+ - Parameters:
560
+ - `element` (string): Human-readable element description used to obtain permission to interact with the element
561
+ - `ref` (string): Exact target element reference from the page snapshot
562
+ - `text` (string): Text to type into the element
563
+ - `submit` (boolean, optional): Whether to submit entered text (press Enter after)
564
+ - `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.
565
+ - Read-only: **false**
661
566
 
662
567
  <!-- NOTE: This has been generated via update-readme.js -->
663
568
 
664
- - **browser_resize**
665
- - Title: Resize browser window
666
- - Description: Resize the browser window
569
+ - **browser_wait_for**
570
+ - Title: Wait for
571
+ - Description: Wait for text to appear or disappear or a specified time to pass
667
572
  - Parameters:
668
- - `width` (number): Width of the browser window
669
- - `height` (number): Height of the browser window
573
+ - `time` (number, optional): The time to wait in seconds
574
+ - `text` (string, optional): The text to wait for
575
+ - `textGone` (string, optional): The text to wait for to disappear
670
576
  - Read-only: **true**
671
577
 
672
578
  </details>
673
579
 
674
580
  <details>
675
- <summary><b>Tabs</b></summary>
581
+ <summary><b>Tab management</b></summary>
582
+
583
+ <!-- NOTE: This has been generated via update-readme.js -->
584
+
585
+ - **browser_tab_close**
586
+ - Title: Close a tab
587
+ - Description: Close a tab
588
+ - Parameters:
589
+ - `index` (number, optional): The index of the tab to close. Closes current tab if not provided.
590
+ - Read-only: **false**
676
591
 
677
592
  <!-- NOTE: This has been generated via update-readme.js -->
678
593
 
@@ -700,60 +615,29 @@ X Y coordinate space, based on the provided screenshot.
700
615
  - `index` (number): The index of the tab to select
701
616
  - Read-only: **true**
702
617
 
703
- <!-- NOTE: This has been generated via update-readme.js -->
704
-
705
- - **browser_tab_close**
706
- - Title: Close a tab
707
- - Description: Close a tab
708
- - Parameters:
709
- - `index` (number, optional): The index of the tab to close. Closes current tab if not provided.
710
- - Read-only: **false**
711
-
712
618
  </details>
713
619
 
714
620
  <details>
715
- <summary><b>Testing</b></summary>
621
+ <summary><b>Browser installation</b></summary>
716
622
 
717
623
  <!-- NOTE: This has been generated via update-readme.js -->
718
624
 
719
- - **browser_generate_playwright_test**
720
- - Title: Generate a Playwright test
721
- - Description: Generate a Playwright test for given scenario
722
- - Parameters:
723
- - `name` (string): The name of the test
724
- - `description` (string): The description of the test
725
- - `steps` (array): The steps of the test
726
- - Read-only: **true**
625
+ - **browser_install**
626
+ - Title: Install the browser specified in the config
627
+ - Description: Install the browser specified in the config. Call this if you get an error about the browser not being installed.
628
+ - Parameters: None
629
+ - Read-only: **false**
727
630
 
728
631
  </details>
729
632
 
730
633
  <details>
731
- <summary><b>Vision mode</b></summary>
732
-
733
- <!-- NOTE: This has been generated via update-readme.js -->
734
-
735
- - **browser_screen_capture**
736
- - Title: Take a screenshot
737
- - Description: Take a screenshot of the current page
738
- - Parameters: None
739
- - Read-only: **true**
740
-
741
- <!-- NOTE: This has been generated via update-readme.js -->
742
-
743
- - **browser_screen_move_mouse**
744
- - Title: Move mouse
745
- - Description: Move mouse to a given position
746
- - Parameters:
747
- - `element` (string): Human-readable element description used to obtain permission to interact with the element
748
- - `x` (number): X coordinate
749
- - `y` (number): Y coordinate
750
- - Read-only: **true**
634
+ <summary><b>Coordinate-based (opt-in via --caps=vision)</b></summary>
751
635
 
752
636
  <!-- NOTE: This has been generated via update-readme.js -->
753
637
 
754
- - **browser_screen_click**
638
+ - **browser_mouse_click_xy**
755
639
  - Title: Click
756
- - Description: Click left mouse button
640
+ - Description: Click left mouse button at a given position
757
641
  - Parameters:
758
642
  - `element` (string): Human-readable element description used to obtain permission to interact with the element
759
643
  - `x` (number): X coordinate
@@ -762,9 +646,9 @@ X Y coordinate space, based on the provided screenshot.
762
646
 
763
647
  <!-- NOTE: This has been generated via update-readme.js -->
764
648
 
765
- - **browser_screen_drag**
649
+ - **browser_mouse_drag_xy**
766
650
  - Title: Drag mouse
767
- - Description: Drag left mouse button
651
+ - Description: Drag left mouse button to a given position
768
652
  - Parameters:
769
653
  - `element` (string): Human-readable element description used to obtain permission to interact with the element
770
654
  - `startX` (number): Start X coordinate
@@ -775,52 +659,28 @@ X Y coordinate space, based on the provided screenshot.
775
659
 
776
660
  <!-- NOTE: This has been generated via update-readme.js -->
777
661
 
778
- - **browser_screen_type**
779
- - Title: Type text
780
- - Description: Type text
781
- - Parameters:
782
- - `text` (string): Text to type into the element
783
- - `submit` (boolean, optional): Whether to submit entered text (press Enter after)
784
- - Read-only: **false**
785
-
786
- <!-- NOTE: This has been generated via update-readme.js -->
787
-
788
- - **browser_press_key**
789
- - Title: Press a key
790
- - Description: Press a key on the keyboard
791
- - Parameters:
792
- - `key` (string): Name of the key to press or a character to generate, such as `ArrowLeft` or `a`
793
- - Read-only: **false**
794
-
795
- <!-- NOTE: This has been generated via update-readme.js -->
796
-
797
- - **browser_wait_for**
798
- - Title: Wait for
799
- - Description: Wait for text to appear or disappear or a specified time to pass
662
+ - **browser_mouse_move_xy**
663
+ - Title: Move mouse
664
+ - Description: Move mouse to a given position
800
665
  - Parameters:
801
- - `time` (number, optional): The time to wait in seconds
802
- - `text` (string, optional): The text to wait for
803
- - `textGone` (string, optional): The text to wait for to disappear
666
+ - `element` (string): Human-readable element description used to obtain permission to interact with the element
667
+ - `x` (number): X coordinate
668
+ - `y` (number): Y coordinate
804
669
  - Read-only: **true**
805
670
 
806
- <!-- NOTE: This has been generated via update-readme.js -->
671
+ </details>
807
672
 
808
- - **browser_file_upload**
809
- - Title: Upload files
810
- - Description: Upload one or multiple files
811
- - Parameters:
812
- - `paths` (array): The absolute paths to the files to upload. Can be a single file or multiple files.
813
- - Read-only: **false**
673
+ <details>
674
+ <summary><b>PDF generation (opt-in via --caps=pdf)</b></summary>
814
675
 
815
676
  <!-- NOTE: This has been generated via update-readme.js -->
816
677
 
817
- - **browser_handle_dialog**
818
- - Title: Handle a dialog
819
- - Description: Handle a dialog
678
+ - **browser_pdf_save**
679
+ - Title: Save as PDF
680
+ - Description: Save page as PDF
820
681
  - Parameters:
821
- - `accept` (boolean): Whether to accept the dialog.
822
- - `promptText` (string, optional): The text of the prompt in case of a prompt dialog.
823
- - Read-only: **false**
682
+ - `filename` (string, optional): File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified.
683
+ - Read-only: **true**
824
684
 
825
685
  </details>
826
686