Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌.
3.3K
32 Tools
Version 4.43 or later needs to be installed to add the server automatically
Use cases
About
Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌.
| Attribute | Details |
|---|---|
| Docker Image | mcp/mcp-playwright |
| Author | executeautomation |
| Repository | https://github.com/executeautomation/mcp-playwright |
| Dockerfile | https://github.com/executeautomation/mcp-playwright/blob/main/Dockerfile |
| Docker Image built by | Docker Inc. |
| Docker Scout Health Score | |
| Verify Signature | COSIGN_REPOSITORY=mcp/signatures cosign verify mcp/mcp-playwright --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub |
| Licence | MIT License |
| Tools provided by this Server | Short Description |
|---|---|
clear_codegen_session | Clear a code generation session without generating a test |
end_codegen_session | End a code generation session and generate the test file |
get_codegen_session | Get information about a code generation session |
playwright_assert_response | Wait for and validate a previously initiated HTTP response wait operation. |
playwright_click | Click an element on the page |
playwright_click_and_switch_tab | Click a link and switch to the newly opened tab |
playwright_close | Close the browser and release all resources |
playwright_console_logs | Retrieve console logs from the browser with filtering options |
playwright_custom_user_agent | Set a custom User Agent for the browser |
playwright_delete | Perform an HTTP DELETE request |
playwright_drag | Drag an element to a target location |
playwright_evaluate | Execute JavaScript in the browser console |
playwright_expect_response | Ask Playwright to start waiting for a HTTP response. |
playwright_fill | fill out an input field |
playwright_get | Perform an HTTP GET request |
playwright_get_visible_html | Get the HTML content of the current page. |
playwright_get_visible_text | Get the visible text content of the current page |
playwright_go_back | Navigate back in browser history |
playwright_go_forward | Navigate forward in browser history |
playwright_hover | Hover an element on the page |
playwright_iframe_click | Click an element in an iframe on the page |
playwright_iframe_fill | Fill an element in an iframe on the page |
playwright_navigate | Navigate to a URL |
playwright_patch | Perform an HTTP PATCH request |
playwright_post | Perform an HTTP POST request |
playwright_press_key | Press a keyboard key |
playwright_put | Perform an HTTP PUT request |
playwright_save_as_pdf | Save the current page as a PDF file |
playwright_screenshot | Take a screenshot of the current page or a specific element |
playwright_select | Select an element on the page with Select tag |
playwright_upload_file | Upload a file to an input[type='file'] element on the page |
start_codegen_session | Start a new code generation session to record Playwright actions |
clear_codegen_sessionClear a code generation session without generating a test
| Parameters | Type | Description |
|---|---|---|
sessionId | string | ID of the session to clear |
end_codegen_sessionEnd a code generation session and generate the test file
| Parameters | Type | Description |
|---|---|---|
sessionId | string | ID of the session to end |
get_codegen_sessionGet information about a code generation session
| Parameters | Type | Description |
|---|---|---|
sessionId | string | ID of the session to retrieve |
playwright_assert_responseWait for and validate a previously initiated HTTP response wait operation.
| Parameters | Type | Description |
|---|---|---|
id | string | Identifier of the HTTP response initially expected using Playwright_expect_response. |
value | stringoptional | Data to expect in the body of the HTTP response. If provided, the assertion will fail if this value is not found in the response body. |
playwright_clickClick an element on the page
| Parameters | Type | Description |
|---|---|---|
selector | string | CSS selector for the element to click |
playwright_click_and_switch_tabClick a link and switch to the newly opened tab
| Parameters | Type | Description |
|---|---|---|
selector | string | CSS selector for the link to click |
playwright_closeClose the browser and release all resources
playwright_console_logsRetrieve console logs from the browser with filtering options
| Parameters | Type | Description |
|---|---|---|
clear | booleanoptional | Whether to clear logs after retrieval (default: false) |
limit | numberoptional | Maximum number of logs to return |
search | stringoptional | Text to search for in logs (handles text with square brackets) |
type | stringoptional | Type of logs to retrieve (all, error, warning, log, info, debug, exception) |
playwright_custom_user_agentSet a custom User Agent for the browser
| Parameters | Type | Description |
|---|---|---|
userAgent | string | Custom User Agent for the Playwright browser instance |
playwright_deletePerform an HTTP DELETE request
| Parameters | Type | Description |
|---|---|---|
url | string | URL to perform DELETE operation |
playwright_dragDrag an element to a target location
| Parameters | Type | Description |
|---|---|---|
sourceSelector | string | CSS selector for the element to drag |
targetSelector | string | CSS selector for the target location |
playwright_evaluateExecute JavaScript in the browser console
| Parameters | Type | Description |
|---|---|---|
script | string | JavaScript code to execute |
playwright_expect_responseAsk Playwright to start waiting for a HTTP response. This tool initiates the wait operation but does not wait for its completion.
| Parameters | Type | Description |
|---|---|---|
id | string | Unique & arbitrary identifier to be used for retrieving this response later with Playwright_assert_response. |
url | string | URL pattern to match in the response. |
playwright_fillfill out an input field
| Parameters | Type | Description |
|---|---|---|
selector | string | CSS selector for input field |
value | string | Value to fill |
playwright_getPerform an HTTP GET request
| Parameters | Type | Description |
|---|---|---|
url | string | URL to perform GET operation |
playwright_get_visible_htmlGet the HTML content of the current page. By default, all <script> tags are removed from the output unless removeScripts is explicitly set to false.
| Parameters | Type | Description |
|---|---|---|
cleanHtml | booleanoptional | Perform comprehensive HTML cleaning (default: false) |
maxLength | numberoptional | Maximum number of characters to return (default: 20000) |
minify | booleanoptional | Minify the HTML output (default: false) |
removeComments | booleanoptional | Remove all HTML comments (default: false) |
removeMeta | booleanoptional | Remove all meta tags from the HTML (default: false) |
removeScripts | booleanoptional | Remove all script tags from the HTML (default: true) |
removeStyles | booleanoptional | Remove all style tags from the HTML (default: false) |
selector | stringoptional | CSS selector to limit the HTML to a specific container |
playwright_get_visible_textGet the visible text content of the current page
playwright_go_backNavigate back in browser history
playwright_go_forwardNavigate forward in browser history
playwright_hoverHover an element on the page
| Parameters | Type | Description |
|---|---|---|
selector | string | CSS selector for element to hover |
playwright_iframe_clickClick an element in an iframe on the page
| Parameters | Type | Description |
|---|---|---|
iframeSelector | string | CSS selector for the iframe containing the element to click |
selector | string | CSS selector for the element to click |
playwright_iframe_fillFill an element in an iframe on the page
| Parameters | Type | Description |
|---|---|---|
iframeSelector | string | CSS selector for the iframe containing the element to fill |
selector | string | CSS selector for the element to fill |
value | string | Value to fill |
playwright_navigateNavigate to a URL
| Parameters | Type | Description |
|---|---|---|
url | string | URL to navigate to the website specified |
browserType | stringoptional | Browser type to use (chromium, firefox, webkit). Defaults to chromium |
headless | booleanoptional | Run browser in headless mode (default: false) |
height | numberoptional | Viewport height in pixels (default: 720) |
timeout | numberoptional | Navigation timeout in milliseconds |
waitUntil | stringoptional | Navigation wait condition |
width | numberoptional | Viewport width in pixels (default: 1280) |
playwright_patchPerform an HTTP PATCH request
| Parameters | Type | Description |
|---|---|---|
url | string | URL to perform PUT operation |
value | string | Data to PATCH in the body |
playwright_postPerform an HTTP POST request
| Parameters | Type | Description |
|---|---|---|
url | string | URL to perform POST operation |
value | string | Data to post in the body |
headers | objectoptional | Additional headers to include in the request |
token | stringoptional | Bearer token for authorization |
playwright_press_keyPress a keyboard key
| Parameters | Type | Description |
|---|---|---|
key | string | Key to press (e.g. 'Enter', 'ArrowDown', 'a') |
selector | stringoptional | Optional CSS selector to focus before pressing key |
playwright_putPerform an HTTP PUT request
| Parameters | Type | Description |
|---|---|---|
url | string | URL to perform PUT operation |
value | string | Data to PUT in the body |
playwright_save_as_pdfSave the current page as a PDF file
| Parameters | Type | Description |
|---|---|---|
outputPath | string | Directory path where PDF will be saved |
filename | stringoptional | Name of the PDF file (default: page.pdf) |
format | stringoptional | Page format (e.g. 'A4', 'Letter') |
margin | objectoptional | Page margins |
printBackground | booleanoptional | Whether to print background graphics |
playwright_screenshotTake a screenshot of the current page or a specific element
| Parameters | Type | Description |
|---|---|---|
name | string | Name for the screenshot |
downloadsDir | stringoptional | Custom downloads directory path (default: user's Downloads folder) |
fullPage | booleanoptional | Store screenshot of the entire page (default: false) |
height | numberoptional | Height in pixels (default: 600) |
savePng | booleanoptional | Save screenshot as PNG file (default: false) |
selector | stringoptional | CSS selector for element to screenshot |
storeBase64 | booleanoptional | Store screenshot in base64 format (default: true) |
width | numberoptional | Width in pixels (default: 800) |
playwright_selectSelect an element on the page with Select tag
| Parameters | Type | Description |
|---|---|---|
selector | string | CSS selector for element to select |
value | string | Value to select |
playwright_upload_fileUpload a file to an input[type='file'] element on the page
| Parameters | Type | Description |
|---|---|---|
filePath | string | Absolute path to the file to upload |
selector | string | CSS selector for the file input element |
start_codegen_sessionStart a new code generation session to record Playwright actions
| Parameters | Type | Description |
|---|---|---|
options | object | Code generation options |
{
"mcpServers": {
"playwright-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/local-directory:/local-directory",
"mcp/mcp-playwright"
]
}
}
}
Manual installation
You can install the MCP server using:
Installation for