@playwright/mcp

Playwright MCP server

testingtesting
36,782 stars🍴 3,090 forks📦 v0.0.80📄 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 (71)

NOTE

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

button

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

endRef

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

filename

(string, optional): File name to save the screenshot to. Defaults to `page-{timestamp}.{png|jpeg|webp}` if not specified. Prefer relative file names to stay within the output directory.

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.

startRef

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

element

(string): Human-readable element description

endElement

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

textGone

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

modifiers

(array, optional): Modifier keys to press

submit

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

text

(string, optional): The text to wait for

promptText

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

Tools

generated by update-readme.js -->

Title

Verify value

height

(number): Height of the browser window

doubleClick

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

values

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

endY

(number): End Y 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".

x

(number): X 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.

y

(number): Y coordinate

style

(string, optional): Additional inline CSS applied to the highlight overlay, e.g. "outline: 2px dashed red".

accessibleName

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

removeHeaders

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

endX

(number): End X coordinate

status

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

endTarget

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

clickCount

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

domain

(string, optional): Cookie domain

filter

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

paths

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

path

(string, optional): Cookie path

url

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

httpOnly

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

headers

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

startTarget

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

deltaY

(number): Y delta

requestBody

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

End

of tools generated section -->

requestHeaders

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

all

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

duration

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

function

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

part

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

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"}).

startX

(number): Start X 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)

type

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

size

(object, optional): Video size

secure

(boolean, optional): Whether the cookie is secure

items

(array): Items to verify

startY

(number): Start Y coordinate

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".

expires

(number, optional): Cookie expiration as Unix timestamp

sameSite

(string, optional): Cookie SameSite attribute

depth

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

body

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

contentType

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

Parameters

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

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.

position

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

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.

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.

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.

Description

Verify element value

Capabilities

71
Tools
0
Resources
0
Prompts