MCP Reference October 30, 2026 14 min read

Playwright MCP Tools: Every Tool, With Examples

The full list of Playwright MCP tools in Microsoft's @playwright/mcp server: which 25 load by default, which groups you switch on with --caps, the parameters each tool takes, and a plain-English prompt that triggers it. Plus the handful of tools that matter most when you want real Playwright tests out of an AI session.

🧰

Quick answer

Microsoft's @playwright/mcp server (v0.0.83) ships 72 built-in tools in nine groups. Only 25 are on by default: 24 core automation tools plus browser_tabs. The other 47 (config, network, storage, devtools, vision, pdf and testing) are opt-in with --caps.

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.

24Core automationDefault
1Tab managementDefault
5Test assertions--caps=testing
13DevTools--caps=devtools
4Network--caps=network
17Storage--caps=storage
6Coordinate (vision)--caps=vision
1PDF generation--caps=pdf
1Configuration--caps=config

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)

Default24 tools

These 24 tools load with no flags. They cover navigation, reading the page, every common input, waiting, JavaScript, console and network inspection.

ToolWhat it doesKey paramsExample prompt
browser_navigateOpens a URL. Reports non-2xx status codes and dialogs that open during load.url"Go to the staging login page."
browser_navigate_backGoes back one page in history.none"Go back to the search results."
browser_snapshotCaptures 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_findSearches 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_clickClicks an element. Supports double click, right click and modifier keys.target, element, doubleClick, button, modifiers"Click Sign in."
browser_typeTypes into an editable element, optionally pressing Enter after.target, text, submit, slowly"Type 'playwright' in the search box and press Enter."
browser_fill_formFills several fields in one call.fields (array)"Fill the signup form with test data."
browser_select_optionPicks one or more values in a dropdown.target, values"Choose 'Canada' in the country list."
browser_hoverHovers over an element.target"Hover the Products menu."
browser_dragDrags one element onto another.startTarget, endTarget"Drag the first card into Done."
browser_dropDrops 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_keyPresses one key or character.key"Press Escape to close the modal."
browser_file_uploadUploads files to an open file chooser. Omit paths to cancel it.paths"Upload avatar.png."
browser_handle_dialogAccepts or dismisses an alert, confirm or prompt.accept, promptText"Accept the delete confirmation."
browser_wait_forWaits for text to appear or disappear, or for a time (capped at 30 s).text, textGone, time"Wait until 'Saving...' disappears."
browser_evaluateRuns a JavaScript function on the page or on one element.function, target, filename"Read the value of localStorage 'theme' with JS."
browser_run_code_unsafeRuns 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_screenshotSaves 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_messagesReturns console messages at a given level and above.level, all, filename"Are there any console errors?"
browser_network_requestsLists requests since page load, numbered. Static assets are hidden by default.static, filter (regex)"List the /api calls this page made."
browser_network_requestFull headers and body of one request from that list.index, part"Show the response body of request 3."
browser_emulate_mediaEmulates color scheme, reduced motion, forced colors, contrast or print media.colorScheme, reducedMotion, media"Switch the page to dark mode."
browser_resizeResizes the browser window.width, height"Resize to 375 by 812 and check the menu."
browser_closeCloses the page.none"Close the browser."

Tab management (on by default)

Default1 tool
ToolWhat it doesKey paramsExample prompt
browser_tabsLists, 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)

--caps=testing5 tools

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.

ToolWhat it doesKey paramsExample prompt
browser_generate_locatorReturns 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_visibleChecks an element with a given ARIA role and accessible name is visible.role, accessibleName"Verify the 'Order placed' heading is visible."
browser_verify_text_visibleChecks text is visible. The README says to prefer the element check when possible.text"Confirm the page says 'Welcome back'."
browser_verify_list_visibleChecks a list shows the expected items.target, element, items"Check the nav list has Home, Docs and API."
browser_verify_valueChecks 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)

--caps=devtools13 tools

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.

ToolWhat it doesKey paramsExample prompt
browser_start_tracingStarts a Playwright trace recording.none"Start a trace before you log in."
browser_stop_tracingStops the trace so you can open it in Trace Viewer.none"Stop tracing and tell me where the file is."
browser_start_recordingRecords what you do in the browser as Playwright code (added in v0.0.80).none"Record while I walk through checkout."
browser_stop_recordingStops recording and returns the actions as Playwright code.none"I'm done. Give me the recorded code."
browser_start_videoStarts 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_videoStops the video.none"Stop the video."
browser_video_chapterAdds a full-screen chapter card to the video.title, description, duration"Add a chapter called 'Payment step'."
browser_video_show_actionsShows a callout naming each action as it happens.duration, position, cursor, style"Label each click in the video."
browser_video_hide_actionsTurns those callouts off.none"Stop labelling actions."
browser_highlightDraws a persistent overlay around an element.target, style"Highlight the broken image in red."
browser_hide_highlightRemoves that overlay.target, element"Remove the highlight."
browser_annotateOpens 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_resumeResumes paused script execution, or steps to the next action.step, location"Step to the next action."

