PlugWiki
Playwright MCP logo

Playwright MCP: let your AI assistant use a real browser

Official · by MicrosoftLocal
Getnpm@playwright/mcpmicrosoft/playwright-mcpDocs

Lets Claude, Cursor and other AI assistants open a real browser, click through websites and test web apps for you.

Playwright MCP lets your AI assistant control a real web browser. It can open pages, click, type, fill forms and read what is on screen, so it can test your app or work through a website for you.

It reads pages as structured text, not screenshots, so it does not need an image-capable model. The catch is that this text is long. Each step sends a page snapshot back to the assistant, so long sessions use up the context window fast.

Good for

  • Developers who want the assistant to check the app they just built in a real browser
  • QA engineers writing or debugging browser tests with AI help
  • Anyone who wants an assistant to fill forms or read pages that need clicking
  • Teams testing sites in Chrome, Firefox, WebKit and Edge

Works in

11 supported · 1 should work

Tap an app to see how to set it up and any known problems.

Install Playwright MCP

Claude Code

  1. 1

    Copy this prompt.

    Add the Playwright MCP server to Claude Code. Run this command:
    
    claude mcp add playwright -- npx -y @playwright/mcp
    
    Then check that it loaded and tell me if I need to sign in or restart.
  2. 2

    Paste it into Claude Code. It shows the change and asks before running it.

Requires Node.js 18+.

Needs Node.js 18 or newer. No account or sign-in. It opens a real browser window you can watch. Want the window hidden? Add --headless to the command.

Built from the package data we hold. Not yet tested by us.

Tools

  • Opens a web page in the browser at the address you give

    Loads the URL you give into the browser so the assistant can work on that page.

    Try: “Open https://example.com/signup in the browser”

    Network · browser_navigate

  • Reads the text, links and buttons on the current page so the assistant can see it

    Captures the structure of the current page, which the assistant uses to decide what to click or fill next.

    Try: “What is on the page right now?”

    Files · browser_snapshot

  • Takes a picture of the current page or one element on it

    Saves an image of the visible page, the full scrollable page, or a single element, as PNG, JPEG or WebP.

    Try: “Take a full-page screenshot of the pricing page”

    Files · browser_take_screenshot

  • Clicks a button, link or other element on the page

    Clicks one element, with an option for double-click and for the left, right or middle button.

    Try: “Click the Sign up button and tell me what happens”

    Write · browser_click

  • Types text into a field, optionally pressing Enter afterward

    Enters text into an editable field, either all at once or one character at a time for pages that react to each key.

    Try: “Type my search term into the search box and press Enter”

    Write · browser_type

  • Fills in several form fields in one step

    Fills a list of form fields together, so a multi-field form does not need one action per field.

    Try: “Fill in the contact form with the name and email from my notes”

    Write · browser_fill_form

  • Picks one or more options in a dropdown menu

    Chooses one or several values in a dropdown on the page.

    Try: “Set the country dropdown on the checkout form to Canada”

    Write · browser_select_option

  • Presses a keyboard key such as Enter, Tab or an arrow key

    Sends one key press to the page, or a single character.

    Try: “Press Tab to move to the next field”

    Write · browser_press_key

  • Moves the mouse over an element to open a menu or tooltip

    Puts the mouse pointer over an element without clicking, which reveals hover menus and tooltips.

    Try: “Hover over the Products menu and list the sub-items”

    Write · browser_hover

  • Drags one element and drops it onto another

    Performs a drag from a start element to an end element on the page.

    Try: “Drag the Done card into the Shipped column”

    Write · browser_drag

  • Drops files or data onto an element, as if dragged in from outside the page

    Simulates dropping files from your computer, or MIME-typed text and links, onto a page element.

    Try: “Drop report.pdf from my project folder onto the upload area”

    Write · browser_drop

  • Uploads one or more files from your computer into a page

    Attaches the files at the paths you give to the page's file picker. If no paths are given, the picker is cancelled.

    Try: “Upload invoice-march.pdf to the expense form”

    Write · browser_file_upload

Read from the source code

Pros and cons

Good

  • Free and open source, with no account or API key.
  • Made by Microsoft, the team behind Playwright.
  • Works with Chrome, Firefox, WebKit and Edge.
  • Reads pages as structured text, so no vision model is needed.
  • Documented setup for most major AI assistants.
  • Can keep your logins between sessions or start clean each time.

Watch out

  • Page snapshots use a lot of context, so long sessions get cut short.
  • Can run code and change data on real sites, with no read-only mode.
  • Two assistants cannot share the default browser profile.
  • Microsoft suggests its Playwright CLI for coding agents, which uses less context.
  • No built-in HAR recording, and some tools are opt-in.

Permissions

high risk · 6 things to watch · 1 advisory

High risk

A web page you visit, or a mistaken click, could make the assistant act on real accounts or run code on your machine. Use an isolated session, approve each action by hand, and never leave it running unattended on logged-in sites.

What it can do

  • Read your data
  • Create and change things
  • Delete things
  • Read-only mode

