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), target (string), doubleClick (boolean, optional), button (string, optional), modifiers (array, optional)
Close the browser and all open tabs.
Returns all console messages. Parameters: level (string), all (boolean, optional), filename (string, optional)
Perform drag and drop between two elements. Parameters: startElement (string, optional), startTarget (string), endElement (string, optional), endTarget (string)
Drop files or data onto an element. Parameters: element (string, optional), target (string), paths (array, optional), data (object, optional)
Emulate CSS media features for the page. Parameters: colorScheme (optional), reducedMotion (optional), forcedColors (optional), contrast (optional), media (optional)
Evaluate JavaScript expression on page or element. Parameters: element (string, optional), target (string), function (string), filename (string, optional)
Upload one or multiple files. Parameters: paths (array, optional)
Fill multiple form fields. Parameters: fields (array)
Search the accessibility snapshot of the current page for text or a regular expression. Parameters: text (string, optional), regex (string, optional), maxResults (number, optional), filename (string, optional)
Handle a dialog. Parameters: accept (boolean), promptText (string, optional)
Hover over element on page. Parameters: element (string, optional), target (string)
Navigate to a URL. Parameters: url (string)
Go back to the previous page in the history.
Returns full details of a single network request. Parameters: index (integer), part (string, optional), filename (string, optional)
Returns a numbered list of network requests since loading the page. Parameters: static (boolean), filter (string, optional), all (boolean, optional), filename (string, optional)
Press a key on the keyboard. Parameters: key (string)
Resize the browser window. Parameters: width (number), height (number)
Run a Playwright code snippet. Parameters: code (string, optional), filename (string, optional)
Select an option in a dropdown. Parameters: element (string, optional), target (string), values (array)
Capture accessibility snapshot of the current page. Parameters: target (string, optional), filename (string, optional), depth (number, optional), boxes (boolean, optional)
Take a screenshot of the current page. Parameters: element (string, optional), target (string), type (string, optional), filename (string, optional), fullPage (boolean, optional), scale (string)
Type text into editable element. Parameters: element (string, optional), target (string), 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), isolatedContext (string, optional)
Get the final resolved config after merging CLI options, environment variables and config file.
Sets the browser network state to online or offline. Parameters: state (string)
Set up a route to mock network requests. Parameters: pattern (string), status (number, optional), body (string, optional), contentType (string, optional), headers (array, optional), removeHeaders (string, optional)
List all active network routes.
Remove network routes matching a pattern. Parameters: pattern (string, optional)
Clear all cookies.
Delete a specific cookie. Parameters: name (string), domain (string, optional), path (string, optional)
Get a specific cookie by name. Parameters: name (string)
List all cookies. Parameters: domain (string, optional), path (string, optional)
Set a cookie with optional flags. 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.
Delete a localStorage item. Parameters: key (string)
Get a localStorage item by key. Parameters: key (string)
List all localStorage key-value pairs.
Set a localStorage item. Parameters: key (string), value (string)
Clear all sessionStorage.
Delete a sessionStorage item. Parameters: key (string)
Get a sessionStorage item by key. Parameters: key (string)
List all sessionStorage key-value pairs.
Set a sessionStorage item. Parameters: key (string), value (string)
Restore storage state from a file. Parameters: filename (string)
Save storage state to a file. Parameters: filename (string, optional)
Open the Playwright Dashboard in annotation mode for the current page.
Remove a highlight overlay previously added for the element. Parameters: element (string, optional), target (string, optional)
Show a persistent highlight overlay around the element on the page. Parameters: element (string, optional), target (string), style (string, optional)