PTS security notes / MCP servers / Playwright MCP server

Is Playwright MCP server safe to install?

By PTS · Based on public source as of December 5, 2026

Short answer

It controls a real browser, and some tools run code in pages or on your machine's Playwright runtime. The README says --allowed-origins is not a security boundary and does not affect redirects. File access is limited to workspace roots by default. Run it isolated, with its own profile, and deny the code-running tools unless needed.

What it is

Playwright MCP, from Microsoft, gives agents browser automation through structured accessibility snapshots instead of screenshots. Capabilities such as PDF, vision and devtools are opt-in through --caps.

Maintainer
Official (vendor)microsoft on GitHub (organisation account, project of the same name)
Source
microsoft/playwright-mcp40,575 GitHub stars · Apache-2.0 licence
Transport
stdio, HTTP on localhost (optional)
Packages
@playwright/mcp npm · latest 0.0.86 · 45,585,272 downloads last month
Latest release
v0.0.86 2026-11-18
Public advisories
1GitHub and OSV, as of December 5, 2026

What it can do

Read from the public tool definitions in the source, not from a live run. A capability marked "yes" means at least one tool can do it.

Because it can set cookies and storage and run JavaScript, it can act as a signed-in user in whatever profile you point it at.

ToolWhat it can doNotes
browser_run_code_unsafeRuns codeName says unsafe. Runs code in the Playwright context.
browser_evaluateRuns codeRuns JavaScript in the page.
browser_navigateNetwork
browser_file_uploadReadsUploads a file from disk to a page.
browser_pdf_saveWritesNeeds the pdf capability.
browser_take_screenshotWrites
browser_cookie_setWrites
browser_localstorage_setWrites
browser_set_storage_stateWrites
browser_cookie_listReads
browser_storage_stateReadsExports cookies and storage.
browser_routeWritesIntercepts and rewrites network requests.
Cookie, localStorage and sessionStorage tools
15 tools
Reads, Writes, DeletesRead, set, delete and clear browser storage. browser_cookie_clear, browser_cookie_delete, browser_localstorage_clear
Mouse tools
6 tools
WritesCoordinate-based input. browser_mouse_click_xy, browser_mouse_drag_xy
Recording, tracing and video tools
9 tools
WritesWrite recordings and traces. browser_start_tracing, browser_start_video

Counted from the tool list in the README. Some tools need a capability enabled with --caps.

Credentials and least privilege

No credential by default. The two optional inputs are files you choose.

CredentialWhat it is forLeast privilege
--secrets / PLAYWRIGHT_MCP_SECRETS_FILEOptional dotenv file of secrets the browser tools can use.Put only the logins this task needs in it, and keep the file out of the repo.
--storage-stateOptional saved cookies and storage for isolated sessions.Use a test account state, not your daily login.

Public security advisories

Advisories published on GitHub or OSV for this project, as of December 5, 2026. Fixed issues are a normal part of a maintained project. What matters is that the version you run is not in an affected range.

AdvisorySeveritySummaryAffectedFixed in
GHSA-6fg3-hvw7-2fwq · CVE-2025-9611HighMicrosoft Playwright MCP Server vulnerable to DNS Rebinding Attack; Allows Attackers Access to All Server Toolsn/a0.0.40

What stands out

Safe-install checklist

Install command from the project's docs: npx @playwright/mcp@latest.

  1. Pin the version. Use an exact version, not latest: npx @playwright/mcp@0.0.86 --isolated. `--isolated` keeps the profile in memory.
  2. Scope the credential. Put only the logins this task needs in it, and keep the file out of the repo.
  3. Use --isolated with a test account's storage state, not your real profile.
  4. Do not use --extension or --allow-unrestricted-file-access unless you need them.
  5. Deny browser_run_code_unsafe and browser_evaluate unless the task is test generation.
  6. Deny the tools you do not need. In Claude Code, deny rules in .claude/settings.json use the form mcp__<server name>__<tool>, where the server name is whatever you called it in your config. Example, if you named it playwright-mcp:
    {
      "permissions": {
        "deny": [
          "mcp__playwright-mcp__browser_run_code_unsafe",
          "mcp__playwright-mcp__browser_evaluate",
          "mcp__playwright-mcp__browser_pdf_save",
          "mcp__playwright-mcp__browser_take_screenshot",
          "mcp__playwright-mcp__browser_cookie_set",
          "mcp__playwright-mcp__browser_localstorage_set",
          "mcp__playwright-mcp__browser_set_storage_state",
          "mcp__playwright-mcp__browser_route"
        ]
      }
    }
  7. Snapshot the tool list. Save the tools/list output right after you install, then compare it before every upgrade with the free PTS MCP tool diff checker. It runs in your browser and flags new tools and changed descriptions or schemas.
  8. Watch for fixes. Watch the project's security advisories and upgrade on purpose, after the diff.

For the general version of this list, see the MCP server security checklist. Not sure about a server that is not listed here? Read Is an MCP server safe to install?

Quick follow-ups

What can Playwright MCP server do on my machine or accounts?

Based on its public tool definitions, it can: reads local files or data; creates or changes files, records or settings; deletes or destroys data; runs commands, scripts or code; reaches the open web or a third-party service beyond the account you connect it to. Because it can set cookies and storage and run JavaScript, it can act as a signed-in user in whatever profile you point it at.

Does Playwright MCP server need a token or API key?

Yes, depending on setup: --secrets / PLAYWRIGHT_MCP_SECRETS_FILE, --storage-state. No credential by default. The two optional inputs are files you choose.

Has Playwright MCP server had public security advisories?

Yes. 1 public advisory (GitHub or OSV) listed for it as of December 5, 2026. Each one is linked on this page with its affected and fixed versions, so you can check the version you run. Fixed issues are normal for active projects. Running a current, pinned version is what matters.

How do I keep Playwright MCP server from changing under me?

Pin the version, for example npx @playwright/mcp@0.0.86 --isolated. Then save its tool list (name, description, input schema) with the free PTS MCP tool diff checker and compare it before each upgrade.

Sources

This page is a factual summary of public information about the software. It is not a verdict on the maintainers and not an audit. Check the project's own docs for your version before you rely on it. Educational, not legal or security advice.

Get the free checklist

A 9-page worksheet plus starter files for Claude Code and Codex. It maps what your agent can reach and shrinks it. Download it on Gumroad. This site does not collect email.

Get the free checklist

Before you install anything, try the MCP tool diff checker. See all 54 servers.

More server pages