---
title: "Playwright MCP server: when to use it | Bombos"
description: "Microsoft's Playwright MCP server lets an AI agent drive a browser through the accessibility tree. Useful for checks and debugging; not a security boundary."
image: "https://bombos.ai/assets/og-en-v2.png"
---

# What is the Playwright MCP server, and when should a team use it?

Short answer

Playwright MCP is Microsoft's open source MCP server that lets an AI agent drive a real browser with Playwright. It works from the page's accessibility tree instead of screenshots, so a text model can use pages. It runs with npx @playwright/mcp@latest in Claude Code, Cursor, Codex and VS Code. Microsoft says it is not a security boundary, and that for coding agents a CLI with skills is often more token-efficient.

*Piet Baudoin · published November 17, 2026 · November 17, 2026*

## How it works

Playwright is Microsoft’s browser automation framework. Playwright MCP wraps it as an MCP server, so an AI agent gets tools such as “navigate”, “click”, “type” and “take snapshot”.

The key design choice: it does not show the model pixels. It gives the model the page’s accessibility tree, a structured list of buttons, links, fields and text, the same structure screen readers use. The agent reads that with `browser_snapshot`, picks an element and acts on it. That works with any text model and is more reliable than guessing coordinates on a screenshot. When an element is missing from the tree, the optional `--caps=vision` adds coordinate-based mouse tools. `browser_take_screenshot` exists too, but only for looking.

## Setting it up

| Step | What to do |
| --- | --- |
| Requirement | Node.js 18 or newer |
| Claude Code | `claude mcp add playwright npx @playwright/mcp@latest` |
| Other clients | Add an `mcpServers` entry that runs `npx @playwright/mcp@latest`; the README lists VS Code, Cursor, Codex, Copilot CLI, Gemini CLI, Claude Desktop, Grok, Windsurf and more |
| Headless | `--headless` (the default is a visible browser) |
| Clean state | `--isolated` keeps the profile in memory only |
| Specific login state | `--storage-state` loads cookies and local storage into an isolated context |
| Your own browser | `--extension` with the Playwright Extension connects to a running Chrome or Edge |

Two defaults to know. The browser profile is persistent, stored under `ms-playwright` in your cache directory, so logins survive between sessions. And only one browser can use a profile at a time, so parallel agents need `--isolated` or separate `--user-data-dir` values.

Playwright’s own documentation describes the same server from the user’s side: it works on “structured accessibility snapshots”, so “no vision models required”, and the model clicks elements by reference (such as `ref=e5`) rather than by pixel. Screenshots exist, but for visual checks, not for driving the page.

## MCP or CLI: Microsoft’s own advice

The README is candid: coding agents increasingly prefer CLI-based workflows with skills, because MCP loads large tool schemas and accessibility trees into the context. Microsoft recommends MCP for loops that need persistent browser state, rich page inspection, or long-running autonomous work, where keeping the browser context matters more than token cost.

In practice:

1.  **Exploring a bug, checking a flow, debugging a form:** Playwright MCP is a good fit. The agent sees the live page and can try things.
2.  **Regression tests that must run on every commit:** write Playwright tests and run them in CI. The agent can help write them; it should not be the test.
3.  **Short, repeated tasks in a coding agent:** consider the CLI and skills route the README mentions, to save context.

## The common misunderstanding: safety

Because it is from Microsoft, teams assume Playwright MCP is safe by default. The README says plainly that it is **not** a security boundary. Some specifics:

-   `--allowed-origins` and `--blocked-origins` limit browser requests, but the README says they are not a security boundary and do not cover redirects.
-   `browser_run_code_unsafe` runs arbitrary JavaScript in the server process; the README calls it equivalent to remote code execution.
-   The `secrets` and `redactUrlParams` options are conveniences, not security features.

