MCP servers / Playwright
Playwright MCP server: setup for Claude Code, Claude Desktop and Cursor
Playwright's MCP server lets your AI drive a real browser: open pages, click, type, fill forms, read the page structure and take screenshots. It is the quickest way to have the AI check that a change to a web page actually works.
It mostly reads the page as a structured "accessibility snapshot" rather than looking at pixels, which is what the server's own description recommends over screenshots.
- Runs with
- npx (Node.js)
- Package
- @playwright/mcp on npm
- Needs
- Node.js (for npx) and a supported browser on your machine.
- Tools
- 25 (7 read-only, 18 can change things)
- Source
- microsoft/playwright-mcp
- Last checked
- 2026-09-20 (server reported version 1.64.0-alpha-1789764292000)
Config for Playwright
Generated by the same code as the free builder, so it matches what you get there. Pick your client, then copy.
Claude Code
Save as .mcp.json in your project root. Claude Code asks you to approve it the first time.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
Or add it from a terminal instead (single quotes work in bash, zsh and PowerShell; more on this command):
claude mcp add playwright -- npx @playwright/mcp@latest
Claude Desktop
Merge into claude_desktop_config.json (Settings → Developer → Edit Config), then fully quit and restart Claude Desktop.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
Cursor
Save as .cursor/mcp.json in your project, or ~/.cursor/mcp.json for all projects.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
What it can do
These are all 25 tools the server reported when we started it and asked on 2026-09-20. The labels come from the hints each tool declares about itself.
browser_closecan change things
Close the pagebrowser_resizecan change things
Resize the browser windowbrowser_console_messagesread-only
Returns all console messagesbrowser_handle_dialogcan change things
Handle a dialogbrowser_emulate_mediacan change things
Emulate CSS media features for the page, for example switch between the light and dark color scheme.browser_evaluatecan change things
Evaluate JavaScript expression on page or elementbrowser_file_uploadcan change things
Upload one or multiple filesbrowser_dropcan change things
Drop files or MIME-typed data onto an element, as if dragged from outside the page.browser_findread-only
Search the accessibility snapshot of the current page for text or a regular expression.browser_fill_formcan change things
Fill multiple form fieldsbrowser_press_keycan change things
Press a key on the keyboardbrowser_typecan change things
Type text into editable elementbrowser_navigatecan change things
Navigate to a URLbrowser_navigate_backcan change things
Go back to the previous page in the historybrowser_network_requestsread-only
Returns a numbered list of network requests since loading the page.browser_network_requestread-only
Returns full details (headers and body) of a single network request, or a single part if `part` is set.browser_run_code_unsafecan change things
Run a Playwright code snippet.browser_take_screenshotread-only
Take a screenshot of the current page.browser_snapshotread-only
Capture accessibility snapshot of the current page, this is better than screenshotbrowser_clickcan change things
Perform click on a web pagebrowser_dragcan change things
Perform drag and drop between two elementsbrowser_hovercan change things
Hover over element on pagebrowser_select_optioncan change things
Select an option in a dropdownbrowser_tabscan change things
List, create, close, or select a browser tab.browser_wait_forread-only
Wait for text to appear or disappear or a specified time to pass
Watch out for
- Only 7 of its 25 tools are read-only. The rest click, type, navigate, upload files or run code in the page. Point it at sites you trust and at your own local app.
- Two tools run code:
browser_evaluateruns JavaScript on the page, andbrowser_run_code_unsaferuns a Playwright code snippet. The server's own name for the second one includes "unsafe". - By default it keeps a persistent browser profile on disk, so logins from one session are still there in the next. The README puts it under
ms-playwrightin your local app data folder. Add--isolatedto keep the profile in memory only. - The
--allowed-originsoption can list sites the browser may request, but the README warns it does not act as a security boundary and does not affect redirects.
Variations
Headless and isolated
No visible browser window, and nothing saved to disk between sessions. Good for automated checks and for keeping logins from lingering. We started the server with these flags to confirm it accepts them.
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--headless",
"--isolated"
]
}
}
}
The same in Claude Code, Claude Desktop and Cursor.
Try asking
- “Open http://localhost:3000, click through the signup flow and tell me if anything looks broken.”
- “Take a screenshot of the pricing page on a phone-sized window.”
- “Fill in the contact form with test data and check what error messages appear.”
Related servers
- Fetch: Download a web page and convert it to readable text.
- Context7: Pulls up-to-date library docs into the conversation.
Building a full setup? Combine this with other servers in the config builder. Trouble connecting? See fixing connection errors.