@playwright/mcp 0.0.47-alpha-2025-11-19 → 0.0.47-alpha-2025-11-20

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 (2) hide show
  1. package/README.md +123 -44
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -438,72 +438,151 @@ npx @playwright/mcp@latest --config path/to/config.json
438
438
 
439
439
  ```typescript
440
440
  {
441
- // Browser configuration
441
+ /**
442
+ * The browser to use.
443
+ */
442
444
  browser?: {
443
- // Browser type to use (chromium, firefox, or webkit)
445
+ /**
446
+ * The type of browser to use.
447
+ */
444
448
  browserName?: 'chromium' | 'firefox' | 'webkit';
445
449
 
446
- // Keep the browser profile in memory, do not save it to disk.
450
+ /**
451
+ * Keep the browser profile in memory, do not save it to disk.
452
+ */
447
453
  isolated?: boolean;
448
454
 
449
- // Path to user data directory for browser profile persistence
455
+ /**
456
+ * Path to a user data directory for browser profile persistence.
457
+ * Temporary directory is created by default.
458
+ */
450
459
  userDataDir?: string;
451
460
 
452
- // Browser launch options (see Playwright docs)
453
- // @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch
454
- launchOptions?: {
455
- channel?: string; // Browser channel (e.g. 'chrome')
456
- headless?: boolean; // Run in headless mode
457
- executablePath?: string; // Path to browser executable
458
- // ... other Playwright launch options
459
- };
460
-
461
- // Browser context options
462
- // @see https://playwright.dev/docs/api/class-browser#browser-new-context
463
- contextOptions?: {
464
- viewport?: { width: number, height: number };
465
- // ... other Playwright context options
466
- };
467
-
468
- // CDP endpoint for connecting to existing browser
461
+ /**
462
+ * Launch options passed to
463
+ * @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context
464
+ *
465
+ * This is useful for settings options like `channel`, `headless`, `executablePath`, etc.
466
+ */
467
+ launchOptions?: playwright.LaunchOptions;
468
+
469
+ /**
470
+ * Context options for the browser context.
471
+ *
472
+ * This is useful for settings options like `viewport`.
473
+ */
474
+ contextOptions?: playwright.BrowserContextOptions;
475
+
476
+ /**
477
+ * Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.
478
+ */
469
479
  cdpEndpoint?: string;
470
480
 
471
- // Remote Playwright server endpoint
481
+ /**
482
+ * CDP headers to send with the connect request.
483
+ */
484
+ cdpHeaders?: Record<string, string>;
485
+
486
+ /**
487
+ * Remote endpoint to connect to an existing Playwright server.
488
+ */
472
489
  remoteEndpoint?: string;
490
+
491
+ /**
492
+ * Paths to TypeScript files to add as initialization scripts for Playwright page.
493
+ */
494
+ initPage?: string[];
495
+
496
+ /**
497
+ * Paths to JavaScript files to add as initialization scripts.
498
+ * The scripts will be evaluated in every page before any of the page's scripts.
499
+ */
500
+ initScript?: string[];
473
501
  },
474
502
 
475
- // Server configuration
476
503
  server?: {
477
- port?: number; // Port to listen on
478
- host?: string; // Host to bind to (default: localhost)
504
+ /**
505
+ * The port to listen on for SSE or MCP transport.
506
+ */
507
+ port?: number;
508
+
509
+ /**
510
+ * The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
511
+ */
512
+ host?: string;
513
+
514
+ /**
515
+ * The hosts this server is allowed to serve from. Defaults to the host server is bound to.
516
+ * This is not for CORS, but rather for the DNS rebinding protection.
517
+ */
518
+ allowedHosts?: string[];
479
519
  },
480
520
 
481
- // List of additional capabilities
482
- capabilities?: Array<
483
- 'tabs' | // Tab management
484
- 'install' | // Browser installation
485
- 'pdf' | // PDF generation
486
- 'vision' | // Coordinate-based interactions
487
- >;
521
+ /**
522
+ * List of enabled tool capabilities. Possible values:
523
+ * - 'core': Core browser automation features.
524
+ * - 'pdf': PDF generation and manipulation.
525
+ * - 'vision': Coordinate-based interactions.
526
+ */
527
+ capabilities?: ToolCapability[];
488
528
 
489
- // Directory for output files
490
- outputDir?: string;
529
+ /**
530
+ * Whether to save the Playwright session into the output directory.
531
+ */
532
+ saveSession?: boolean;
491
533
 
492
- // Network configuration
493
- network?: {
494
- // List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
495
- allowedOrigins?: string[];
534
+ /**
535
+ * Whether to save the Playwright trace of the session into the output directory.
536
+ */
537
+ saveTrace?: boolean;
496
538
 
497
- // List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
498
- blockedOrigins?: string[];
539
+ /**
540
+ * If specified, saves the Playwright video of the session into the output directory.
541
+ */
542
+ saveVideo?: {
543
+ width: number;
544
+ height: number;
499
545
  };
500
-
546
+
501
547
  /**
502
- * Whether to send image responses to the client. Can be "allow" or "omit".
503
- * Defaults to "allow".
548
+ * Reuse the same browser context between all connected HTTP clients.
549
+ */
550
+ sharedBrowserContext?: boolean;
551
+
552
+ /**
553
+ * Secrets are used to prevent LLM from getting sensitive data while
554
+ * automating scenarios such as authentication.
555
+ * Prefer the browser.contextOptions.storageState over secrets file as a more secure alternative.
556
+ */
557
+ secrets?: Record<string, string>;
558
+
559
+ /**
560
+ * The directory to save output files.
561
+ */
562
+ outputDir?: string;
563
+
564
+ /**
565
+ * Specify the attribute to use for test ids, defaults to "data-testid".
566
+ */
567
+ testIdAttribute?: string;
568
+
569
+ timeouts?: {
570
+ /*
571
+ * Configures default action timeout: https://playwright.dev/docs/api/class-page#page-set-default-timeout. Defaults to 5000ms.
572
+ */
573
+ action?: number;
574
+
575
+ /*
576
+ * Configures default navigation timeout: https://playwright.dev/docs/api/class-page#page-set-default-navigation-timeout. Defaults to 60000ms.
577
+ */
578
+ navigation?: number;
579
+ };
580
+
581
+ /**
582
+ * Whether to send image responses to the client. Can be "allow", "omit", or "auto". Defaults to "auto", which sends images if the client can display them.
504
583
  */
505
584
  imageResponses?: 'allow' | 'omit';
506
- }
585
+ };
507
586
  ```
508
587
  </details>
509
588
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playwright/mcp",
3
- "version": "0.0.47-alpha-2025-11-19",
3
+ "version": "0.0.47-alpha-2025-11-20",
4
4
  "description": "Playwright Tools for MCP",
5
5
  "mcpName": "com.microsoft/playwright-mcp",
6
6
  "repository": {