@playwright/mcp

Playwright MCP server

testingtesting
32,292 stars🍴 2,652 forks📦 v0.0.75📄 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 (67)

promptText

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

endRef

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

Title

Verify value

startRef

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

doubleClick

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

modifiers

(array, optional): Modifier keys to press

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.

textGone

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

height

(number): Height of the browser window

filename

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

submit

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

values

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

Tools

generated by update-readme.js -->

button

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

NOTE

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

endElement

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

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.

element

(string): Human-readable element description

text

(string, optional): The text to wait for

removeHeaders

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

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}"`

x

(number): X coordinate

location

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

ref

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

description

(string, optional): Chapter description

target

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

endX

(number): End X coordinate

index

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

endY

(number): End Y coordinate

y

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

depth

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

End

of tools generated section -->

filter

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

deltaY

(number): Y delta

url

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

paths

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

startTarget

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

path

(string, optional): Cookie path

all

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

clickCount

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

requestBody

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

httpOnly

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

requestHeaders

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

function

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

duration

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

headers

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

domain

(string, optional): Cookie domain

delay

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

type

(string): Image format for the screenshot. Default is png.

size

(object, optional): Video size

startX

(number): Start X coordinate

expires

(number, optional): Cookie expiration as Unix timestamp

body

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

sameSite

(string, optional): Cookie SameSite attribute

items

(array): Items to verify

secure

(boolean, optional): Whether the cookie is secure

value

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

part

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

Description

Verify element value

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

Parameters

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

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)

contentType

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

startY

(number): Start Y coordinate

Capabilities

67
Tools
0
Resources
0
Prompts