---
title: "Playwright MCP server: browser automation for AI agents"
canonical_url: https://cookiesforai.app/mcp/playwright
last_updated: 2026-10-03T10:04:47+02:00
type: mcp
summary: "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."
install: "claude mcp add playwright npx @playwright/mcp@latest"
related:
  - "https://cookiesforai.app/mcp/browser-use"
  - "https://cookiesforai.app/mcp/browserbase"
  - "https://cookiesforai.app/mcp/chrome-devtools"
---

# 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.

| Fact | Value |
|---|---|
| Publisher | Microsoft (official) |
| Source | https://github.com/microsoft/playwright-mcp |
| License | Apache-2.0 |
| GitHub stars | 37,745 on 2026-10-02 |
| Last code push | 2026-09-28 |
| Page updated | 2026-10-03 |
| Official MCP Registry | io.github.microsoft/playwright-mcp |
| Documented clients | Claude Code, Claude Desktop, Codex, GitHub Copilot CLI, VS Code, Cursor, Windsurf, Cline, Gemini CLI, Goose, Grok, Junie, Kiro, LM Studio, opencode, Amp, Factory, Qodo Gen, Warp, Google Antigravity |
| Category | Browser automation and testing |
| Free tier | Free |
| Cost | Free and open source under Apache-2.0; it runs a browser on your own machine, with no account, key or usage bill. |
| Current prices | https://github.com/microsoft/playwright-mcp |
| Facts checked | 2026-10-02 |

## Connect

Claude Code:

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

Codex:

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

VS Code:

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

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

```
{"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.

## Ask your coding agent

```text
Connect the Playwright MCP server to my coding agent using its documented setup: https://github.com/microsoft/playwright-mcp.
```

## What it 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 2026-10-01. 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`

## When to use it

- 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 it needs

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

## 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.

## Related

### Other MCP servers for browser automation and testing

- [Browser Use](https://cookiesforai.app/mcp/browser-use): The Browser Use MCP server gives AI agents the Browser Use browsing agent, either as a local open-source server with direct browser tools or as a cloud server that runs whole web tasks.
- [Browserbase](https://cookiesforai.app/mcp/browserbase): The Browserbase MCP server gives AI agents a browser that runs in Browserbase's cloud, controlled with plain-language commands through Stagehand: navigate, act on the page, observe elements and extract data.
- [Chrome DevTools](https://cookiesforai.app/mcp/chrome-devtools): The Chrome DevTools MCP server gives AI agents control of a live Chrome browser with DevTools access: performance traces, network requests, console errors, Lighthouse audits, memory snapshots and page automation.

