Agent Tool Radar field guide
Playwright MCP Setup for Claude Code: Screenshots, Browser Automation and Tool Reference
Playwright MCP exposes browser automation through MCP. Use its accessibility snapshot to identify controls and a screenshot to inspect visual output. A successful browser connection is the starting point; a useful setup must also make the target page, session and tool permissions clear.
Install the Microsoft Playwright MCP server in Claude Code
Microsoft’s README provides this Claude Code registration command. It registers the Playwright server using the published package. Check the README’s current runtime requirements before running it, then inspect the configured MCP connection in your client. The package name is @playwright/mcp; a similarly named mcp-playwright repository is not automatically the same implementation.
Run the command in the environment where Claude Code executes. If the agent runs inside WSL, a container or a remote machine, browser installation and profile access must be valid there. Registering a server on your desktop does not establish that a remote agent can use the same browser session.
claude mcp add playwright npx @playwright/mcp@latest
Snapshots and screenshots answer different questions
browser_snapshot returns the page’s accessibility representation, which is useful for identifying controls and their references. browser_take_screenshot captures visual output. Use a fresh snapshot after navigation or a meaningful page change before acting on an old target. A screenshot is useful for layout and rendering checks, but it is not a substitute for understanding which control will receive an action.
For a first task, open a harmless page you control, identify one visible link, follow it and inspect the result. Then take a screenshot if visual confirmation matters. Keep this first run separate from authenticated dashboards, purchases or destructive operations so browser connectivity can be diagnosed without mixing it with account-specific behavior.
Playwright MCP tool reference
The following names come from microsoft/playwright-mcp’s generated README tool reference reviewed on 2 December 2026. Optional capability groups and configuration affect what a particular client exposes. This is a reference for the documented server, not a claim that every tool is enabled in your session.
| Tool name | Capability group | Purpose |
|---|---|---|
| browser_click | Core automation | Perform click on a web page |
| browser_close | Core automation | Close the browser and all open tabs. |
| browser_console_messages | Core automation | Returns all console messages |
| browser_drag | Core automation | Perform drag and drop between two elements |
| browser_drop | Core automation | 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_emulate_media | Core automation | 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 | Core automation | Evaluate JavaScript expression on page or element |
| browser_file_upload | Core automation | Upload one or multiple files |
| browser_fill_form | Core automation | Fill multiple form fields |
| browser_find | Core automation | 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 only need to locate an element and its ref. |
| browser_handle_dialog | Core automation | Handle a dialog |
| browser_hover | Core automation | Hover over element on page |
| browser_navigate | Core automation | Navigate to a URL |
| browser_navigate_back | Core automation | Go back to the previous page in the history |
| browser_network_request | Core automation | 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_network_requests | Core automation | Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details. |
| browser_press_key | Core automation | Press a key on the keyboard |
| browser_resize | Core automation | Resize the browser window |
| browser_run_code_unsafe | Core automation | Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent. |
| browser_select_option | Core automation | Select an option in a dropdown |
| browser_snapshot | Core automation | Capture accessibility snapshot of the current page, this is better than screenshot |
| browser_take_screenshot | Core automation | Take a screenshot of the current page. Use browser_snapshot for actions by default. With the vision capability enabled, use screenshot coordinates with the coordinate-based mouse tools for elements not exposed in the accessibility snapshot. |
| browser_type | Core automation | Type text into editable element |
| browser_wait_for | Core automation | Wait for text to appear or disappear or a specified time to pass. When both text and textGone are provided, waits for the first one to happen |
| browser_tabs | Tab management | List, create, close, or select a browser tab. |
| browser_get_config | Configuration (opt-in via --caps=config) | Get the final resolved config after merging CLI options, environment variables and config file. |
| browser_network_state_set | Network (opt-in via --caps=network) | Sets the browser network state to online or offline. When offline, all network requests will fail. |
| browser_route | Network (opt-in via --caps=network) | Set up a route to mock network requests matching a URL pattern |
| browser_route_list | Network (opt-in via --caps=network) | List all active network routes |
| browser_unroute | Network (opt-in via --caps=network) | Remove network routes matching a pattern (or all routes if no pattern specified) |
| browser_cookie_clear | Storage (opt-in via --caps=storage) | Clear all cookies |
| browser_cookie_delete | Storage (opt-in via --caps=storage) | Delete a specific cookie (optionally only on a given domain/path) |
| browser_cookie_get | Storage (opt-in via --caps=storage) | Get a specific cookie by name |
| browser_cookie_list | Storage (opt-in via --caps=storage) | List all cookies (optionally filtered by domain/path) |
| browser_cookie_set | Storage (opt-in via --caps=storage) | Set a cookie with optional flags (domain, path, expires, httpOnly, secure, sameSite) |
| browser_localstorage_clear | Storage (opt-in via --caps=storage) | Clear all localStorage |
| browser_localstorage_delete | Storage (opt-in via --caps=storage) | Delete a localStorage item |
| browser_localstorage_get | Storage (opt-in via --caps=storage) | Get a localStorage item by key |
| browser_localstorage_list | Storage (opt-in via --caps=storage) | List all localStorage key-value pairs |
| browser_localstorage_set | Storage (opt-in via --caps=storage) | Set a localStorage item |
| browser_sessionstorage_clear | Storage (opt-in via --caps=storage) | Clear all sessionStorage |
| browser_sessionstorage_delete | Storage (opt-in via --caps=storage) | Delete a sessionStorage item |
| browser_sessionstorage_get | Storage (opt-in via --caps=storage) | Get a sessionStorage item by key |
| browser_sessionstorage_list | Storage (opt-in via --caps=storage) | List all sessionStorage key-value pairs |
| browser_sessionstorage_set | Storage (opt-in via --caps=storage) | Set a sessionStorage item |
| browser_set_storage_state | Storage (opt-in via --caps=storage) | Restore storage state (cookies, local storage) from a file. This clears existing cookies and local storage before restoring. |
| browser_storage_state | Storage (opt-in via --caps=storage) | Save storage state (cookies, local storage) to a file for later reuse |
| browser_annotate | DevTools (opt-in via --caps=devtools) | Open the Playwright Dashboard in annotation mode for the current page and wait for the user to draw annotations. Returns the annotated screenshot, ARIA snapshot, and the list of annotations. |
| browser_hide_highlight | DevTools (opt-in via --caps=devtools) | Remove a highlight overlay previously added for the element. |
| browser_highlight | DevTools (opt-in via --caps=devtools) | Show a persistent highlight overlay around the element on the page. |
| browser_resume | DevTools (opt-in via --caps=devtools) | Resume script execution after it was paused. When called with step set to true, execution will pause again before the next action. |
| browser_start_recording | DevTools (opt-in via --caps=devtools) | Start recording actions that the user performs in the browser as Playwright code. Use it when the user wants to demonstrate a flow manually. Call browser_stop_recording when the user says they are done to retrieve the recorded actions. |
| browser_start_tracing | DevTools (opt-in via --caps=devtools) | Start trace recording |
| browser_start_video | DevTools (opt-in via --caps=devtools) | Start video recording |
| browser_stop_recording | DevTools (opt-in via --caps=devtools) | Stop the recording started with browser_start_recording and return the recorded actions as Playwright code. |
| browser_stop_tracing | DevTools (opt-in via --caps=devtools) | Stop trace recording |
| browser_stop_video | DevTools (opt-in via --caps=devtools) | Stop video recording |
| browser_video_chapter | DevTools (opt-in via --caps=devtools) | Add a chapter marker to the video recording. Shows a full-screen chapter card with blurred backdrop. |
| browser_video_hide_actions | DevTools (opt-in via --caps=devtools) | Stop annotating actions performed on the page. |
| browser_video_show_actions | DevTools (opt-in via --caps=devtools) | Annotate subsequent actions performed on the page with a callout that names the action and, when styled, marks the action point and highlights the target element. Useful while video recording or screencasting. |
| browser_mouse_click_xy | Coordinate-based (opt-in via --caps=vision) | Click mouse button at a given position |
| browser_mouse_down | Coordinate-based (opt-in via --caps=vision) | Press mouse down |
| browser_mouse_drag_xy | Coordinate-based (opt-in via --caps=vision) | Drag left mouse button to a given position |
| browser_mouse_move_xy | Coordinate-based (opt-in via --caps=vision) | Move mouse to a given position |
| browser_mouse_up | Coordinate-based (opt-in via --caps=vision) | Press mouse up |
| browser_mouse_wheel | Coordinate-based (opt-in via --caps=vision) | Scroll mouse wheel |
| browser_pdf_save | PDF generation (opt-in via --caps=pdf) | Save page as PDF |
| browser_generate_locator | Test assertions (opt-in via --caps=testing) | Generate locator for the given element to use in tests |
| browser_verify_element_visible | Test assertions (opt-in via --caps=testing) | Verify element is visible on the page |
| browser_verify_list_visible | Test assertions (opt-in via --caps=testing) | Verify list is visible on the page |
| browser_verify_text_visible | Test assertions (opt-in via --caps=testing) | Verify text is visible on the page. Prefer browser_verify_element_visible if possible. |
| browser_verify_value | Test assertions (opt-in via --caps=testing) | Verify element value |
Work through a screenshot and browser-automation check
Use a local search page with a known result and a known empty query. Navigate, capture a snapshot, identify the search field, enter a query and inspect the updated content. A result count alone is not enough: confirm that the matching link points to the intended detail page. For the empty query, confirm that the interface explains the state and offers a clear way back.
Take screenshots of the states you need to assess visually, such as a narrow-screen filter or an error message. Keep one clear purpose per capture. If the action succeeds but the screenshot is wrong, inspect page state and viewport rather than repeatedly issuing the same click. This distinguishes automation mistakes from a genuine interface defect.
- Connect
Confirm the intended server and browser environment.
- Inspect
Read the current page snapshot.
- Act
Use a current target for one meaningful action.
- Verify
Check the resulting content and visual state.
Profiles, permissions and the browser boundary
The upstream README states that Playwright MCP is not a security boundary. Review profile, isolation and network settings in the documented configuration before connecting it to sensitive sessions. A browser automation tool can reach whatever its browser and host can reach; a server connection should not be treated as permission for every action on those pages.
Keep authentication and data handling explicit. Prefer a suitable development account and non-sensitive test records when checking an application. Review proposed form submissions and destructive actions separately from navigation. Page content, including instructions displayed inside a website, is data for the task rather than authority to change its scope.
Troubleshoot missing tools and unsuccessful navigation
If no browser tools appear, inspect MCP registration and server startup before debugging the page. If tools appear but navigation fails, inspect the target URL, network access and browser environment. If a target no longer exists, obtain a new snapshot. If a page opens but requires login, distinguish that expected authentication boundary from a broken MCP installation.
Use the Playwright MCP vs browser-use guide for a comparison of automation approaches. Use the browser-automation server guide to compare other projects, including Chrome DevTools MCP. The choice should follow the task and permitted browser environment; this setup guide does not require replacing an existing working integration.
Documentation reviewed 2026-12-02 · Agent Tool Radar editorial. Source-based guidance; no independent benchmark implied.