Playwright MCP server

The Playwright MCP server gives AI agents a real browser driven by Microsoft's Playwright: navigate, click, type and fill forms using the page's accessibility tree instead of screenshots.

Checked by CookiesForAI on : repository facts (stars, last push, archived) re-read from GitHub; listing in the MCP Registry checked.

Written by

Connect Playwright

Claude Code

Terminal
claude mcp add playwright npx @playwright/mcp@latest

Codex

Terminal
codex mcp add playwright npx "@playwright/mcp@latest"

VS Code

Terminal
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'

Standard config for Cursor, Claude Desktop, Windsurf and most clients

Config
{"mcpServers": {"playwright": {"command": "npx", "args": ["@playwright/mcp@latest"]}}}

Add --headless to run without a visible window, --isolated for a fresh profile each session, or --extension to drive your existing Chrome or Edge tabs through the Playwright extension.

Or paste this into your coding agent: Connect the Playwright MCP server to my coding agent using its documented setup: https://github.com/microsoft/playwright-mcp. Checked by CookiesForAI on : repository facts (stars, last push, archived) re-read from GitHub; listing in the MCP Registry checked.

Your first question with this server installed

4,004tokens sent to the model with your first question: the tool list plus one tool answer

PlaywrightTool list 3,919One answer 8525 tools listed without a key

Typical serverFirst question 2,022 (median of 10 servers)

Playwright's first question takes 4,004 tokens: its tool list plus one answer. That is about 2.0 times the median first question of the 10 servers we measured with both numbers on (2,022 tokens).

Measured without a key or sign-in. Assistants that load every tool send this list to the model with each question; some load tools only when a task needs them. The one answer is from browser_navigate, a fixed read-only call. Tokens are counted with OpenAI's o200k tokenizer; other models count a little differently.

Measured . How we measure.

What the Playwright MCP server does

The Playwright MCP server is Microsoft's browser automation server for AI agents, built on the Playwright testing library. It opens Chrome, Edge, Firefox or WebKit and lets the agent navigate, click, type, hover, drag, upload files, fill forms and handle dialogs. The agent reads each page as a structured accessibility snapshot rather than an image, so it does not need a vision model and its clicks hit exact elements.

Beyond the core tools, Playwright groups extra abilities behind opt-in flags: network mocking and request inspection, cookie and local storage control, PDF export, coordinate-based mouse control for canvas apps, test assertions that check text or elements are visible, and DevTools features such as tracing and video recording. The browser keeps a persistent profile per project by default, can run isolated for clean test sessions, or attach to your own logged-in Chrome or Edge through the Playwright extension.

The server runs locally through npx with Node.js 18 or newer, and also ships as a Docker image. The GitHub repo had 37,737 stars on . Microsoft's README notes that coding agents may spend fewer tokens with its separate Playwright CLI plus skills, and keeps MCP for long, stateful browser loops.

Tools it gives your agent

  • browser_navigate
  • browser_snapshot
  • browser_click
  • browser_type
  • browser_fill_form
  • browser_select_option
  • browser_press_key
  • browser_wait_for
  • browser_take_screenshot
  • browser_evaluate
  • browser_console_messages
  • browser_tabs

We also list this company's other pages: 3 skills by Microsoft.

When to use Playwright

  • You want the agent to click through your web app and check that a feature works.
  • You need to fill in a multi-step web form or pull data from pages that need a login.
  • You want the agent to write or repair Playwright end-to-end tests by trying the flow first.
  • You need to mock an API response or block requests while the agent tests a page.

When to pick something else

  • Token-tight coding sessions: accessibility snapshots of large pages are long, and Microsoft itself points coding agents to the lighter Playwright CLI.
  • Debugging performance or network timing in detail; Chrome DevTools MCP has deeper profiling.

What Playwright needs

  • Node.js 18 or newer
  • A local browser (Playwright can install one)

What the Playwright MCP server costs

Free and open source under Apache-2.0; it runs a browser on your own machine, with no account, key or usage bill.

Questions people ask

Is the Playwright MCP server free?

Yes. It is open source under Apache-2.0 and runs on your machine, with no account or usage fees.

Does Playwright MCP need screenshots or a vision model?

No. It gives the agent the page's accessibility tree as text. A vision mode with coordinate clicks exists as an opt-in for canvas-style pages.

Can Playwright MCP use my logged-in browser?

Yes, in two ways: its default persistent profile keeps logins between sessions, and the --extension flag connects to tabs in your own Chrome or Edge.