Skip to main content
MCP server CX Codex

Playwright — Claude Code MCP server: browser automation via the accessibility tree

Playwright gives an agent control of a browser through structured accessibility snapshots rather than screenshots. Fits testing, scraping and page walks where no vision model is available.

Apache-2.0 ★ 39,981 updated 2026-10-22

Open on GitHub

What Playwright does

The server shows the agent a page as an accessibility tree: headings, buttons, fields and links appear as structure, not pixels. The model clicks, types and reads text without relying on vision. That removes the guesswork of screenshot-based approaches.

Under the hood sits Playwright on Node.js, launched with one command: npx @playwright/mcp@latest. Node.js 18 or newer is required. The server stays lightweight because it never touches pixel data.

For coding agents juggling large codebases, the author points to the CLI version: MCP pays off when you need a persistent browser context and iterative reasoning over page state, not a one-shot run.

What it helps with

  • give an agent a browser without a vision model
  • click buttons and fill forms from page structure
  • pull data off pages through the accessibility tree
  • keep a browser open for long autonomous workflows
  • write self-healing tests that read page state

Example prompts for the agent

  • Open example.com and list every link that has the class nav-link.
  • Fill in the login form and check what greeting appears after sign-in.
  • Walk the catalogue page and collect all product names into a list.

How to install Playwright

Install

The MCP registry has no launch command for it: see the repository README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about Playwright

How do I install Playwright MCP in Claude Code?

Run claude mcp add playwright npx @playwright/mcp@latest in your terminal. The server is then available to the agent in the Claude Code session.

What is the difference between Playwright MCP and Playwright CLI?

MCP holds a persistent browser context and feeds the agent an accessibility tree. The CLI version acts through individual commands and is lighter on context, so the author suggests it for coding agents that need browser work alongside big codebases.

What do I need to run it?

Node.js 18 or newer plus any MCP client: VS Code, Cursor, Claude Desktop, Goose and others. Launching goes through npx; no extra flags are needed.

Similar MCP servers

All MCP servers for Testing and QA →

Project sponsors

Companies that keep this analytics open