Network tools (--caps=network)

--caps=network4 tools

Reading requests is core. Changing them (mocks and offline mode) needs this group.

ToolWhat it doesKey paramsExample prompt
browser_routeMocks 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_listLists active routes.none"Which mocks are active?"
browser_unrouteRemoves routes for a pattern, or all of them.pattern"Remove all mocks."
browser_network_state_setSwitches the browser offline or back online.state"Go offline and check the banner."

Storage tools (--caps=storage)

--caps=storage17 tools

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.

ToolWhat it doesKey paramsExample prompt
browser_storage_stateSaves cookies and localStorage to a file for reuse.filename"Save my logged-in session to auth.json."
browser_set_storage_stateRestores cookies and localStorage from a file.filename"Load auth.json and open the dashboard."
browser_cookie_listLists cookies, optionally by domain or path.domain, path"What cookies does this site set?"
browser_cookie_getReads one cookie.name"Show the session cookie."
browser_cookie_setSets a cookie with optional flags.name, value, domain, httpOnly, secure, sameSite"Set consent=accepted so the banner is skipped."
browser_cookie_deleteDeletes one cookie.name"Delete the cart cookie."
browser_cookie_clearClears all cookies.none"Clear cookies and reload."
browser_localstorage_listLists all localStorage pairs.none"What's in localStorage?"
browser_localstorage_getReads one key.key"Read the 'theme' key."
browser_localstorage_setSets one key.key, value"Set onboarding_done to true."
browser_localstorage_deleteDeletes one key.key"Remove the 'draft' key."
browser_localstorage_clearClears localStorage.none"Clear localStorage."
browser_sessionstorage_listLists all sessionStorage pairs.none"Show sessionStorage."
browser_sessionstorage_getReads one key.key"Read the 'step' key."
browser_sessionstorage_setSets one key.key, value"Set step to 3."
browser_sessionstorage_deleteDeletes one key.key"Delete the 'step' key."
browser_sessionstorage_clearClears sessionStorage.none"Clear sessionStorage."

Coordinate-based tools (--caps=vision)

--caps=vision6 tools

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.

ToolWhat it doesKey paramsExample prompt
browser_mouse_click_xyClicks at a position.x, y, button, clickCount"Click the centre of the canvas."
browser_mouse_move_xyMoves the mouse to a position.x, y"Move over the chart's last bar."
browser_mouse_drag_xyDrags from one position to another.startX, startY, endX, endY"Draw a line across the whiteboard."
browser_mouse_downPresses a mouse button.button"Hold the left button down."
browser_mouse_upReleases a mouse button.button"Release the mouse."
browser_mouse_wheelScrolls by a delta.deltaX, deltaY"Zoom the map in with the wheel."

PDF and config tools (--caps=pdf, --caps=config)

--caps=pdf--caps=config1 tool each
ToolWhat it doesKey paramsExample prompt
browser_pdf_saveSaves the page as a PDF.filename"Save this invoice page as invoice.pdf."
browser_get_configReturns 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:

.mcp.json / claude_desktop_config.json / .vscode/mcp.json
{
  "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:

Terminal
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:

playwright-mcp.config.json
{
  "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.

FactorSnapshot (default)Vision (--caps=vision)
What the model seesAccessibility tree with roles, names and refsScreenshots, plus the snapshot
How it targetsElement ref or selectorx/y pixel coordinates
Model neededAny text modelA model that reads images
StabilitySame ref for the same elementBreaks when layout shifts
Maps to test codeYes, via locatorsPoorly; coordinates don't make good tests
Best forForms, apps, test authoringCanvas, 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:

  1. browser_navigate + browser_snapshot: the model learns the real roles and names on the page instead of guessing selectors.
  2. browser_find: locates one element without pulling the whole tree, which keeps long sessions cheaper.
  3. browser_click, browser_type, browser_fill_form, browser_select_option: walk the flow once so you know it works before it is written down.
  4. browser_generate_locator (--caps=testing): returns the locator Playwright would use, so the test uses getByRole-style locators rather than brittle CSS.
  5. browser_verify_* (--caps=testing): confirm the expected outcome live, then turn each check into an expect().
  6. browser_start_recording / browser_stop_recording (--caps=devtools): you click through the flow yourself and get Playwright code back.
  7. 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:

Prompt to Claude
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 --caps groups the task needs.
  • Prefer browser_find over a full browser_snapshot when looking for one element.
  • Use depth or a target on browser_snapshot, or save it with filename.
  • Try --snapshot-mode none or --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.


Turn MCP tool calls into real Playwright tests

See the workflow: Claude explores the page with Playwright MCP, then writes a spec file you review, commit and run in CI.

See the AI workflow →

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 - Playwright and Claude AI course instructor

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.

Udemy Instructor Published course author
Playwright + AI Expert Specialized in AI-powered QA
Production Experience Enterprise-grade frameworks
Connect on LinkedIn

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
See the AI Playwright Plan →