The Playwright MCP project provides a Model Context Protocol server that enhances browser automation by enabling interaction with web pages through structured accessibility snapshots. This approach eliminates the need for screenshots or visually-tuned models, making it faster and more lightweight. It is particularly beneficial for large language models (LLMs) as it operates purely on structured data, avoiding the ambiguities of screenshot-based methods. The server is suitable for tasks such as web navigation, form-filling, data extraction, and automated testing driven by LLMs. It supports both headless and headed browser operations, and offers two modes: Snapshot Mode for performance and reliability, and Vision Mode for visual-based interactions. This makes it a versatile tool for general-purpose browser interaction and automation.
Perform click on a web page. Parameters: element (string), ref (string)
Hover over element on page. Parameters: element (string), ref (string)
Perform drag and drop between two elements. Parameters: startElement (string), startRef (string), endElement (string), endRef (string)
Type text into editable element. Parameters: element (string), ref (string), text (string), submit (boolean, optional), slowly (boolean, optional)
Select an option in a dropdown. Parameters: element (string), ref (string), values (array)
Capture accessibility snapshot of the current page, this is better than screenshot. Parameters: None
Take a screenshot of the current page. Parameters: raw (boolean, optional)
Move mouse to a given position. Parameters: element (string), x (number), y (number)
Take a screenshot of the current page. Parameters: None
Click left mouse button. Parameters: element (string), x (number), y (number)
Drag left mouse button. Parameters: element (string), startX (number), startY (number), endX (number), endY (number)
Type text. Parameters: text (string), submit (boolean, optional)
Press a key on the keyboard. Parameters: key (string)
List browser tabs. Parameters: None
Open a new tab. Parameters: url (string, optional)
Select a tab by index. Parameters: index (number)
Close a tab. Parameters: index (number, optional)
Navigate to a URL. Parameters: url (string)
Go back to the previous page. Parameters: None
Go forward to the next page. Parameters: None
Choose one or multiple files to upload. Parameters: paths (array)
Save page as PDF. Parameters: None
Wait for a specified time in seconds. Parameters: time (number)
Close the page. Parameters: None
Install the browser specified in the config. Call this if you get an error about the browser not being installed. Parameters: None
No reviews yet. Be the first to review!
Sign in to join the conversation
Start the server with node to access it via any client or IDE.
node path/to/downloaded/file.mjs