The Playwright MCP server provides browser automation capabilities using Playwright through the Model Context Protocol (MCP). Instead of relying on screenshots or visually-tuned models, it operates on Playwrightβs accessibility tree, allowing LLMs to interact deterministically with web pages using structured data.Documentation Index
Fetch the complete documentation index at: https://portkey-docs-log-export-guide-1773064217.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
When should you use it
Use the Playwright MCP server when you want an agent to:- Automate browser actions.
- Extract structured page context via snapshots, avoiding ambiguity of pixel-based methods.
- Test and verify UI elements, text, or values without vision models.
- Capture console logs, network requests, PDFs, or traces during automated workflows.
- Manage tabs, dialogs, and file uploads in real-time web automation.
Requirements
- Requirements:
- Node.js 18 or newer
- An MCP-compatible client (VS Code, Cursor, Windsurf, Claude Desktop, Goose, etc.)
- Installation:
Install the Playwright MCP server with your MCP client. - Optional capabilities (enabled via
--caps):visionβ coordinate-based mouse actionspdfβ save pages as PDFverifyβ element/text/value verificationtracingβ start/stop browser tracing
Tools
Core interaction
- browser_click β Click (or double click) on an element.
- browser_hover β Hover over an element.
- browser_type β Type text into an editable element, with optional submit/slow typing.
- browser_fill_form β Fill multiple form fields at once.
- browser_select_option β Select one or more dropdown values.
- browser_press_key β Press a keyboard key.
- browser_drag β Perform drag-and-drop between elements.
- browser_file_upload β Upload one or multiple files.
Navigation & tabs
- browser_navigate β Navigate to a specific URL.
- browser_navigate_back β Go back to the previous page.
- browser_tabs β List, create, close, or select tabs.
- browser_close β Close the current page.
Page context & capture
- browser_snapshot β Capture structured accessibility snapshot (preferred for automation).
- browser_take_screenshot β Take a screenshot of viewport, full page, or element.
- browser_pdf_save (opt-in via
--caps=pdf) β Save page as PDF.
Evaluation & debugging
- browser_evaluate β Run JavaScript in page context.
- browser_console_messages β Return console messages.
- browser_network_requests β Return all network requests since load.
- browser_resize β Resize the browser window.
- browser_handle_dialog β Accept/decline modal dialogs or prompts.
Verification (opt-in via --caps=verify)
- browser_verify_element_visible β Verify an element is visible by role + accessible name.
- browser_verify_text_visible β Verify a text string is visible.
- browser_verify_list_visible β Verify a list with expected items is visible.
- browser_verify_value β Verify element values (e.g., checkbox state, input value).
Coordinate-based (opt-in via --caps=vision)
- browser_mouse_click_xy β Click at a coordinate.
- browser_mouse_drag_xy β Drag mouse between coordinates.
- browser_mouse_move_xy β Move mouse to a coordinate.
Tracing (opt-in via --caps=tracing)
- browser_start_tracing β Start trace recording.
- browser_stop_tracing β Stop trace recording.
Installation
- browser_install β Install the required browser binaries if not already present.
Notes
- Prefer
browser_snapshotover screenshots for interactionβitβs structured, fast, and deterministic. - Many tools require both a human-readable element description and a ref from the snapshot for safety and determinism.
- Optional capabilities (
vision,pdf,verify,tracing) must be explicitly enabled when starting the server.

