Playwright MCP: give your AI agent a real browser
The Model Context Protocol lets an agent like Claude Code use tools. With Playwright MCP, one of those tools is a full browser.
What MCP is, in one paragraph
The Model Context Protocol is an open standard for connecting AI assistants to tools and data. An "MCP server" offers a set of tools; an MCP-capable agent — Claude Code, for example — can call them. Playwright MCP is an MCP server whose tools control a browser.
Why it works well
Instead of guessing from screenshots, Playwright MCP gives the model a structured view of the page (based on its accessibility tree), so the agent can target buttons and fields reliably and cheaply. It can also take screenshots when it needs to look.
Adding it to Claude Code
claude mcp add playwright npx @playwright/mcp@latest
Then just ask in plain language: "open our staging site, sign up with a test account and tell me if the welcome email link works." Check the Playwright MCP README for current options such as headless mode or using a persistent profile.
What people use it for
- Testing their own app — the agent clicks through flows after it changes code.
- Research — reading and summarising pages across many sites.
- Data collection — gathering listings, prices or contacts into a spreadsheet.
- Web chores — filling forms, updating dashboards, checking a site is up.
Laptop vs server
On a laptop, the browser closes when you do. On an always-on server, the agent's browser keeps its logins, runs scheduled jobs, and can be watched live from any device. With a live view you can step in when a site asks a human question — then hand control back.
Safety tips
- Give the agent its own browser profile, not the one with your personal accounts.
- Use separate, least-privilege logins for the sites it works on.
- Review anything that sends money, emails customers or deletes data.
Common questions
What is Playwright MCP?
Playwright MCP is an MCP (Model Context Protocol) server from Microsoft that exposes browser automation as tools an AI agent can call — navigate, click, type and read pages.
How do I add Playwright MCP to Claude Code?
Run: claude mcp add playwright npx @playwright/mcp@latest — then ask Claude Code to do browser tasks in plain language. See the Playwright MCP README for current options.
Does Playwright MCP need screenshots?
Not usually. It gives the model a structured snapshot of the page based on its accessibility tree, which is faster and more reliable than working from images, and can still take screenshots when needed.
Claude and Claude Code are products of Anthropic; Playwright and Playwright MCP are Microsoft projects. WebHand is independent and not affiliated with either.
Skip the setup — get a ready-made agent machine
We set up a dedicated 64 GB machine with a live browser, an online terminal and a chat agent (Claude Code-ready — you use your own Claude subscription or API key), on your own domain and secured for you. Access emailed within 24 hours, plus a month of support.
Get set up — $1,000