@playwright/mcp

Playwright MCP server

testingtesting
⭐ 39,112 stars🍴 3,373 forks📦 v0.0.84📄 Apache-2.0

🔌 Transport

Standard I/O

📦 Installation

Docker

Claude Desktop Configuration

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "-playwright-mcp": {
      "args": [
        "index.js"
      ],
      "command": "node"
    }
  }
}

🛠️ Available Tools (80)

button

(string, optional): Button to click, defaults to left

endRef

(string): Exact target element reference from the page snapshot

Tools

generated by update-readme.js -->

startRef

(string): Exact source element reference from the page snapshot

modifiers

(array, optional): Modifier keys to press

element

(string): Human-readable element description

height

(number): Height of the browser window

text

(string, optional): The text to wait for

filename

(string, optional): File name to save the screenshot to. Relative file names are resolved against the workspace root. If not specified, the screenshot is saved into the output directory as `page-{timestamp}.{png|jpeg|webp}`.

doubleClick

(boolean, optional): Whether to perform a double click instead of a single click

promptText

(string, optional): The text of the prompt in case of a prompt dialog.

Title

Verify value

submit

(boolean, optional): Whether to submit entered text (press Enter after)

textGone

(string, optional): The text to wait for to disappear

endElement

(string, optional): Human-readable target element description used to obtain the permission to interact with the element

values

(array): Array of values to select in the dropdown. This can be a single value or multiple values.

NOTE

This has been generated via update-readme.js -->

endY

(number): End Y coordinate

removeHeaders

(string, optional): Comma-separated list of header names to remove from request

accessibleName

(string): ACCESSIBLE_NAME of the element. Can be found in the snapshot like this: `- role "{ACCESSIBLE_NAME}"`

x

(number): X coordinate

y

(number): Y coordinate

description

(string, optional): Chapter description

ref

(string): Exact target element reference that points to the element

index

(number, optional): Tab index, used for close/select. If omitted for close, current tab is closed.

endX

(number): End X coordinate

target

(string): Exact target element reference from the page snapshot

location

(string, optional): Pause execution at a specific <file>:<line>, e.g. "example.spec.ts:42".

style

(object, optional): Styles of the action decorations.

endTarget

(string): Exact target element reference from the page snapshot, or a unique element selector

path

(string, optional): Cookie path

url

(string, optional): URL to navigate to in the new tab, used for new.

duration

(number, optional): Duration in milliseconds to show the chapter card

startTarget

(string): Exact target element reference from the page snapshot, or a unique element selector

domain

(string, optional): Cookie domain

paths

(array, optional): Absolute paths to files to drop onto the element.

headers

(array, optional): Headers to add in "Name: Value" format

End

of tools generated section -->

deltaY

(number): Y delta

function

(string): () => { /* code */ } or (element) => { /* code */ } when element is provided

filter

(string, optional): Only return requests whose URL matches this regexp (e.g. "/api/.*user").

status

(number, optional): HTTP status code to return (default: 200)

httpOnly

(boolean, optional): Whether the cookie is HTTP only

requestBody

(boolean): Whether to include request body. Defaults to false.

clickCount

(number, optional): Number of clicks, defaults to 1

requestHeaders

(boolean): Whether to include request headers. Defaults to false.

contentType

(string, optional): Content-Type header (e.g., "application/json", "text/html")

size

(object, optional): Video size

secure

(boolean, optional): Whether the cookie is secure

part

(string, optional): Return only this part of the request. Omit to return full details.

startX

(number): Start X coordinate

items

(array): Items to verify

body

(string, optional): Response body (text or JSON string)

type

(string, optional): Image format for the screenshot. If unset, inferred from the filename extension, otherwise png.

startY

(number): Start Y coordinate

boxes

(boolean, optional): Include each element's bounding box as [box=x,y,width,height] in the snapshot. Coordinates are viewport-relative, in CSS pixels (Element.getBoundingClientRect)

data

(object, optional): Data to drop, as a map of MIME type to string value (e.g. {"text/plain": "hello", "text/uri-list": "https://example.com"}).

sameSite

(string, optional): Cookie SameSite attribute

expires

(number, optional): Cookie expiration as Unix timestamp

delay

(number, optional): Time to wait between mouse down and mouse up in milliseconds, defaults to 0

value

(string): Value to verify. For checkbox, use "true" or "false".

depth

(number, optional): Limit the depth of the snapshot tree

isolatedContext

(string, optional): Name of an isolated browser context to create the new tab in, used for new. Tabs in the same isolated context share cookies and storage, tabs in different contexts are fully isolated. If omitted or "default", the tab is created in the default context.

media

(optional): Changes the CSS media type of the page

fps

(number, optional): Video frame rate in frames per second, defaults to 25

regex

(string, optional): Regular expression to search for in the page snapshot. Matching is case-sensitive by default; wrap the pattern in slashes to add flags, e.g. "/error/i" for case-insensitive. Provide either text or regex, not both.

scale

(string): Image resolution scale. "css" produces a screenshot sized in CSS pixels (smaller, consistent across devices). "device" produces a high-resolution screenshot using device pixels (larger, accounts for the device pixel ratio). Default is css.

cursor

(string, optional): Cursor decoration for pointer actions. "pointer" (default) animates a mouse pointer from the previous action point to the next one; "none" disables the cursor decoration.

slowly

(boolean, optional): Whether to type one character at a time. Useful for triggering key handlers in the page. By default entire text is filled in at once.

maxResults

(number, optional): Maximum number of matching items to return. Defaults to returning all matches.

fullPage

(boolean, optional): When true, takes a screenshot of the full scrollable page, instead of the currently visible viewport. Cannot be used with element screenshots.

all

(boolean, optional): Return all network requests since the beginning of the session, not just since the last navigation. Defaults to false.

reducedMotion

(optional): Emulates the prefers-reduced-motion media feature

params

(object, optional): Input parameters for the tool, matching its inputSchema

frame

(string, optional): Frame that registered the tool, as reported by browser_webmcp_list, when the same tool name exists in multiple frames

forcedColors

(optional): Emulates the forced-colors media feature

position

(string, optional): Where to place the action title relative to the page. Defaults to top-right.

contrast

(optional): Emulates the prefers-contrast media feature

Description

Verify element value

Parameters

- `type` (string): Type of the element

Capabilities

80
Tools
0
Resources
0
Prompts