Playwright MCP tools at a glance
Playwright MCP tools are the functions that Microsoft's official Playwright MCP server gives an AI assistant such as Claude, Copilot or Cursor. The model calls browser_navigate to open a page, browser_snapshot to read its accessibility tree, and browser_click or browser_type to act on the element references in that tree. You type plain English and the assistant picks the tool. This page lists every tool in the current README, what each one does, its key parameters and a prompt that triggers it.
For what the server is and how it fits together, start with the Microsoft Playwright MCP guide. To install it, follow the 5-minute setup guide. This page is the tool reference.
Source and version. These counts and parameter names come from the tool list in the microsoft/playwright-mcp README, which is generated from the code, and the release notes up to v0.0.83 (the latest on npm as of October 2026). The server releases often, so run npx @playwright/mcp@latest --help or ask your assistant to list its tools to confirm what your version exposes.
How the tools work: refs, not pixels
Almost every interaction tool takes a target parameter. It is either an element reference from the latest snapshot (such as e42) or a unique selector. Many also take an optional element, a human-readable description like "Sign in button" that the client shows when it asks you to approve the action.
So the normal loop is: navigate, snapshot, act on a ref, then snapshot again. With the default --snapshot-mode full, action tools return a fresh snapshot in their response, which is why the model rarely needs to call browser_snapshot itself. Tools are also marked read-only or not. Read-only tools such as browser_snapshot, browser_find and browser_network_requests only observe the page.
Core automation tools (on by default)
These 24 tools load with no flags. They cover navigation, reading the page, every common input, waiting, JavaScript, console and network inspection.
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_navigate | Opens a URL. Reports non-2xx status codes and dialogs that open during load. | url | "Go to the staging login page." |
browser_navigate_back | Goes back one page in history. | none | "Go back to the search results." |
browser_snapshot | Captures the accessibility snapshot with element refs. The README calls it "better than screenshot". | target, depth, boxes, filename | "Show me what's on the page." |
browser_find | Searches the snapshot for text or a regex and returns only matching nodes with context. Cheaper than a full snapshot. | text or regex, filename | "Find the Add to cart button." |
browser_click | Clicks an element. Supports double click, right click and modifier keys. | target, element, doubleClick, button, modifiers | "Click Sign in." |
browser_type | Types into an editable element, optionally pressing Enter after. | target, text, submit, slowly | "Type 'playwright' in the search box and press Enter." |
browser_fill_form | Fills several fields in one call. | fields (array) | "Fill the signup form with test data." |
browser_select_option | Picks one or more values in a dropdown. | target, values | "Choose 'Canada' in the country list." |
browser_hover | Hovers over an element. | target | "Hover the Products menu." |
browser_drag | Drags one element onto another. | startTarget, endTarget | "Drag the first card into Done." |
browser_drop | Drops files or MIME-typed data onto an element as if dragged from outside the page. | target, paths or data | "Drop invoice.pdf onto the upload zone." |
browser_press_key | Presses one key or character. | key | "Press Escape to close the modal." |
browser_file_upload | Uploads files to an open file chooser. Omit paths to cancel it. | paths | "Upload avatar.png." |
browser_handle_dialog | Accepts or dismisses an alert, confirm or prompt. | accept, promptText | "Accept the delete confirmation." |
browser_wait_for | Waits for text to appear or disappear, or for a time (capped at 30 s). | text, textGone, time | "Wait until 'Saving...' disappears." |
browser_evaluate | Runs a JavaScript function on the page or on one element. | function, target, filename | "Read the value of localStorage 'theme' with JS." |
browser_run_code_unsafe | Runs a Playwright snippet async (page) => {...} in the server process. The README warns it is RCE-equivalent. | code or filename | "Use Playwright code to click every row's Edit link." |
browser_take_screenshot | Saves a PNG, JPEG or WebP of the viewport, full page or one element. Not usable for actions. | fullPage, target, type, scale, filename | "Take a full-page screenshot of the pricing page." |
browser_console_messages | Returns console messages at a given level and above. | level, all, filename | "Are there any console errors?" |
browser_network_requests | Lists requests since page load, numbered. Static assets are hidden by default. | static, filter (regex) | "List the /api calls this page made." |
browser_network_request | Full headers and body of one request from that list. | index, part | "Show the response body of request 3." |
browser_emulate_media | Emulates color scheme, reduced motion, forced colors, contrast or print media. | colorScheme, reducedMotion, media | "Switch the page to dark mode." |
browser_resize | Resizes the browser window. | width, height | "Resize to 375 by 812 and check the menu." |
browser_close | Closes the page. | none | "Close the browser." |
Tab management (on by default)
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_tabs | Lists, opens, closes or switches tabs. | action, index, url | "Open the docs in a new tab, then switch back." |
Where is browser_install? The README still has a "Browser installation" heading, but it lists no tools in the current version. If an older tutorial tells the model to call browser_install, install browsers yourself with npx playwright install instead, or point the server at an existing browser with --browser chrome or --executable-path.
Test assertion tools (--caps=testing)
This is the group QA engineers want. Without it, the model can click around but has no tool that returns a locator or gives a pass/fail check. With it, the model can ask Playwright for the locator it would use and confirm what is on screen.
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_generate_locator | Returns the Playwright locator for an element, ready to paste into a test. | target, element | "Give me a stable locator for the Checkout button." |
browser_verify_element_visible | Checks an element with a given ARIA role and accessible name is visible. | role, accessibleName | "Verify the 'Order placed' heading is visible." |
browser_verify_text_visible | Checks text is visible. The README says to prefer the element check when possible. | text | "Confirm the page says 'Welcome back'." |
browser_verify_list_visible | Checks a list shows the expected items. | target, element, items | "Check the nav list has Home, Docs and API." |
browser_verify_value | Checks an input's value, or a checkbox state as "true"/"false". | type, target, element, value | "Verify the email field still contains my address." |
DevTools tools (--caps=devtools)
Tracing, video, highlighting and action recording all live in this group. There is no separate tracing capability in the current README: browser_start_tracing and browser_stop_tracing are DevTools tools.
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_start_tracing | Starts a Playwright trace recording. | none | "Start a trace before you log in." |
browser_stop_tracing | Stops the trace so you can open it in Trace Viewer. | none | "Stop tracing and tell me where the file is." |
browser_start_recording | Records what you do in the browser as Playwright code (added in v0.0.80). | none | "Record while I walk through checkout." |
browser_stop_recording | Stops recording and returns the actions as Playwright code. | none | "I'm done. Give me the recorded code." |
browser_start_video | Starts a WebM video, up to 60 fps, with an optional animated cursor. | filename, size, fps, cursor | "Record a video of the signup flow at 60 fps." |
browser_stop_video | Stops the video. | none | "Stop the video." |
browser_video_chapter | Adds a full-screen chapter card to the video. | title, description, duration | "Add a chapter called 'Payment step'." |
browser_video_show_actions | Shows a callout naming each action as it happens. | duration, position, cursor, style | "Label each click in the video." |
browser_video_hide_actions | Turns those callouts off. | none | "Stop labelling actions." |
browser_highlight | Draws a persistent overlay around an element. | target, style | "Highlight the broken image in red." |
browser_hide_highlight | Removes that overlay. | target, element | "Remove the highlight." |
browser_annotate | Opens the Playwright Dashboard so you can draw on the page, then returns the screenshot, snapshot and annotations. | none | "Let me mark the bug on the page." |
browser_resume | Resumes paused script execution, or steps to the next action. | step, location | "Step to the next action." |
Network tools (--caps=network)
Reading requests is core. Changing them (mocks and offline mode) needs this group.
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_route | Mocks requests that match a URL pattern with a status, body and headers. | pattern, status, body, contentType, headers | "Make **/api/cart return 500 and show me the error state." |
browser_route_list | Lists active routes. | none | "Which mocks are active?" |
browser_unroute | Removes routes for a pattern, or all of them. | pattern | "Remove all mocks." |
browser_network_state_set | Switches the browser offline or back online. | state | "Go offline and check the banner." |
Storage tools (--caps=storage)
Cookies, localStorage, sessionStorage and saved storage state. The last two are the ones that matter for staying logged in; see Playwright MCP authentication for the full pattern.
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_storage_state | Saves cookies and localStorage to a file for reuse. | filename | "Save my logged-in session to auth.json." |
browser_set_storage_state | Restores cookies and localStorage from a file. | filename | "Load auth.json and open the dashboard." |
browser_cookie_list | Lists cookies, optionally by domain or path. | domain, path | "What cookies does this site set?" |
browser_cookie_get | Reads one cookie. | name | "Show the session cookie." |
browser_cookie_set | Sets a cookie with optional flags. | name, value, domain, httpOnly, secure, sameSite | "Set consent=accepted so the banner is skipped." |
browser_cookie_delete | Deletes one cookie. | name | "Delete the cart cookie." |
browser_cookie_clear | Clears all cookies. | none | "Clear cookies and reload." |
browser_localstorage_list | Lists all localStorage pairs. | none | "What's in localStorage?" |
browser_localstorage_get | Reads one key. | key | "Read the 'theme' key." |
browser_localstorage_set | Sets one key. | key, value | "Set onboarding_done to true." |
browser_localstorage_delete | Deletes one key. | key | "Remove the 'draft' key." |
browser_localstorage_clear | Clears localStorage. | none | "Clear localStorage." |
browser_sessionstorage_list | Lists all sessionStorage pairs. | none | "Show sessionStorage." |
browser_sessionstorage_get | Reads one key. | key | "Read the 'step' key." |
browser_sessionstorage_set | Sets one key. | key, value | "Set step to 3." |
browser_sessionstorage_delete | Deletes one key. | key | "Delete the 'step' key." |
browser_sessionstorage_clear | Clears sessionStorage. | none | "Clear sessionStorage." |
Coordinate-based tools (--caps=vision)
These act on x/y pixel positions instead of element refs. Use them for canvas apps, maps, charts or anything that has no useful accessibility tree.
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_mouse_click_xy | Clicks at a position. | x, y, button, clickCount | "Click the centre of the canvas." |
browser_mouse_move_xy | Moves the mouse to a position. | x, y | "Move over the chart's last bar." |
browser_mouse_drag_xy | Drags from one position to another. | startX, startY, endX, endY | "Draw a line across the whiteboard." |
browser_mouse_down | Presses a mouse button. | button | "Hold the left button down." |
browser_mouse_up | Releases a mouse button. | button | "Release the mouse." |
browser_mouse_wheel | Scrolls by a delta. | deltaX, deltaY | "Zoom the map in with the wheel." |
PDF and config tools (--caps=pdf, --caps=config)
| Tool | What it does | Key params | Example prompt |
|---|---|---|---|
browser_pdf_save | Saves the page as a PDF. | filename | "Save this invoice page as invoice.pdf." |
browser_get_config | Returns the final config after merging CLI flags, env vars and the config file. | none | "Which browser and caps is the server using?" |
Bonus: webmcp_* tools from the page
Since v0.0.82, if a page registers tools through the experimental WebMCP browser API, the server lists them as real MCP tools named webmcp_<tool>. They follow the current tab, so the list changes as you browse. Their names, descriptions and results come from the page, so the release notes say to treat them as untrusted input. Turn them off with --no-webmcp.
How to enable opt-in tool groups
Pass a comma-separated list to --caps. In an MCP client config the flag goes into args:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": [
"@playwright/mcp@latest",
"--caps=testing,devtools"
]
}
}
}
With the Claude Code CLI, put -- before the server command so Claude Code doesn't try to read --caps as its own flag:
claude mcp add playwright -- npx @playwright/mcp@latest --caps=testing,devtools
You can also set the environment variable PLAYWRIGHT_MCP_CAPS=testing,devtools, or use a config file passed with --config:
{
"capabilities": ["core", "testing", "devtools"],
"browser": { "browserName": "chromium" },
"snapshot": { "mode": "full" }
}
Docs mismatch to know about. The --caps help text in the README only names vision, pdf and devtools, and the config schema comment lists core, pdf, vision and devtools. The generated tool list marks seven opt-in values: testing, devtools, network, storage, vision, pdf and config. After changing caps, restart the server and call browser_get_config (with config enabled) or ask the assistant to list its tools to check what loaded.
Only enable what you need. Every tool's name and schema is sent to the model, so turning on all seven groups adds 47 tool definitions to its context.
Snapshot mode vs vision mode
Playwright MCP is snapshot-first. The README describes it as working on "structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models." Vision is an add-on, not a separate mode you switch to.
| Factor | Snapshot (default) | Vision (--caps=vision) |
|---|---|---|
| What the model sees | Accessibility tree with roles, names and refs | Screenshots, plus the snapshot |
| How it targets | Element ref or selector | x/y pixel coordinates |
| Model needed | Any text model | A model that reads images |
| Stability | Same ref for the same element | Breaks when layout shifts |
| Maps to test code | Yes, via locators | Poorly; coordinates don't make good tests |
| Best for | Forms, apps, test authoring | Canvas, maps, charts, custom widgets |
Related switches: --snapshot-mode none stops action tools from returning a snapshot (the model calls browser_snapshot when it wants one), --snapshot-boxes adds each element's bounding box to snapshots, and --image-responses omit stops screenshots from being sent to the client at all.
Which tools matter most for writing tests
If your goal is a committed .spec.js file rather than a one-off browser task, these are the tools that do the work:
browser_navigate+browser_snapshot: the model learns the real roles and names on the page instead of guessing selectors.browser_find: locates one element without pulling the whole tree, which keeps long sessions cheaper.browser_click,browser_type,browser_fill_form,browser_select_option: walk the flow once so you know it works before it is written down.browser_generate_locator(--caps=testing): returns the locator Playwright would use, so the test usesgetByRole-style locators rather than brittle CSS.browser_verify_*(--caps=testing): confirm the expected outcome live, then turn each check into anexpect().browser_start_recording/browser_stop_recording(--caps=devtools): you click through the flow yourself and get Playwright code back.browser_start_tracing/browser_stop_tracing(--caps=devtools): a trace of the exploration helps when the generated test fails later.
A prompt that uses all of them:
Open https://demo.playwright.dev/todomvc. Add two todos, complete the first, and filter by Active. Use browser_generate_locator for every element you touch and browser_verify_text_visible for the result. Then write tests/todo.spec.js with @playwright/test using those locators.
The --codegen flag sets the language of the Playwright code the server reports (typescript, python, java, csharp or none). Then run the file with npx playwright test like any other test. No MCP is needed at run time. For the end-to-end workflow with Claude, see Playwright MCP Server + Claude AI.
Token cost: why fewer tools is cheaper
Every tool you enable costs context before the model does anything: its name, description and JSON schema are sent with each request. Then each action returns a page snapshot, and on a large page that is the biggest cost. The README itself says coding agents may be better served by the Playwright CLI with skills, because it avoids "loading large tool schemas and verbose accessibility trees into the model context."
- Enable only the
--capsgroups the task needs. - Prefer
browser_findover a fullbrowser_snapshotwhen looking for one element. - Use
depthor atargetonbrowser_snapshot, or save it withfilename. - Try
--snapshot-mode noneor--mobile(the README notes mobile pages are usually lighter).
The numbers are compared in Playwright MCP Server vs CLI: token cost comparison. If you work in Claude Code, also read Playwright CLI for Claude Code.
Learn Playwright + Claude AI
Knowing the tool list is step one. The Playwright + Claude AI & MCP Server course teaches Playwright in JavaScript from scratch, then shows how to drive the MCP server with Claude to explore an app and turn what it finds into tests you commit: Page Object Model, API testing and CI/CD with GitHub Actions included. It's rated 4.5★ from 130+ ratings, with 510+ students enrolled.
Playwright MCP pricing: is it free?
Yes. @playwright/mcp is open source under the Apache 2.0 licence, like Playwright itself, so there is no Playwright MCP pricing tier, licence or per-seat fee. What you do pay for is the AI model on the other end: every tool call sends page context to the LLM, so the real cost is tokens from Claude or whichever model you use. That's why the tool count matters: fewer enabled tools and smaller snapshots mean fewer tokens per step. See the Playwright CLI vs MCP token cost comparison for real numbers. Cloud browsers, if you choose to run the browser remotely, are billed separately by their providers.
Frequently Asked Questions
Is Playwright MCP free?
Yes. The Playwright MCP server (@playwright/mcp) is open source under Apache 2.0 with no paid tier. The cost comes from the AI model you connect it to, which charges for the tokens each tool call uses.
What tools does Playwright MCP have?
As of v0.0.83, Microsoft's @playwright/mcp server lists 72 built-in tools in nine groups: core automation (24), tab management (1), test assertions (5), DevTools (13), network (4), storage (17), coordinate-based vision (6), PDF (1) and configuration (1). Pages that use the experimental WebMCP API can add their own webmcp_ tools on top.
Which Playwright MCP tools are enabled by default?
Only the 24 core automation tools and browser_tabs, 25 in total. That includes browser_navigate, browser_snapshot, browser_find, browser_click, browser_type, browser_fill_form, browser_wait_for, browser_take_screenshot, browser_evaluate, browser_console_messages and browser_network_requests. Every other group is opt-in with --caps.
How do I enable browser_generate_locator and the verify tools?
Add the testing capability. In your MCP client config, put "--caps=testing" in the args array after "@playwright/mcp@latest". With Claude Code, run: claude mcp add playwright -- npx @playwright/mcp@latest --caps=testing. Restart the server and the five testing tools appear.
Does Playwright MCP need screenshots or a vision model?
No. By default the model works from the page's accessibility snapshot and acts on element references, so any text model can use it. The --caps=vision group adds six coordinate-based mouse tools for canvas, maps and other UIs with no useful accessibility tree.
Where did browser_install go?
The current README still has a Browser installation heading but lists no tools under it, so do not rely on browser_install. Install browsers yourself with npx playwright install, or point the server at an installed browser with --browser chrome or --executable-path.
Is there a tracing capability in Playwright MCP?
Not as a separate group. browser_start_tracing and browser_stop_tracing are part of the DevTools group, so enable them with --caps=devtools. The same group adds video recording, element highlighting and browser_start_recording, which turns your own clicks into Playwright code.
Can Playwright MCP tools write a Playwright test file?
The tools drive the browser; the AI assistant writes the file. A good pattern is to have the model explore with browser_snapshot and browser_click, collect locators with browser_generate_locator, check results with the browser_verify tools, then write a @playwright/test spec. You run that spec with npx playwright test, with no MCP or LLM at run time.
Why does Playwright MCP use so many tokens?
Each enabled tool's schema is sent to the model, and action tools return a page snapshot by default. Enable only the --caps groups you need, use browser_find instead of a full snapshot, limit snapshot depth, or try --snapshot-mode none. For coding agents, Microsoft suggests the Playwright CLI with skills as a lighter option.
Asim Noaman
Senior QA Automation Engineer & AI Testing Specialist
With years of hands-on experience building test automation frameworks for production applications, Asim specializes in combining traditional QA methodologies with cutting-edge AI tools. He has helped teams adopt Playwright and AI-driven testing workflows to ship faster with fewer bugs.
Playwright + Claude AI Course
From MCP Tool Calls to Tests You Can Commit
Calling browser tools from a chat is the easy part. Turning that session into a reliable test suite takes Playwright skills. This course teaches Playwright in JavaScript from scratch, then shows you how to use Claude and the Playwright MCP server to generate real, reviewable test files. Rated 4.5★ from 130+ ratings, 510+ students.
- JavaScript from scratch, no prior coding experience needed
- Claude AI + Playwright MCP Server test generation
- Page Object Model, API testing and CI/CD with GitHub Actions
- Debugging failures with traces instead of guessing