
DEV · Dev Tools · Official server
Playwright
Browser automation for agents using Playwright accessibility snapshots.
- Transport
- Local (stdio)
- Status
- Official · Microsoft
- Auth method
- None (local browser)
- Scopes / permissions
- —
- Last verified
- Oct 15, 2026
- Tools (live)
- 25
§1What it does
Microsoft's Playwright MCP server lets LLMs drive a browser through structured accessibility snapshots rather than screenshots, for fast, deterministic web automation and testing.
§2Setup
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["@playwright/mcp@latest"]
}
}
}claude mcp add playwright npx @playwright/mcp@latestSnippets adapted from the official documentation. Check the official page for current options and auth requirements.
§2aTools (live-checked Oct 16, 2026)
Returned by the server's own tools/list via npx @playwright/mcp@latest. No credentials used; no tools were called.
browser_close— Close the pagebrowser_resize— Resize the browser windowbrowser_console_messages— Returns all console messagesbrowser_handle_dialog— Handle a dialogbrowser_emulate_media— Emulate CSS media features for the page, for example switch between the light and dark color scheme. Omitted parameters are left unchanged; null clears an override.browser_evaluate— Evaluate JavaScript expression on page or elementbrowser_file_upload— Upload one or multiple filesbrowser_drop— Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.browser_find— Search the accessibility snapshot of the current page for text or a regular expression. Returns matching snapshot nodes with a few lines of surrounding context (like search snippets), each shown under its path from the root of the tree, which is cheaper than capturing the whole snapshot when you onlbrowser_fill_form— Fill multiple form fieldsbrowser_press_key— Press a key on the keyboardbrowser_type— Type text into editable elementbrowser_navigate— Navigate to a URLbrowser_navigate_back— Go back to the previous page in the historybrowser_network_requests— Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.browser_network_request— Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.browser_run_code_unsafe— Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.browser_take_screenshot— Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.browser_snapshot— Capture accessibility snapshot of the current page, this is better than screenshotbrowser_click— Perform click on a web pagebrowser_drag— Perform drag and drop between two elementsbrowser_hover— Hover over element on pagebrowser_select_option— Select an option in a dropdownbrowser_tabs— List, create, close, or select a browser tab.browser_wait_for— Wait for text to appear or disappear or a specified time to pass
§3Prompts to try
- “Open localhost:3000, sign up with a test account and report any errors.”
- “Fill out the contact form on this page.”