Watch out for

  • It can run any code on your computer

    One tool runs JavaScript in the server process, and the README calls it equivalent to remote code execution. Keep approval switched on for it. github.com

  • Logins are saved on disk by default

    The default profile keeps cookies and sessions between runs. Use the isolated option for throwaway sessions, or delete the profile folder. github.com

  • Extension mode drives your real browser

    With the extension option the assistant works in your open Chrome or Edge tabs, signed in as you. Only use it when you are watching. github.com

  • Microsoft says it is not a security boundary

    Origin filters and the file-access limit are guardrails that can be worked around. Do not rely on them to contain a risky site. github.com

  • It can click, submit and change site data

    The core tools click, type and submit forms on real sites, and opt-in tools can set or clear cookies. Confirm actions on accounts you care about. github.com

  • Keep HTTP mode on localhost

    The port option starts a local web server, and binding to 0.0.0.0 exposes it to your network. Update past 0.0.40 for DNS rebinding protection. github.com

Security advisories

Technical details
Turning on read-onlyNo read-only mode. The README marks each tool read-only or not, so you can auto-approve only read-only tools (snapshot, screenshot, console) and confirm the rest.
Talks toAny website the assistant visits
Sign-in and keysDefault persistent browser profile on disk keeps cookies and sessions between runs.

Alternatives

Use Playwright MCP to test and drive sites across Chrome, Firefox and WebKit. Pick Chrome DevTools MCP for performance traces and debugging in Chrome, or the Playwright CLI if your assistant has shell access and you want to save context.

ServerOfficialRunsSign-inCan change thingsGitHub stars
For Playwright
Playwright MCPThis pageOfficialLocalNo sign-inYes38.9K
Playwright CLIOfficialLocalNo sign-inYes14.8K
Other tools for the same job
Chrome DevTools MCPFor Chrome DevToolsOfficialLocalNo sign-inYes54.5K

What people say

People like how precise it is and dislike how much context it uses.

What people like

  • Targets elements by page structure, so clicks are precise and no vision model is needed.
  • Works in Chromium, Firefox and WebKit, which Chrome-only browser tools cannot.
  • Lets the assistant read browser console output while it tests.

Common complaints

  • Tool definitions and page snapshots eat a lot of context, so long sessions hit compaction.
  • Some developers get better results by having the assistant write a Playwright script instead.
  • No built-in HAR recording, and some useful tools sit behind opt-in flags.
  • Weaker than Chrome DevTools MCP for performance traces and audits.

In their words

1 more quote

Questions

Is Playwright MCP free?

Yes. It is free and open source under Apache-2.0, and it needs no account or API key.

Is Playwright MCP safe to run?

Microsoft says it is not a security boundary. Update to 0.0.40 or later, which fixes a flaw where a website could reach a locally running server, and keep approval on for the tool that runs code.

Can it use my logged-in accounts?

Yes. The default profile keeps logins between sessions, and extension mode connects to your open Chrome or Edge. For a clean, scripted login, use the isolated option with a saved storage state.

Do I need to install a browser first?

Usually not. The server downloads what it needs, or uses your installed Chrome. On minimal Linux images Chromium can fail to start because of missing system libraries.

Why does it use so many tokens?

Every action returns a snapshot of the page, and the tool list is loaded into context too. Microsoft rates its CLI as lighter and suggests it for coding agents.

How do I run it without a visible browser window?

Add the headless option to the server arguments. The browser is visible by default. The Docker image only runs headless Chromium.

Can two assistants use it at the same time?

Not with the same saved profile. Start each extra client in isolated mode or give it its own profile folder, or you will see 'browser already in use' errors.

Which browsers does it support?

Chrome, Firefox, WebKit and Edge. Extension mode works with Chrome and Edge only.

Can it take screenshots or save PDFs?

Screenshots work out of the box. Saving PDFs is opt-in, and so are the mouse tools that click by screen position.

Playwright MCP vs Chrome DevTools MCP?

Playwright MCP drives pages in several browsers. Chrome DevTools MCP fits debugging, performance traces and audits in Chrome only.

Examples

  • Check a feature you just built in the local dev server

    Start the dev server, open http://localhost:3000 with Playwright, click through the signup form and tell me about any console errors.

    Source
  • Walk through a demo app and test a flow

    Use Playwright to open https://demo.playwright.dev/todomvc, add two todos, mark one done and take a screenshot.

    Source
  • Test a page at a phone-sized viewport

    Open our pricing page, resize the browser to 390x844 and check whether the plan table fits without horizontal scrolling.

    Source

Information

updated Nov 2, 2026

Publisher
Microsoft (official)
Package
@playwright/mcp
Registry
npm
Transport
stdio, Streamable HTTP
Version
0.0.82
License
Apache-2.0
Last commit
Oct 31, 2026
Open issues
1
Listed in
Official MCP registry, Docker MCP Catalog

WebsiteDocsGitHubnpmOfficial MCP RegistryChangelogIssues

Other Playwright MCP servers

Sources

Docs, issue trackers and discussions this page is built from. Issues, quotes and findings above link to their own source.

Show all 11
  1. microsoft/playwright-mcp README · github.com
  2. Playwright MCP introduction · playwright.dev
  3. Playwright vs. Chrome DevTools MCP: Driving vs. Debugging · stevekinney.com
  4. GHSA-6fg3-hvw7-2fwq · github.com
  5. Do I need to install a browser first? · github.com
  6. Extend Copilot coding agent with MCP · docs.github.com
  7. Claude plugins official · github.com
  8. Large responses consuming context windows · github.com
  9. Show HN: Playwright Skill for Claude Code · news.ycombinator.com
  10. Show HN: Playwright Skill for Claude Code · news.ycombinator.com
  11. microsoft/playwright-cli · github.com

Facts from the official MCP registry, GitHub, npm, PyPI and the Docker catalog. Updated Nov 2, 2026.