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), doubleClick (boolean, optional), button (string, optional)
Close the page. Parameters: None
Returns all console messages. Parameters: None
Perform drag and drop between two elements. Parameters: startElement (string), startRef (string), endElement (string), endRef (string)
Evaluate JavaScript expression on page or element. Parameters: function (string), element (string, optional), ref (string, optional)
Upload one or multiple files. Parameters: paths (array)
Handle a dialog. Parameters: accept (boolean), promptText (string, optional)
Hover over element on page. Parameters: element (string), ref (string)
Navigate to a URL. Parameters: url (string)
Go back to the previous page. Parameters: None
Go forward to the next page. Parameters: None
Returns all network requests since loading the page. Parameters: None
Press a key on the keyboard. Parameters: key (string)
Resize the browser window. Parameters: width (number), height (number)
Select an option in a dropdown. Parameters: element (string), ref (string), values (array)
Capture accessibility snapshot of the current page. Parameters: None
Take a screenshot of the current page. Parameters: type (string, optional), filename (string, optional), element (string, optional), ref (string, optional), fullPage (boolean, optional)
Type text into editable element. Parameters: element (string), ref (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)
Close a tab. Parameters: index (number, optional)
List browser tabs. Parameters: None
Open a new tab. Parameters: url (string, optional)
Select a tab by index. Parameters: index (number)
Install the browser specified in the config. Parameters: None
Click left mouse button at a given position. Parameters: element (string), x (number), y (number)
Drag left mouse button to a given position. Parameters: element (string), startX (number), startY (number), endX (number), endY (number)
Move mouse to a given position. Parameters: element (string), x (number), y (number)
Save page as PDF. Parameters: filename (string, optional)