@playwright/mcp 0.0.39 → 0.0.40-alpha-2025-09-25
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.
- package/README.md +13 -1
- package/config.d.ts +27 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -180,6 +180,10 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
180
180
|
|
|
181
181
|
```
|
|
182
182
|
> npx @playwright/mcp@latest --help
|
|
183
|
+
--allowed-hosts <hosts...> comma-separated list of hosts this
|
|
184
|
+
server is allowed to serve from.
|
|
185
|
+
Defaults to the host the server is bound
|
|
186
|
+
to.
|
|
183
187
|
--allowed-origins <origins> semicolon-separated list of origins to
|
|
184
188
|
allow the browser to request. Default is
|
|
185
189
|
to allow all.
|
|
@@ -217,6 +221,11 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
217
221
|
localhost. Use 0.0.0.0 to bind to all
|
|
218
222
|
interfaces.
|
|
219
223
|
--ignore-https-errors ignore https errors
|
|
224
|
+
--init-script <path...> path to JavaScript file to add as an
|
|
225
|
+
initialization script. The script will
|
|
226
|
+
be evaluated in every page before any of
|
|
227
|
+
the page's scripts. Can be specified
|
|
228
|
+
multiple times.
|
|
220
229
|
--isolated keep the browser profile in memory, do
|
|
221
230
|
not save it to disk.
|
|
222
231
|
--image-responses <mode> whether to send image responses to the
|
|
@@ -236,6 +245,9 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
236
245
|
session into the output directory.
|
|
237
246
|
--save-trace Whether to save the Playwright Trace of
|
|
238
247
|
the session into the output directory.
|
|
248
|
+
--save-video <size> Whether to save the video of the session
|
|
249
|
+
into the output directory. For example
|
|
250
|
+
"--save-video=800x600"
|
|
239
251
|
--secrets <path> path to a file containing secrets in the
|
|
240
252
|
dotenv format
|
|
241
253
|
--shared-browser-context reuse the same browser context between
|
|
@@ -251,7 +263,7 @@ Playwright MCP server supports following arguments. They can be provided in the
|
|
|
251
263
|
specified, a temporary directory will be
|
|
252
264
|
created.
|
|
253
265
|
--viewport-size <size> specify browser viewport size in pixels,
|
|
254
|
-
for example "
|
|
266
|
+
for example "1280x720"
|
|
255
267
|
```
|
|
256
268
|
|
|
257
269
|
<!--- End of options generated section -->
|
package/config.d.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
import type * as playwright from 'playwright';
|
|
18
18
|
|
|
19
|
-
export type ToolCapability = 'core' | 'core-tabs' | 'core-install' | 'vision' | 'pdf' | '
|
|
19
|
+
export type ToolCapability = 'core' | 'core-tabs' | 'core-install' | 'vision' | 'pdf' | 'testing' | 'tracing';
|
|
20
20
|
|
|
21
21
|
export type Config = {
|
|
22
22
|
/**
|
|
@@ -68,6 +68,12 @@ export type Config = {
|
|
|
68
68
|
* Remote endpoint to connect to an existing Playwright server.
|
|
69
69
|
*/
|
|
70
70
|
remoteEndpoint?: string;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Paths to JavaScript files to add as initialization scripts.
|
|
74
|
+
* The scripts will be evaluated in every page before any of the page's scripts.
|
|
75
|
+
*/
|
|
76
|
+
initScript?: string[];
|
|
71
77
|
},
|
|
72
78
|
|
|
73
79
|
server?: {
|
|
@@ -80,6 +86,12 @@ export type Config = {
|
|
|
80
86
|
* The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
|
|
81
87
|
*/
|
|
82
88
|
host?: string;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* The hosts this server is allowed to serve from. Defaults to the host server is bound to.
|
|
92
|
+
* This is not for CORS, but rather for the DNS rebinding protection.
|
|
93
|
+
*/
|
|
94
|
+
allowedHosts?: string[];
|
|
83
95
|
},
|
|
84
96
|
|
|
85
97
|
/**
|
|
@@ -100,6 +112,19 @@ export type Config = {
|
|
|
100
112
|
*/
|
|
101
113
|
saveTrace?: boolean;
|
|
102
114
|
|
|
115
|
+
/**
|
|
116
|
+
* If specified, saves the Playwright video of the session into the output directory.
|
|
117
|
+
*/
|
|
118
|
+
saveVideo?: {
|
|
119
|
+
width: number;
|
|
120
|
+
height: number;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Reuse the same browser context between all connected HTTP clients.
|
|
125
|
+
*/
|
|
126
|
+
sharedBrowserContext?: boolean;
|
|
127
|
+
|
|
103
128
|
/**
|
|
104
129
|
* Secrets are used to prevent LLM from getting sensitive data while
|
|
105
130
|
* automating scenarios such as authentication.
|
|
@@ -141,3 +166,4 @@ export type Config = {
|
|
|
141
166
|
*/
|
|
142
167
|
imageResponses?: 'allow' | 'omit';
|
|
143
168
|
};
|
|
169
|
+
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@playwright/mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40-alpha-2025-09-25",
|
|
4
4
|
"description": "Playwright Tools for MCP",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"ftest": "playwright test --project=firefox",
|
|
24
24
|
"wtest": "playwright test --project=webkit",
|
|
25
25
|
"dtest": "MCP_IN_DOCKER=1 playwright test --project=chromium-docker",
|
|
26
|
-
"npm-publish": "npm run clean && npm run test && npm publish"
|
|
26
|
+
"npm-publish": "npm run clean && npm run test && npm publish",
|
|
27
|
+
"copy-config": "cp ../playwright/packages/playwright/src/mcp/config.d.ts . && perl -pi -e \"s|import type \\* as playwright from 'playwright-core';|import type * as playwright from 'playwright';|\" ./config.d.ts",
|
|
28
|
+
"roll": "npm run copy-config && npm run lint"
|
|
27
29
|
},
|
|
28
30
|
"exports": {
|
|
29
31
|
"./package.json": "./package.json",
|
|
@@ -33,15 +35,15 @@
|
|
|
33
35
|
}
|
|
34
36
|
},
|
|
35
37
|
"dependencies": {
|
|
36
|
-
"playwright": "1.56.0-alpha-
|
|
37
|
-
"playwright-core": "1.56.0-alpha-
|
|
38
|
+
"playwright": "1.56.0-alpha-1758750661000",
|
|
39
|
+
"playwright-core": "1.56.0-alpha-1758750661000"
|
|
38
40
|
},
|
|
39
41
|
"bin": {
|
|
40
42
|
"mcp-server-playwright": "cli.js"
|
|
41
43
|
},
|
|
42
44
|
"devDependencies": {
|
|
43
45
|
"@modelcontextprotocol/sdk": "^1.17.5",
|
|
44
|
-
"@playwright/test": "1.56.0-alpha-
|
|
46
|
+
"@playwright/test": "1.56.0-alpha-1758750661000",
|
|
45
47
|
"@types/node": "^24.3.0",
|
|
46
48
|
"zod-to-json-schema": "^3.24.6"
|
|
47
49
|
}
|