mirror of
				https://github.com/microsoft/playwright-mcp.git
				synced 2025-10-12 00:25:14 +03:00 
			
		
		
		
	chore: roll Playwright to latest (#1050)
This commit is contained in:
		
							
								
								
									
										123
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										123
									
								
								README.md
									
									
									
									
									
								
							| @@ -180,65 +180,76 @@ Playwright MCP server supports following arguments. They can be provided in the | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| > npx @playwright/mcp@latest --help | > npx @playwright/mcp@latest --help | ||||||
|   --allowed-origins <origins>     semicolon-separated list of origins to allow |   --allowed-origins <origins>           semicolon-separated list of origins to | ||||||
|                                   the browser to request. Default is to allow |                                         allow the browser to request. Default is | ||||||
|                                   all. |                                         to allow all. | ||||||
|   --blocked-origins <origins>     semicolon-separated list of origins to block |   --blocked-origins <origins>           semicolon-separated list of origins to | ||||||
|                                   the browser from requesting. Blocklist is |                                         block the browser from requesting. | ||||||
|                                   evaluated before allowlist. If used without |                                         Blocklist is evaluated before allowlist. | ||||||
|                                   the allowlist, requests not matching the |                                         If used without the allowlist, requests | ||||||
|                                   blocklist are still allowed. |                                         not matching the blocklist are still | ||||||
|  |                                         allowed. | ||||||
|   --block-service-workers               block service workers |   --block-service-workers               block service workers | ||||||
|   --browser <browser>             browser or chrome channel to use, possible |   --browser <browser>                   browser or chrome channel to use, | ||||||
|                                   values: chrome, firefox, webkit, msedge. |                                         possible values: chrome, firefox, | ||||||
|  |                                         webkit, msedge. | ||||||
|   --caps <caps>                         comma-separated list of additional |   --caps <caps>                         comma-separated list of additional | ||||||
|                                         capabilities to enable, possible values: |                                         capabilities to enable, possible values: | ||||||
|                                         vision, pdf. |                                         vision, pdf. | ||||||
|   --cdp-endpoint <endpoint>             CDP endpoint to connect to. |   --cdp-endpoint <endpoint>             CDP endpoint to connect to. | ||||||
|   --cdp-header <headers...>       CDP headers to send with the connect request, |   --cdp-header <headers...>             CDP headers to send with the connect | ||||||
|                                   multiple can be specified. |                                         request, multiple can be specified. | ||||||
|   --config <path>                       path to the configuration file. |   --config <path>                       path to the configuration file. | ||||||
|   --device <device>               device to emulate, for example: "iPhone 15" |   --device <device>                     device to emulate, for example: "iPhone | ||||||
|  |                                         15" | ||||||
|   --executable-path <path>              path to the browser executable. |   --executable-path <path>              path to the browser executable. | ||||||
|   --extension                           Connect to a running browser instance |   --extension                           Connect to a running browser instance | ||||||
|                                   (Edge/Chrome only). Requires the "Playwright |                                         (Edge/Chrome only). Requires the | ||||||
|                                   MCP Bridge" browser extension to be installed. |                                         "Playwright MCP Bridge" browser | ||||||
|  |                                         extension to be installed. | ||||||
|  |   --grant-permissions <permissions...>  List of permissions to grant to the | ||||||
|  |                                         browser context, for example | ||||||
|  |                                         "geolocation", "clipboard-read", | ||||||
|  |                                         "clipboard-write". | ||||||
|   --headless                            run browser in headless mode, headed by |   --headless                            run browser in headless mode, headed by | ||||||
|                                         default |                                         default | ||||||
|   --host <host>                   host to bind server to. Default is localhost. |   --host <host>                         host to bind server to. Default is | ||||||
|                                   Use 0.0.0.0 to bind to all interfaces. |                                         localhost. Use 0.0.0.0 to bind to all | ||||||
|  |                                         interfaces. | ||||||
|   --ignore-https-errors                 ignore https errors |   --ignore-https-errors                 ignore https errors | ||||||
|   --isolated                      keep the browser profile in memory, do not |   --isolated                            keep the browser profile in memory, do | ||||||
|                                   save it to disk. |                                         not save it to disk. | ||||||
|   --image-responses <mode>        whether to send image responses to the client. |   --image-responses <mode>              whether to send image responses to the | ||||||
|                                   Can be "allow" or "omit", Defaults to "allow". |                                         client. Can be "allow" or "omit", | ||||||
|   --no-sandbox                    disable the sandbox for all process types that |                                         Defaults to "allow". | ||||||
|                                   are normally sandboxed. |   --no-sandbox                          disable the sandbox for all process | ||||||
|  |                                         types that are normally sandboxed. | ||||||
|   --output-dir <path>                   path to the directory for output files. |   --output-dir <path>                   path to the directory for output files. | ||||||
|   --port <port>                         port to listen on for SSE transport. |   --port <port>                         port to listen on for SSE transport. | ||||||
|   --proxy-bypass <bypass>         comma-separated domains to bypass proxy, for |   --proxy-bypass <bypass>               comma-separated domains to bypass proxy, | ||||||
|                                   example ".com,chromium.org,.domain.com" |                                         for example | ||||||
|  |                                         ".com,chromium.org,.domain.com" | ||||||
|   --proxy-server <proxy>                specify proxy server, for example |   --proxy-server <proxy>                specify proxy server, for example | ||||||
|                                         "http://myproxy:3128" or |                                         "http://myproxy:3128" or | ||||||
|                                         "socks5://myproxy:8080" |                                         "socks5://myproxy:8080" | ||||||
|   --save-session                  Whether to save the Playwright MCP session |   --save-session                        Whether to save the Playwright MCP | ||||||
|                                   into the output directory. |  | ||||||
|   --save-trace                    Whether to save the Playwright Trace of the |  | ||||||
|                                         session into the output directory. |                                         session into the output directory. | ||||||
|  |   --save-trace                          Whether to save the Playwright Trace of | ||||||
|  |                                         the session into the output directory. | ||||||
|   --secrets <path>                      path to a file containing secrets in the |   --secrets <path>                      path to a file containing secrets in the | ||||||
|                                         dotenv format |                                         dotenv format | ||||||
|   --storage-state <path>          path to the storage state file for isolated |   --storage-state <path>                path to the storage state file for | ||||||
|                                   sessions. |                                         isolated sessions. | ||||||
|   --timeout-action <timeout>            specify action timeout in milliseconds, |   --timeout-action <timeout>            specify action timeout in milliseconds, | ||||||
|                                         defaults to 5000ms |                                         defaults to 5000ms | ||||||
|   --timeout-navigation <timeout>  specify navigation timeout in milliseconds, |   --timeout-navigation <timeout>        specify navigation timeout in | ||||||
|                                   defaults to 60000ms |                                         milliseconds, defaults to 60000ms | ||||||
|   --user-agent <ua string>              specify user agent string |   --user-agent <ua string>              specify user agent string | ||||||
|   --user-data-dir <path>                path to the user data directory. If not |   --user-data-dir <path>                path to the user data directory. If not | ||||||
|                                         specified, a temporary directory will be |                                         specified, a temporary directory will be | ||||||
|                                         created. |                                         created. | ||||||
|   --viewport-size <size>          specify browser viewport size in pixels, for |   --viewport-size <size>                specify browser viewport size in pixels, | ||||||
|                                   example "1280, 720" |                                         for example "1280, 720" | ||||||
| ``` | ``` | ||||||
|  |  | ||||||
| <!--- End of options generated section --> | <!--- End of options generated section --> | ||||||
| @@ -503,7 +514,7 @@ http.createServer(async (req, res) => { | |||||||
|   - Title: Upload files |   - Title: Upload files | ||||||
|   - Description: Upload one or multiple files |   - Description: Upload one or multiple files | ||||||
|   - Parameters: |   - Parameters: | ||||||
|     - `paths` (array): The absolute paths to the files to upload. Can be a single file or multiple files. |     - `paths` (array, optional): The absolute paths to the files to upload. Can be single file or multiple files. If omitted, file chooser is cancelled. | ||||||
|   - Read-only: **false** |   - Read-only: **false** | ||||||
|  |  | ||||||
| <!-- NOTE: This has been generated via update-readme.js --> | <!-- NOTE: This has been generated via update-readme.js --> | ||||||
| @@ -722,48 +733,6 @@ http.createServer(async (req, res) => { | |||||||
| <details> | <details> | ||||||
| <summary><b>Verify (opt-in via --caps=verify)</b></summary> | <summary><b>Verify (opt-in via --caps=verify)</b></summary> | ||||||
|  |  | ||||||
| <!-- NOTE: This has been generated via update-readme.js --> |  | ||||||
|  |  | ||||||
| - **browser_verify_element_visible** |  | ||||||
|   - Title: Verify element visible |  | ||||||
|   - Description: Verify element is visible on the page |  | ||||||
|   - Parameters: |  | ||||||
|     - `role` (string): ROLE of the element. Can be found in the snapshot like this: `- {ROLE} "Accessible Name":` |  | ||||||
|     - `accessibleName` (string): ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role "{ACCESSIBLE_NAME}"` |  | ||||||
|   - Read-only: **true** |  | ||||||
|  |  | ||||||
| <!-- NOTE: This has been generated via update-readme.js --> |  | ||||||
|  |  | ||||||
| - **browser_verify_list_visible** |  | ||||||
|   - Title: Verify list visible |  | ||||||
|   - Description: Verify list is visible on the page |  | ||||||
|   - Parameters: |  | ||||||
|     - `element` (string): Human-readable list description |  | ||||||
|     - `ref` (string): Exact target element reference that points to the list |  | ||||||
|     - `items` (array): Items to verify |  | ||||||
|   - Read-only: **true** |  | ||||||
|  |  | ||||||
| <!-- NOTE: This has been generated via update-readme.js --> |  | ||||||
|  |  | ||||||
| - **browser_verify_text_visible** |  | ||||||
|   - Title: Verify text visible |  | ||||||
|   - Description: Verify text is visible on the page. Prefer browser_verify_element_visible if possible. |  | ||||||
|   - Parameters: |  | ||||||
|     - `text` (string): TEXT to verify. Can be found in the snapshot like this: `- role "Accessible Name": {TEXT}` or like this: `- text: {TEXT}` |  | ||||||
|   - Read-only: **true** |  | ||||||
|  |  | ||||||
| <!-- NOTE: This has been generated via update-readme.js --> |  | ||||||
|  |  | ||||||
| - **browser_verify_value** |  | ||||||
|   - Title: Verify value |  | ||||||
|   - Description: Verify element value |  | ||||||
|   - Parameters: |  | ||||||
|     - `type` (string): Type of the element |  | ||||||
|     - `element` (string): Human-readable element description |  | ||||||
|     - `ref` (string): Exact target element reference that points to the element |  | ||||||
|     - `value` (string): Value to verify. For checkbox, use "true" or "false". |  | ||||||
|   - Read-only: **true** |  | ||||||
|  |  | ||||||
| </details> | </details> | ||||||
|  |  | ||||||
| <details> | <details> | ||||||
|   | |||||||
							
								
								
									
										28
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										28
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -9,15 +9,15 @@ | |||||||
|       "version": "0.0.37", |       "version": "0.0.37", | ||||||
|       "license": "Apache-2.0", |       "license": "Apache-2.0", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "playwright": "1.56.0-alpha-2025-09-10", |         "playwright": "1.56.0-alpha-2025-09-17", | ||||||
|         "playwright-core": "1.56.0-alpha-2025-09-10" |         "playwright-core": "1.56.0-alpha-2025-09-17" | ||||||
|       }, |       }, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "mcp-server-playwright": "cli.js" |         "mcp-server-playwright": "cli.js" | ||||||
|       }, |       }, | ||||||
|       "devDependencies": { |       "devDependencies": { | ||||||
|         "@modelcontextprotocol/sdk": "^1.17.5", |         "@modelcontextprotocol/sdk": "^1.17.5", | ||||||
|         "@playwright/test": "1.56.0-alpha-2025-09-10", |         "@playwright/test": "1.56.0-alpha-2025-09-17", | ||||||
|         "@types/node": "^24.3.0", |         "@types/node": "^24.3.0", | ||||||
|         "zod-to-json-schema": "^3.24.6" |         "zod-to-json-schema": "^3.24.6" | ||||||
|       }, |       }, | ||||||
| @@ -50,13 +50,13 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/@playwright/test": { |     "node_modules/@playwright/test": { | ||||||
|       "version": "1.56.0-alpha-2025-09-10", |       "version": "1.56.0-alpha-2025-09-17", | ||||||
|       "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.0-alpha-2025-09-10.tgz", |       "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.0-alpha-2025-09-17.tgz", | ||||||
|       "integrity": "sha512-A23DUBZqe4332NnYroG8OQCTku9lsGDdg64Pz83r26Tt04/nsR562tNlu74HrmfPNt9W88Px5Gev/Wk5f2wvnQ==", |       "integrity": "sha512-AzA5lm7escacg1nrZK5E6HPaPD9adZOfk/yJ9ZYidpuyxA6L9CnP5UoR2ndOj4FyYitEik+y38j4LY7lM04FTg==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "license": "Apache-2.0", |       "license": "Apache-2.0", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "playwright": "1.56.0-alpha-2025-09-10" |         "playwright": "1.56.0-alpha-2025-09-17" | ||||||
|       }, |       }, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "playwright": "cli.js" |         "playwright": "cli.js" | ||||||
| @@ -825,12 +825,12 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/playwright": { |     "node_modules/playwright": { | ||||||
|       "version": "1.56.0-alpha-2025-09-10", |       "version": "1.56.0-alpha-2025-09-17", | ||||||
|       "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0-alpha-2025-09-10.tgz", |       "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0-alpha-2025-09-17.tgz", | ||||||
|       "integrity": "sha512-7oGiB+gujhVGhnNcG4Eel2N/gJ6XGF836a/vbgF9ZkyhxTHnibbG3H2Q/hWh8slAVtp7nEbobLvmZuUrYBj5xg==", |       "integrity": "sha512-3EvJPE+iMxHo9pm5vgcBRlfxHWw4qNxJBLqPiNQIJiigYBd4TF/1h5Zqk/EJd9VB4eI60t+N8W5jXQSlu3D18w==", | ||||||
|       "license": "Apache-2.0", |       "license": "Apache-2.0", | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "playwright-core": "1.56.0-alpha-2025-09-10" |         "playwright-core": "1.56.0-alpha-2025-09-17" | ||||||
|       }, |       }, | ||||||
|       "bin": { |       "bin": { | ||||||
|         "playwright": "cli.js" |         "playwright": "cli.js" | ||||||
| @@ -843,9 +843,9 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "node_modules/playwright-core": { |     "node_modules/playwright-core": { | ||||||
|       "version": "1.56.0-alpha-2025-09-10", |       "version": "1.56.0-alpha-2025-09-17", | ||||||
|       "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0-alpha-2025-09-10.tgz", |       "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0-alpha-2025-09-17.tgz", | ||||||
|       "integrity": "sha512-ToRfUbRUMOyMu6UsYbfNHl4QuSP5DpY8LWBRQ0rhWKpnIEREgQsvS7BOoySxssTnjm4Js0PpGxy98ng/SaZGBA==", |       "integrity": "sha512-5Mk0sZSbEbYKk9seSO7Rbn4k2XkcQqnKp00nld4enDdxjoyLsBeGghvWAxGmK0Es+WFaBLJp0GOt/gKtj0NW4A==", | ||||||
|       "license": "Apache-2.0", |       "license": "Apache-2.0", | ||||||
|       "bin": { |       "bin": { | ||||||
|         "playwright-core": "cli.js" |         "playwright-core": "cli.js" | ||||||
|   | |||||||
| @@ -33,15 +33,15 @@ | |||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   "dependencies": { |   "dependencies": { | ||||||
|     "playwright": "1.56.0-alpha-2025-09-10", |     "playwright": "1.56.0-alpha-2025-09-17", | ||||||
|     "playwright-core": "1.56.0-alpha-2025-09-10" |     "playwright-core": "1.56.0-alpha-2025-09-17" | ||||||
|   }, |   }, | ||||||
|   "bin": { |   "bin": { | ||||||
|     "mcp-server-playwright": "cli.js" |     "mcp-server-playwright": "cli.js" | ||||||
|   }, |   }, | ||||||
|   "devDependencies": { |   "devDependencies": { | ||||||
|     "@modelcontextprotocol/sdk": "^1.17.5", |     "@modelcontextprotocol/sdk": "^1.17.5", | ||||||
|     "@playwright/test": "1.56.0-alpha-2025-09-10", |     "@playwright/test": "1.56.0-alpha-2025-09-17", | ||||||
|     "@types/node": "^24.3.0", |     "@types/node": "^24.3.0", | ||||||
|     "zod-to-json-schema": "^3.24.6" |     "zod-to-json-schema": "^3.24.6" | ||||||
|   } |   } | ||||||
|   | |||||||
| @@ -21,7 +21,7 @@ const path = require('path') | |||||||
| const { zodToJsonSchema } = require('zod-to-json-schema') | const { zodToJsonSchema } = require('zod-to-json-schema') | ||||||
| const { execSync } = require('child_process'); | const { execSync } = require('child_process'); | ||||||
|  |  | ||||||
| const { allTools } = require('playwright/lib/mcp/browser/tools'); | const { browserTools } = require('playwright/lib/mcp/browser/tools'); | ||||||
|  |  | ||||||
| const capabilities = { | const capabilities = { | ||||||
|   'core': 'Core automation', |   'core': 'Core automation', | ||||||
| @@ -33,7 +33,7 @@ const capabilities = { | |||||||
|   'tracing': 'Tracing (opt-in via --caps=tracing)', |   'tracing': 'Tracing (opt-in via --caps=tracing)', | ||||||
| }; | }; | ||||||
|  |  | ||||||
| const toolsByCapability = Object.fromEntries(Object.entries(capabilities).map(([capability, title]) => [title, allTools.filter(tool => tool.capability === capability).sort((a, b) => a.schema.name.localeCompare(b.schema.name))])); | const toolsByCapability = Object.fromEntries(Object.entries(capabilities).map(([capability, title]) => [title, browserTools.filter(tool => tool.capability === capability).sort((a, b) => a.schema.name.localeCompare(b.schema.name))])); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * @param {any} tool |  * @param {any} tool | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Pavel Feldman
					Pavel Feldman