Compare commits

...

23 Commits

Author SHA1 Message Date
Pavel Feldman
8cc557d677 chore: mark v0.0.46 (#1188) 2025-11-07 13:41:19 -08:00
Ben Tossell
15d382b940 docs: add Factory installation instructions (#1184) 2025-11-04 08:30:14 -08:00
Pavel Feldman
e72701b21c chore: mark v0.0.45 (#1179) 2025-10-31 14:05:32 -07:00
Dmitry Gozman
8ee8445342 chore: roll to 1.57.0-alpha-1761929702000 (#1178) 2025-10-31 20:16:50 +00:00
Raduan A.
ac6e678135 docs: add codex CLI command to README (#1168) 2025-10-29 17:46:42 -07:00
Yury Semikhatsky
b945ace746 chore: mark v0.0.44 (#1165) 2025-10-24 12:33:27 -07:00
Yury Semikhatsky
b3dce4097e chore: roll 1.57.0-alpha-2025-10-24 (#1164) 2025-10-24 11:29:05 -07:00
Doan Bac Tam
67ed859c2a docs: update with Kiro IDE MCP Servers details (#1143)
Added Kiro IDE MCP Servers documentation with example configuration.
2025-10-21 18:40:09 -07:00
Pavel Feldman
7da5e7273c chore: add docker run for testing purposes (#1153) 2025-10-21 18:39:27 -07:00
dependabot[bot]
fe59d4b35f chore(deps-dev): bump vite from 5.4.20 to 5.4.21 in /extension (#1156) 2025-10-21 08:06:41 -07:00
Pavel Feldman
a03ec7ad56 chore: mark v0.0.43 (#1151) 2025-10-16 13:08:38 -07:00
Yury Semikhatsky
ad14743235 chore: roll 1.57.0-alpha-2025-10-16 (#1150) 2025-10-16 12:55:34 -07:00
Pavel Feldman
a9ffccd40f docs: fix the testing capability docs (#1149) 2025-10-16 11:59:45 -07:00
Yury Semikhatsky
b4e016a0b8 chore: mark v0.0.42 (#1125) 2025-10-09 14:57:41 -07:00
Yury Semikhatsky
e17bf17dff chore: roll 1.57.0-alpha-2025-10-09 (#1123) 2025-10-09 13:32:16 -07:00
Isuru-F
7ee5c87a4b docs: add Amp setup instructions to README (#1105) 2025-10-03 14:00:36 -07:00
TheLazyIndianTechie
2817952d0d docs: updated Warp MCP documentation (#1104) 2025-10-03 13:59:34 -07:00
Kim Hallberg
fb900a8827 docs: add instructions for Warp (#1103) 2025-10-02 13:05:41 -07:00
Yury Semikhatsky
29e532687c chore: mark v0.0.41 (#1099) 2025-10-01 15:54:05 -07:00
Yury Semikhatsky
d149b89889 chore: roll to 1.56.0-alpha-2025-10-01 (#1098) 2025-10-01 14:55:17 -07:00
Pavel Feldman
1caecd00c7 Revert "chore: include cwd in a vscode config" (#1095)
Reverts microsoft/playwright-mcp#1085
2025-09-30 13:30:06 -07:00
Pavel Feldman
9657b58e17 chore: include cwd in a vscode config (#1085) 2025-09-26 17:35:03 -07:00
zhu733756
8dfea1c67f docs: running the Playwright-MCP server in docker (#1074) 2025-09-25 08:23:28 -07:00
9 changed files with 211 additions and 44 deletions

178
README.md
View File

@@ -38,6 +38,31 @@ First, install the Playwright MCP server with your client.
[<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) [<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522playwright%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540playwright%252Fmcp%2540latest%2522%255D%257D)
<details>
<summary>Amp</summary>
Add via the Amp VS Code extension settings screen or by updating your settings.json file:
```json
"amp.mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
```
**Amp CLI Setup:**
Add via the `amp mcp add`command below
```bash
amp mcp add playwright -- npx @playwright/mcp@latest
```
</details>
<details> <details>
<summary>Claude Code</summary> <summary>Claude Code</summary>
@@ -59,7 +84,13 @@ Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user),
<details> <details>
<summary>Codex</summary> <summary>Codex</summary>
Create or edit the configuration file `~/.codex/config.toml` and add: Use the Codex CLI to add the Playwright MCP server:
```bash
codex mcp add playwright npx "@playwright/mcp@latest"
```
Alternatively, create or edit the configuration file `~/.codex/config.toml` and add:
```toml ```toml
[mcp_servers.playwright] [mcp_servers.playwright]
@@ -84,6 +115,21 @@ Go to `Cursor Settings` -> `MCP` -> `Add new MCP Server`. Name to your liking, u
</details> </details>
<details>
<summary>Factory</summary>
Use the Factory CLI to add the Playwright MCP server:
```bash
droid mcp add playwright "npx @playwright/mcp@latest"
```
Alternatively, type `/mcp` within Factory droid to open an interactive UI for managing MCP servers.
For more information, see the [Factory MCP documentation](https://docs.factory.ai/cli/configuration/mcp).
</details>
<details> <details>
<summary>Gemini CLI</summary> <summary>Gemini CLI</summary>
@@ -103,6 +149,25 @@ Follow the MCP install [guide](https://github.com/google-gemini/gemini-cli/blob/
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". 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".
</details> </details>
<details>
<summary>Kiro</summary>
Follow the MCP Servers [documentation](https://kiro.dev/docs/mcp/). For example in `.kiro/settings/mcp.json`:
```json
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
```
</details>
<details> <details>
<summary>LM Studio</summary> <summary>LM Studio</summary>
@@ -165,6 +230,27 @@ code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@la
After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code. After installation, the Playwright MCP server will be available for use with your GitHub Copilot agent in VS Code.
</details> </details>
<details>
<summary>Warp</summary>
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.
Alternatively, use the slash command `/add-mcp` in the Warp prompt and paste the standard config from above:
```js
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
```
</details>
<details> <details>
<summary>Windsurf</summary> <summary>Windsurf</summary>
@@ -183,7 +269,7 @@ Playwright MCP server supports following arguments. They can be provided in the
--allowed-hosts <hosts...> comma-separated list of hosts this --allowed-hosts <hosts...> comma-separated list of hosts this
server is allowed to serve from. server is allowed to serve from.
Defaults to the host the server is bound Defaults to the host the server is bound
to. to. Pass '*' to disable the host check.
--allowed-origins <origins> semicolon-separated list of origins to --allowed-origins <origins> semicolon-separated list of origins to
allow the browser to request. Default is allow the browser to request. Default is
to allow all. to allow all.
@@ -254,6 +340,8 @@ Playwright MCP server supports following arguments. They can be provided in the
all connected HTTP clients. all connected HTTP clients.
--storage-state <path> path to the storage state file for --storage-state <path> path to the storage state file for
isolated sessions. isolated sessions.
--test-id-attribute <attribute> specify the attribute to use for test
ids, defaults to "data-testid"
--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 --timeout-navigation <timeout> specify navigation timeout in
@@ -434,6 +522,19 @@ And then in MCP client config, set the `url` to the HTTP endpoint:
} }
``` ```
Or If you prefer to run the container as a long-lived service instead of letting the MCP client spawn it, use:
```
docker run -d -i --rm --init --pull=always \
--entrypoint node \
--name playwright \
-p 8931:8931 \
mcr.microsoft.com/playwright/mcp \
cli.js --headless --browser chromium --no-sandbox --port 8931
```
The server will listen on host port **8931** and can be reached by any MCP client.
You can build the Docker image yourself. You can build the Docker image yourself.
``` ```
@@ -489,14 +590,15 @@ http.createServer(async (req, res) => {
- Title: Close browser - Title: Close browser
- Description: Close the page - Description: Close the page
- Parameters: None - Parameters: None
- Read-only: **true** - Read-only: **false**
<!-- NOTE: This has been generated via update-readme.js --> <!-- NOTE: This has been generated via update-readme.js -->
- **browser_console_messages** - **browser_console_messages**
- Title: Get console messages - Title: Get console messages
- Description: Returns all console messages - Description: Returns all console messages
- Parameters: None - Parameters:
- `onlyErrors` (boolean, optional): Only return error messages
- Read-only: **true** - Read-only: **true**
<!-- NOTE: This has been generated via update-readme.js --> <!-- NOTE: This has been generated via update-readme.js -->
@@ -558,7 +660,7 @@ http.createServer(async (req, res) => {
- Parameters: - Parameters:
- `element` (string): Human-readable element description used to obtain permission to interact with the element - `element` (string): Human-readable element description used to obtain permission to interact with the element
- `ref` (string): Exact target element reference from the page snapshot - `ref` (string): Exact target element reference from the page snapshot
- Read-only: **true** - Read-only: **false**
<!-- NOTE: This has been generated via update-readme.js --> <!-- NOTE: This has been generated via update-readme.js -->
@@ -575,7 +677,7 @@ http.createServer(async (req, res) => {
- Title: Go back - Title: Go back
- Description: Go back to the previous page - Description: Go back to the previous page
- Parameters: None - Parameters: None
- Read-only: **true** - Read-only: **false**
<!-- NOTE: This has been generated via update-readme.js --> <!-- NOTE: This has been generated via update-readme.js -->
@@ -602,7 +704,7 @@ http.createServer(async (req, res) => {
- Parameters: - Parameters:
- `width` (number): Width of the browser window - `width` (number): Width of the browser window
- `height` (number): Height of the browser window - `height` (number): Height of the browser window
- Read-only: **true** - Read-only: **false**
<!-- NOTE: This has been generated via update-readme.js --> <!-- NOTE: This has been generated via update-readme.js -->
@@ -630,7 +732,7 @@ http.createServer(async (req, res) => {
- Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions. - Description: Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
- Parameters: - Parameters:
- `type` (string, optional): Image format for the screenshot. Default is png. - `type` (string, optional): Image format for the screenshot. Default is png.
- `filename` (string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg}` if not specified. - `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.
- `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. - `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.
- `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. - `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.
- `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. - `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.
@@ -658,7 +760,7 @@ http.createServer(async (req, res) => {
- `time` (number, optional): The time to wait in seconds - `time` (number, optional): The time to wait in seconds
- `text` (string, optional): The text to wait for - `text` (string, optional): The text to wait for
- `textGone` (string, optional): The text to wait for to disappear - `textGone` (string, optional): The text to wait for to disappear
- Read-only: **true** - Read-only: **false**
</details> </details>
@@ -726,7 +828,7 @@ http.createServer(async (req, res) => {
- `element` (string): Human-readable element description used to obtain permission to interact with the element - `element` (string): Human-readable element description used to obtain permission to interact with the element
- `x` (number): X coordinate - `x` (number): X coordinate
- `y` (number): Y coordinate - `y` (number): Y coordinate
- Read-only: **true** - Read-only: **false**
</details> </details>
@@ -739,13 +841,65 @@ http.createServer(async (req, res) => {
- Title: Save as PDF - Title: Save as PDF
- Description: Save page as PDF - Description: Save page as PDF
- Parameters: - Parameters:
- `filename` (string, optional): File name to save the pdf to. Defaults to `page-{timestamp}.pdf` if not specified. - `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.
- Read-only: **true** - Read-only: **true**
</details> </details>
<details> <details>
<summary><b>Verify (opt-in via --caps=verify)</b></summary> <summary><b>Test assertions (opt-in via --caps=testing)</b></summary>
<!-- NOTE: This has been generated via update-readme.js -->
- **browser_generate_locator**
- Title: Create locator for element
- Description: Generate locator for the given element to use in tests
- Parameters:
- `element` (string): Human-readable element description used to obtain permission to interact with the element
- `ref` (string): Exact target element reference from the page snapshot
- Read-only: **true**
<!-- 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: **false**
<!-- 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: **false**
<!-- 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: **false**
<!-- 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: **false**
</details> </details>

5
config.d.ts vendored
View File

@@ -149,6 +149,11 @@ export type Config = {
blockedOrigins?: string[]; blockedOrigins?: string[];
}; };
/**
* Specify the attribute to use for test ids, defaults to "data-testid".
*/
testIdAttribute?: string;
timeouts?: { timeouts?: {
/* /*
* Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms. * Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.

View File

@@ -1,7 +1,7 @@
{ {
"manifest_version": 3, "manifest_version": 3,
"name": "Playwright MCP Bridge", "name": "Playwright MCP Bridge",
"version": "0.0.40", "version": "0.0.46",
"description": "Share browser tabs with Playwright MCP server", "description": "Share browser tabs with Playwright MCP server",
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9nMS2b0WCohjVHPGb8D9qAdkbIngDqoAjTeSccHJijgcONejge+OJxOQOMLu7b0ovt1c9BiEJa5JcpM+EHFVGL1vluBxK71zmBy1m2f9vZF3HG0LSCp7YRkum9rAIEthDwbkxx6XTvpmAY5rjFa/NON6b9Hlbo+8peUSkoOK7HTwYnnI36asZ9eUTiveIf+DMPLojW2UX33vDWG2UKvMVDewzclb4+uLxAYshY7Mx8we/b44xu+Anb/EBLKjOPk9Yh541xJ5Ozc8EiP/5yxOp9c/lRiYUHaRW+4r0HKZyFt0eZ52ti2iM4Nfk7jRXR7an3JPsUIf5deC/1cVM/+1ZQIDAQAB", "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA9nMS2b0WCohjVHPGb8D9qAdkbIngDqoAjTeSccHJijgcONejge+OJxOQOMLu7b0ovt1c9BiEJa5JcpM+EHFVGL1vluBxK71zmBy1m2f9vZF3HG0LSCp7YRkum9rAIEthDwbkxx6XTvpmAY5rjFa/NON6b9Hlbo+8peUSkoOK7HTwYnnI36asZ9eUTiveIf+DMPLojW2UX33vDWG2UKvMVDewzclb4+uLxAYshY7Mx8we/b44xu+Anb/EBLKjOPk9Yh541xJ5Ozc8EiP/5yxOp9c/lRiYUHaRW+4r0HKZyFt0eZ52ti2iM4Nfk7jRXR7an3JPsUIf5deC/1cVM/+1ZQIDAQAB",
"permissions": [ "permissions": [

View File

@@ -1,12 +1,12 @@
{ {
"name": "@playwright/mcp-extension", "name": "@playwright/mcp-extension",
"version": "0.0.37", "version": "0.0.46",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@playwright/mcp-extension", "name": "@playwright/mcp-extension",
"version": "0.0.37", "version": "0.0.46",
"license": "Apache-2.0", "license": "Apache-2.0",
"devDependencies": { "devDependencies": {
"@types/chrome": "^0.0.315", "@types/chrome": "^0.0.315",
@@ -16,7 +16,7 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"typescript": "^5.8.2", "typescript": "^5.8.2",
"vite": "^5.4.20", "vite": "^5.4.21",
"vite-plugin-static-copy": "^3.1.1" "vite-plugin-static-copy": "^3.1.1"
}, },
"engines": { "engines": {
@@ -1796,9 +1796,9 @@
} }
}, },
"node_modules/vite": { "node_modules/vite": {
"version": "5.4.20", "version": "5.4.21",
"resolved": "https://registry.npmjs.org/vite/-/vite-5.4.20.tgz", "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz",
"integrity": "sha512-j3lYzGC3P+B5Yfy/pfKNgVEg4+UtcIJcVRt2cDjIOmhLourAqPqf8P7acgxeiSgUB7E3p2P8/3gNIgDLpwzs4g==", "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@playwright/mcp-extension", "name": "@playwright/mcp-extension",
"version": "0.0.40", "version": "0.0.46",
"description": "Playwright MCP Browser Extension", "description": "Playwright MCP Browser Extension",
"private": true, "private": true,
"repository": { "repository": {
@@ -29,7 +29,7 @@
"react": "^18.2.0", "react": "^18.2.0",
"react-dom": "^18.2.0", "react-dom": "^18.2.0",
"typescript": "^5.8.2", "typescript": "^5.8.2",
"vite": "^5.4.20", "vite": "^5.4.21",
"vite-plugin-static-copy": "^3.1.1" "vite-plugin-static-copy": "^3.1.1"
} }
} }

32
package-lock.json generated
View File

@@ -1,23 +1,23 @@
{ {
"name": "@playwright/mcp", "name": "@playwright/mcp",
"version": "0.0.40", "version": "0.0.46",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@playwright/mcp", "name": "@playwright/mcp",
"version": "0.0.40", "version": "0.0.46",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"playwright": "1.56.0-alpha-1758750661000", "playwright": "1.57.0-alpha-2025-11-07",
"playwright-core": "1.56.0-alpha-1758750661000" "playwright-core": "1.57.0-alpha-2025-11-07"
}, },
"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-1758750661000", "@playwright/test": "1.57.0-alpha-2025-11-07",
"@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-1758750661000", "version": "1.57.0-alpha-2025-11-07",
"resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.56.0-alpha-1758750661000.tgz", "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.57.0-alpha-2025-11-07.tgz",
"integrity": "sha512-sQT1R0BDA/+KYSx8fCps7i0RGB/EyakmXN+xoYCj5F7oDvJo8lr9urEbnP5RytBfsYoqBqNkIGdCbyebF4+a0A==", "integrity": "sha512-dnSCKdVigPMHRVnBhiu4jh6GkKQfgtlHKBLxAYQUtIC0FmwryoxTFRtK5hNtcscfnRjy/LceSJlSwfDTTtbyBA==",
"dev": true, "dev": true,
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"playwright": "1.56.0-alpha-1758750661000" "playwright": "1.57.0-alpha-2025-11-07"
}, },
"bin": { "bin": {
"playwright": "cli.js" "playwright": "cli.js"
@@ -825,12 +825,12 @@
} }
}, },
"node_modules/playwright": { "node_modules/playwright": {
"version": "1.56.0-alpha-1758750661000", "version": "1.57.0-alpha-2025-11-07",
"resolved": "https://registry.npmjs.org/playwright/-/playwright-1.56.0-alpha-1758750661000.tgz", "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.57.0-alpha-2025-11-07.tgz",
"integrity": "sha512-15C/m7NPpAmBX2MFMrepCMj18ksBYvhbT90cvFjG2iBs2YPqO2U4f9OjcX207ITSmDAAJ8pWBlJutcZUYUERXg==", "integrity": "sha512-E5fgekU+NuIfE16bjL9xIffhmag2cInC/KDfXwvVGkCka5TpZfiWhHvCYIRW6/hEGr+eJS3jPHR91cyPO3gQgA==",
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"playwright-core": "1.56.0-alpha-1758750661000" "playwright-core": "1.57.0-alpha-2025-11-07"
}, },
"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-1758750661000", "version": "1.57.0-alpha-2025-11-07",
"resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.56.0-alpha-1758750661000.tgz", "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.57.0-alpha-2025-11-07.tgz",
"integrity": "sha512-ivP4xjc6EHkUqF80pMFfDRijKLEvO64qC6DTgyYrbsyCo8gugkqwKm6lFWn4W47g4S8juoUwQhlRVjM2BJ+ruA==", "integrity": "sha512-p61pk1XLuFBSia+37jfeuw62HbAi/KaXOGvjUoAiPdnDgO6AOj/DfodbWkZ1fqLZbW+q6Mja30YnzhD0CaePEQ==",
"license": "Apache-2.0", "license": "Apache-2.0",
"bin": { "bin": {
"playwright-core": "cli.js" "playwright-core": "cli.js"

View File

@@ -1,6 +1,6 @@
{ {
"name": "@playwright/mcp", "name": "@playwright/mcp",
"version": "0.0.40", "version": "0.0.46",
"description": "Playwright Tools for MCP", "description": "Playwright Tools for MCP",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -18,6 +18,8 @@
"lint": "npm run update-readme", "lint": "npm run update-readme",
"update-readme": "node update-readme.js", "update-readme": "node update-readme.js",
"docker-build": "docker build --no-cache -t playwright-mcp-dev:latest .", "docker-build": "docker build --no-cache -t playwright-mcp-dev:latest .",
"docker-rm": "docker rm playwright-mcp-dev",
"docker-run": "docker run -it -p 8080:8080 --name playwright-mcp-dev playwright-mcp-dev:latest",
"test": "playwright test", "test": "playwright test",
"ctest": "playwright test --project=chrome", "ctest": "playwright test --project=chrome",
"ftest": "playwright test --project=firefox", "ftest": "playwright test --project=firefox",
@@ -35,15 +37,15 @@
} }
}, },
"dependencies": { "dependencies": {
"playwright": "1.56.0-alpha-1758750661000", "playwright": "1.57.0-alpha-2025-11-07",
"playwright-core": "1.56.0-alpha-1758750661000" "playwright-core": "1.57.0-alpha-2025-11-07"
}, },
"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-1758750661000", "@playwright/test": "1.57.0-alpha-2025-11-07",
"@types/node": "^24.3.0", "@types/node": "^24.3.0",
"zod-to-json-schema": "^3.24.6" "zod-to-json-schema": "^3.24.6"
} }

View File

@@ -16,10 +16,16 @@
import { test, expect } from './fixtures'; import { test, expect } from './fixtures';
test('browser_click', async ({ client, server, mcpBrowser }) => { test('browser_click', async ({ client, server }) => {
server.setContent('/', ` server.setContent('/', `
<title>Title</title> <title>Title</title>
<button>Submit</button> <button>Submit</button>
<script>
const button = document.querySelector('button');
button.addEventListener('click', () => {
button.focus(); // without manual focus, webkit focuses body
});
</script>
`, 'text/html'); `, 'text/html');
expect(await client.callTool({ expect(await client.callTool({
@@ -38,6 +44,6 @@ test('browser_click', async ({ client, server, mcpBrowser }) => {
}, },
})).toHaveResponse({ })).toHaveResponse({
code: `await page.getByRole('button', { name: 'Submit' }).click();`, code: `await page.getByRole('button', { name: 'Submit' }).click();`,
pageState: expect.stringContaining(`- button "Submit" ${mcpBrowser !== 'webkit' || process.platform === 'linux' ? '[active] ' : ''}[ref=e2]`), pageState: expect.stringContaining(`button "Submit" [active] [ref=e2]`),
}); });
}); });

View File

@@ -29,7 +29,7 @@ const capabilities = {
'core-install': 'Browser installation', 'core-install': 'Browser installation',
'vision': 'Coordinate-based (opt-in via --caps=vision)', 'vision': 'Coordinate-based (opt-in via --caps=vision)',
'pdf': 'PDF generation (opt-in via --caps=pdf)', 'pdf': 'PDF generation (opt-in via --caps=pdf)',
'verify': 'Verify (opt-in via --caps=verify)', 'testing': 'Test assertions (opt-in via --caps=testing)',
'tracing': 'Tracing (opt-in via --caps=tracing)', 'tracing': 'Tracing (opt-in via --caps=tracing)',
}; };