Skip to content

Releases: microsoft/playwright-mcp

v0.0.48

21 Nov 22:35
64f65cc

Choose a tag to compare

Maintenance release

We are bringing back the --allow-origins flag! Please make sure you point at the trusted origins only.

v0.0.47

14 Nov 20:24
c016643

Choose a tag to compare

New ways to provide initial state

There are now multiple ways to provide the initial state to the browser context or a page.

For the storage state, you can either:

  • Start with a user data directory using the --user-data-dir argument. This will persist all browser data between the sessions.
  • Start with a storage state file using the --storage-state argument. This will load cookies and local storage from the file into an isolated browser context.

For the page state, you can use:

  • ❗NEW❗ --init-page to point to a TypeScript file that will be evaluated on the Playwright page object. This allows you to run arbitrary code to set up the page. You can use various Playwright APIs there, perform necessary steps, etc.
// init-page.ts
export default async ({ page }) => {
  await page.context().grantPermissions(['geolocation']);
  await page.context().setGeolocation({ latitude: 37.7749, longitude: -122.4194 });
  await page.setViewportSize({ width: 1280, height: 720 });
};
  • --init-script to point to a JavaScript file that will be added as an initialization script. The script will be evaluated in every page before any of the page's scripts.
    This is useful for overriding browser APIs or setting up the environment.
// init-script.js
window.isPlaywrightMCP = true;

New run-code command to save tokens

There now is a new browser_run_code command that allows LLM to run Playwright APIs as well. LLM can call it with a batch of Playwright APIs:

{
    name: 'browser_run_code',
    arguments: {
      code: `
        await page.getByRole("checkbox", { name: "Accept" }).check();
        await page.getByRole("button", { name: "Submit" }).click();
      `;
    }
  }

This way LLM can speed up repetitive operations and save on context tokens.

Breaking changes

--allowed-origins and --blocked-origins flags are gone. Please use --proxy as a safer alternative or rely upon the underlying OS policies instead.

v0.0.46

07 Nov 21:56
8cc557d

Choose a tag to compare

Maintenance release

v0.0.45

31 Oct 23:15
e72701b

Choose a tag to compare

Maintenance release

  • fix(mcp): do not fail on wsl client w/ windows server - (#38063)

v0.0.44

24 Oct 21:41
b945ace

Choose a tag to compare

Maintenance release

v0.0.43

16 Oct 23:11
a03ec7a

Choose a tag to compare

MCP Changes Since Last Release

  • Incremental page snapshots: pageState now supports diffs. Unchanged subtrees are collapsed as - ref=<id> [unchanged]. Reduces noise and payload size. microsoft/playwright#37795
  • Encourage relative path usage — MCP now suggests using relative paths for portability microsoft/playwright#37857
  • Image size cap — Added limits on rendered image sizes to prevent resource overuse microsoft/playwright#37856

v0.0.42

09 Oct 21:57
b4e016a

Choose a tag to compare

v0.0.41

01 Oct 22:54
29e5326

Choose a tag to compare

v0.0.40

25 Sep 00:10
a86b580

Choose a tag to compare

Features

Bugfixes

v0.0.39

19 Sep 15:02
08bd91d

Choose a tag to compare

microsoft/playwright@afb59a0ec fix(mcp): tolerate malformed roots microsoft/playwright#37492
microsoft/playwright@0574514a0 feat(mcp): support shared browser context microsoft/playwright#37463