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.
Nessuna recensione ancora. Sii il primo a recensire!
Accedi per unirti alla conversazione
Perform click on a web page. Parameters: element (string, optional), ref (string), selector (string, optional), doubleClick (boolean, optional), button (string, optional), modifiers (array, optional)
Close the page. Parameters: None
Returns all console messages. Parameters: level (string), all (boolean, optional), filename (string, optional)
Perform drag and drop between two elements. Parameters: startElement (string), startRef (string), startSelector (string, optional), endElement (string), endRef (string), endSelector (string, optional)
Evaluate JavaScript expression on page or element. Parameters: function (string), element (string, optional), ref (string, optional), selector (string, optional), filename (string, optional)
Upload one or multiple files. Parameters: paths (array, optional)
Fill multiple form fields. Parameters: fields (array)
Handle a dialog. Parameters: accept (boolean), promptText (string, optional)
Hover over element on page. Parameters: element (string, optional), ref (string), selector (string, optional)
Navigate to a URL. Parameters: url (string)
Go back to the previous page in the history. Parameters: None
Returns all network requests since loading the page. Parameters: static (boolean), requestBody (boolean), requestHeaders (boolean), filter (string, optional), filename (string, optional)
Press a key on the keyboard. Parameters: key (string)
Resize the browser window. Parameters: width (number), height (number)
Run Playwright code snippet. Parameters: code (string, optional), filename (string, optional)
Select an option in a dropdown. Parameters: element (string, optional), ref (string), selector (string, optional), values (array)
Capture accessibility snapshot of the current page. Parameters: filename (string, optional), selector (string, optional), depth (number, optional)
Take a screenshot of the current page. Parameters: type (string), filename (string, optional), element (string, optional), ref (string, optional), selector (string, optional), fullPage (boolean, optional)
Type text into editable element. Parameters: element (string, optional), ref (string), selector (string, optional), text (string), submit (boolean, optional), slowly (boolean, optional)
Wait for text to appear or disappear or a specified time to pass. Parameters: time (number, optional), text (string, optional), textGone (string, optional)
List, create, close, or select a browser tab. Parameters: action (string), index (number, optional), url (string, optional)
Get the final resolved config after merging CLI options, environment variables and config file. Parameters: None
Sets the browser network state to online or offline. Parameters: state (string)
Set up a route to mock network requests matching a URL pattern. Parameters: pattern (string), status (number, optional), body (string, optional), contentType (string, optional), headers (array, optional), removeHeaders (string, optional)
List all active network routes. Parameters: None
Remove network routes matching a pattern. Parameters: pattern (string, optional)
Clear all cookies. Parameters: None
Delete a specific cookie. Parameters: name (string)
Get a specific cookie by name. Parameters: name (string)
List all cookies. Parameters: domain (string, optional), path (string, optional)
Set a cookie. Parameters: name (string), value (string), domain (string, optional), path (string, optional), expires (number, optional), httpOnly (boolean, optional), secure (boolean, optional), sameSite (string, optional)
Clear all localStorage. Parameters: None
Delete a localStorage item. Parameters: key (string)
Get a localStorage item by key. Parameters: key (string)
List all localStorage key-value pairs. Parameters: None
Set a localStorage item. Parameters: key (string), value (string)
Clear all sessionStorage. Parameters: None
Delete a sessionStorage item. Parameters: key (string)
Get a sessionStorage item by key. Parameters: key (string)
List all sessionStorage key-value pairs. Parameters: None
Set a sessionStorage item. Parameters: key (string), value (string)
Restore storage state from a file. Parameters: filename (string)
Save storage state to a file for later reuse. Parameters: filename (string, optional)
Resume paused script execution. Parameters: step (boolean, optional), location (string, optional)
Start trace recording. Parameters: None
Start video recording. Parameters: filename (string, optional), size (object, optional)
Stop trace recording. Parameters: None
Stop video recording. Parameters: None
Add a chapter marker to the video recording. Parameters: title (string), description (string, optional), duration (number, optional)
Click mouse button at a given position. Parameters: x (number), y (number), button (string, optional), clickCount (number, optional), delay (number, optional)
Press mouse down. Parameters: button (string, optional)