The bigger risk is what the agent reads. A web page is untrusted input. An agent that browses a page with hidden instructions and also has access to your other tools can be steered by that page. Keep browsing agents away from production credentials, use `--isolated`, and be careful with `--extension`, which hands the agent your logged-in sessions. More in [is MCP safe to use in a company](https://bombos.ai/en/questions/mcp/is-mcp-safe-to-use-in-a-company/).

## What this means for a team

Put Playwright MCP in the shared project config for the developers and testers who use it (see [MCP servers in Claude Code for a team](https://bombos.ai/en/questions/mcp/claude-code-mcp-servers-for-a-team/)), with `--isolated` as the team default. Agree that it is for exploring and debugging, and that anything that must keep working becomes a real test. And note that what the agent learns about your app while clicking through it, which flows are fragile or which test account to use, disappears at the end of the session unless someone writes it down.

## Where Bombos fits

Playwright MCP gives the agent a browser; Bombos gives every AI tool in the team a shared memory, so what one agent learned about your app reaches the next. It is a plugin for Claude Code, Cursor, Codex, Copilot and your other AI tools, with team knowledge, rules the AI learned from corrections, and what already sits in repos, documents and mail, with a trail of what each answer rests on. It runs in our cloud or on your own server, and one developer can try it first with their own agents.

## Related questions

How do I add Playwright MCP to Claude Code?

Run claude mcp add playwright npx @playwright/mcp@latest. It needs Node.js 18 or newer. Use --scope project to share it with the team through .mcp.json.

Does Playwright MCP need a vision model?

No. By default it uses the accessibility tree through browser\_snapshot. The optional vision capability (--caps=vision) adds coordinate-based mouse tools for elements that are missing from the snapshot.

Can Playwright MCP use my logged-in browser?

Yes, with the --extension option and the Playwright Extension it connects to a running Chrome or Edge and uses your existing tabs and sessions. Think twice before giving an agent that access.

Does Playwright MCP replace writing Playwright tests?

No. The agent explores and checks pages in a session; a written test runs the same way every time in CI. Many teams use the agent to help write tests, then run the tests without the agent.

Why does the browser remember my logins between sessions?

By default Playwright MCP uses a persistent profile in your cache directory. Use --isolated to keep the profile in memory only, or --storage-state to load a specific state.

## Sources

1.  [microsoft/playwright-mcp (GitHub README)](https://github.com/microsoft/playwright-mcp)
2.  [Getting started with Playwright MCP (playwright.dev)](https://playwright.dev/docs/getting-started-mcp)

## What does your AI forget?

1.  01You tell us which AI you use and where it keeps starting over.
2.  02We show what a shared memory changes there, on your own examples.
3.  03You keep the plan, with or without Bombos.

![Piet Baudoin](https://bombos.ai/assets/team/piet-klein.jpg)

**Piet Baudoin**You talk to Piet, from the Bombos teamDutch team from Utrecht and Nijmegen · data in Europe

## More questions about MCP

-   [What is the Azure MCP Server and how should a team use it?](https://bombos.ai/en/questions/mcp/azure-mcp-server/)
-   [Local vs remote MCP server: which should a team use?](https://bombos.ai/en/questions/mcp/local-vs-remote-mcp-server/)
-   [What is the GitHub MCP server and how should a team set it up?](https://bombos.ai/en/questions/mcp/github-mcp-server/)
-   [What is the Graphiti MCP server and is it safe to use for a team?](https://bombos.ai/en/questions/mcp/graphiti-mcp-server-setup-and-limits/)
-   [What is the Context7 MCP server, and what does it not do for a team?](https://bombos.ai/en/questions/mcp/context7-mcp-server/)
-   [How do you connect Claude or ChatGPT to Salesforce with an MCP server?](https://bombos.ai/en/questions/mcp/salesforce-mcp-server/)
-   [Is there an official Slack MCP server, and what can the AI see?](https://bombos.ai/en/questions/mcp/slack-mcp-server/)
-   [What is an MCP memory server and how does it work?](https://bombos.ai/en/questions/mcp/what-is-an-mcp-memory-server/)

[All questions about MCP →](https://bombos.ai/en/questions/mcp/)


---

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://bombos.ai/#organization","name":"Bombos","url":"https://bombos.ai/","logo":"https://bombos.ai/assets/bombos-bee.png","description":"Bombos is the memory layer under every AI your team uses. One shared memory for Claude, ChatGPT, Copilot, Cursor and your own agents, that learns how you work.","sameAs":["https://www.linkedin.com/company/bombos-ai","https://www.youtube.com/@truebombos","https://www.instagram.com/truebombos/","https://bsky.app/profile/bombostrue.bsky.social","https://www.threads.com/@truebombos","https://mastodon.social/@Bombos","https://www.tiktok.com/@truebombos","https://t.me/truebombos","https://www.pinterest.com/truebombos/","https://github.com/bombos-ai","https://linktr.ee/bombos.ai","https://bombosai.substack.com","https://hashnode.com/@bombosai","https://hackernoon.com/u/bombos","https://dev.to/bombos"],"email":"info@bombos.ai","areaServed":["NL","Europe"],"knowsLanguage":["nl","en"],"contactPoint":{"@type":"ContactPoint","email":"info@bombos.ai","contactType":"sales","url":"https://bombos.ai/en/contact/","availableLanguage":["nl","en"]}},{"@type":"WebSite","@id":"https://bombos.ai/#website","name":"Bombos","url":"https://bombos.ai/","inLanguage":["nl-NL","en"],"publisher":{"@id":"https://bombos.ai/#organization"}}]}

{"@context":"https://schema.org","@type":"Article","headline":"What is the Playwright MCP server, and when should a team use it?","description":"Microsoft's Playwright MCP server lets an AI agent drive a browser through the accessibility tree. Useful for checks and debugging; not a security boundary.","abstract":"Playwright MCP is Microsoft's open source MCP server that lets an AI agent drive a real browser with Playwright. It works from the page's accessibility tree instead of screenshots, so a text model can use pages. It runs with npx @playwright/mcp@latest in Claude Code, Cursor, Codex and VS Code. Microsoft says it is not a security boundary, and that for coding agents a CLI with skills is often more token-efficient.","datePublished":"2026-11-17T00:00:00.000Z","dateModified":"2026-11-17T00:00:00.000Z","author":{"@type":"Person","name":"Piet Baudoin"},"publisher":{"@type":"Organization","@id":"https://bombos.ai/#organization","name":"Bombos","logo":{"@type":"ImageObject","url":"https://bombos.ai/assets/bombos-bee.png"}},"image":"https://bombos.ai/assets/og-en-v2.png","mainEntityOfPage":"https://bombos.ai/en/questions/mcp/playwright-mcp-server/","inLanguage":"en-US","isPartOf":{"@type":"CollectionPage","name":"MCP","url":"https://bombos.ai/en/questions/mcp/"},"citation":[{"@type":"CreativeWork","name":"microsoft/playwright-mcp (GitHub README)","url":"https://github.com/microsoft/playwright-mcp"},{"@type":"CreativeWork","name":"Getting started with Playwright MCP (playwright.dev)","url":"https://playwright.dev/docs/getting-started-mcp"}]}

{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Bombos","item":"https://bombos.ai/en/"},{"@type":"ListItem","position":2,"name":"Questions","item":"https://bombos.ai/en/questions/"},{"@type":"ListItem","position":3,"name":"MCP","item":"https://bombos.ai/en/questions/mcp/"},{"@type":"ListItem","position":4,"name":"What is the Playwright MCP server, and when should a team use it?","item":"https://bombos.ai/en/questions/mcp/playwright-mcp-server/"}]}

{"@context":"https://schema.org","@type":"FAQPage","mainEntity":[{"@type":"Question","name":"How do I add Playwright MCP to Claude Code?","acceptedAnswer":{"@type":"Answer","text":"Run claude mcp add playwright npx @playwright/mcp@latest. It needs Node.js 18 or newer. Use --scope project to share it with the team through .mcp.json."}},{"@type":"Question","name":"Does Playwright MCP need a vision model?","acceptedAnswer":{"@type":"Answer","text":"No. By default it uses the accessibility tree through browser_snapshot. The optional vision capability (--caps=vision) adds coordinate-based mouse tools for elements that are missing from the snapshot."}},{"@type":"Question","name":"Can Playwright MCP use my logged-in browser?","acceptedAnswer":{"@type":"Answer","text":"Yes, with the --extension option and the Playwright Extension it connects to a running Chrome or Edge and uses your existing tabs and sessions. Think twice before giving an agent that access."}},{"@type":"Question","name":"Does Playwright MCP replace writing Playwright tests?","acceptedAnswer":{"@type":"Answer","text":"No. The agent explores and checks pages in a session; a written test runs the same way every time in CI. Many teams use the agent to help write tests, then run the tests without the agent."}},{"@type":"Question","name":"Why does the browser remember my logins between sessions?","acceptedAnswer":{"@type":"Answer","text":"By default Playwright MCP uses a persistent profile in your cache directory. Use --isolated to keep the profile in memory only, or --storage-state to load a specific state."}}]}
```
