Sign inSign up

mcp/mcp-playwright

Verified Publisher

By mcp

Updated about 1 year ago

Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, ...

Image
Machine learning & AI
1

10K+

mcp/mcp-playwright repository overview

ExecuteAutomation Playwright MCP Server

Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌.

What is an MCP Server?

MCP Info

Image Building Info

AttributeDetails
Dockerfilehttps://github.com/executeautomation/mcp-playwright/blob/51b2725f06f6df703f797f4025cac4c5f3a71f05/Dockerfile
Commit51b2725f06f6df703f797f4025cac4c5f3a71f05
Docker Image built byDocker Inc.
Docker Scout Health ScoreDocker Scout Health Score
Verify SignatureCOSIGN_REPOSITORY=mcp/signatures cosign verify mcp/mcp-playwright --key https://raw.githubusercontent.com/docker/keyring/refs/heads/main/public/mcp/latest.pub
LicenceMIT License

Available Tools (32)

Tools provided by this ServerShort Description
clear_codegen_sessionClear a code generation session without generating a test
end_codegen_sessionEnd a code generation session and generate the test file
get_codegen_sessionGet information about a code generation session
playwright_assert_responseWait for and validate a previously initiated HTTP response wait operation.
playwright_clickClick an element on the page
playwright_click_and_switch_tabClick a link and switch to the newly opened tab
playwright_closeClose the browser and release all resources
playwright_console_logsRetrieve console logs from the browser with filtering options
playwright_custom_user_agentSet a custom User Agent for the browser
playwright_deletePerform an HTTP DELETE request
playwright_dragDrag an element to a target location
playwright_evaluateExecute JavaScript in the browser console
playwright_expect_responseAsk Playwright to start waiting for a HTTP response.
playwright_fillfill out an input field
playwright_getPerform an HTTP GET request
playwright_get_visible_htmlGet the HTML content of the current page.
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
playwright_iframe_clickClick an element in an iframe on the page
playwright_iframe_fillFill an element in an iframe on the page
playwright_navigateNavigate to a URL
playwright_patchPerform an HTTP PATCH request
playwright_postPerform an HTTP POST request
playwright_press_keyPress a keyboard key
playwright_putPerform an HTTP PUT request
playwright_save_as_pdfSave the current page as a PDF file
playwright_screenshotTake a screenshot of the current page or a specific element
playwright_selectSelect an element on the page with Select tag
playwright_upload_fileUpload a file to an input[type='file'] element on the page
start_codegen_sessionStart a new code generation session to record Playwright actions

Tools Details

Tool: clear_codegen_session

Clear a code generation session without generating a test

ParametersTypeDescription
sessionIdstringID of the session to clear

Tool: end_codegen_session

End a code generation session and generate the test file

ParametersTypeDescription
sessionIdstringID of the session to end

Tool: get_codegen_session

Get information about a code generation session

ParametersTypeDescription
sessionIdstringID of the session to retrieve

Tool: playwright_assert_response

Wait for and validate a previously initiated HTTP response wait operation.

ParametersTypeDescription
idstringIdentifier of the HTTP response initially expected using Playwright_expect_response.
valuestring optionalData 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.

Tool: playwright_click

Click an element on the page

ParametersTypeDescription
selectorstringCSS selector for the element to click

Tool: playwright_click_and_switch_tab

Click a link and switch to the newly opened tab

ParametersTypeDescription
selectorstringCSS selector for the link to click

Tool: playwright_close

Close the browser and release all resources

Tool: playwright_console_logs

Retrieve console logs from the browser with filtering options

ParametersTypeDescription
clearboolean optionalWhether to clear logs after retrieval (default: false)
limitnumber optionalMaximum number of logs to return
searchstring optionalText to search for in logs (handles text with square brackets)
typestring optionalType of logs to retrieve (all, error, warning, log, info, debug, exception)

Tool: playwright_custom_user_agent

Set a custom User Agent for the browser

ParametersTypeDescription
userAgentstringCustom User Agent for the Playwright browser instance

Tool: playwright_delete

Perform an HTTP DELETE request

ParametersTypeDescription
urlstringURL to perform DELETE operation

Tool: playwright_drag

Drag an element to a target location

ParametersTypeDescription
sourceSelectorstringCSS selector for the element to drag
targetSelectorstringCSS selector for the target location

Tool: playwright_evaluate

Execute JavaScript in the browser console

ParametersTypeDescription
scriptstringJavaScript code to execute

Tool: playwright_expect_response

Ask Playwright to start waiting for a HTTP response. This tool initiates the wait operation but does not wait for its completion.

ParametersTypeDescription
idstringUnique & arbitrary identifier to be used for retrieving this response later with Playwright_assert_response.
urlstringURL pattern to match in the response.

Tool: playwright_fill

fill out an input field

ParametersTypeDescription
selectorstringCSS selector for input field
valuestringValue to fill

Tool: playwright_get

Perform an HTTP GET request

ParametersTypeDescription
urlstringURL to perform GET operation

Tool: playwright_get_visible_html

Get the HTML content of the current page. By default, all

ParametersTypeDescription
cleanHtmlboolean optionalPerform comprehensive HTML cleaning (default: false)
maxLengthnumber optionalMaximum number of characters to return (default: 20000)
minifyboolean optionalMinify the HTML output (default: false)
removeCommentsboolean optionalRemove all HTML comments (default: false)
removeMetaboolean optionalRemove all meta tags from the HTML (default: false)
removeScriptsboolean optionalRemove all script tags from the HTML (default: true)
removeStylesboolean optionalRemove all style tags from the HTML (default: false)
selectorstring optionalCSS selector to limit the HTML to a specific container

Tool: playwright_get_visible_text

Get the visible text content of the current page

Tool: playwright_go_back

Navigate back in browser history

Tool: playwright_go_forward

Navigate forward in browser history

Tool: playwright_hover

Hover an element on the page

ParametersTypeDescription
selectorstringCSS selector for element to hover

Tool: playwright_iframe_click

Click an element in an iframe on the page

ParametersTypeDescription
iframeSelectorstringCSS selector for the iframe containing the element to click
selectorstringCSS selector for the element to click

Tool: playwright_iframe_fill

Fill an element in an iframe on the page

ParametersTypeDescription
iframeSelectorstringCSS selector for the iframe containing the element to fill
selectorstringCSS selector for the element to fill
valuestringValue to fill

Tool: playwright_navigate

Navigate to a URL

ParametersTypeDescription
urlstringURL to navigate to the website specified
browserTypestring optionalBrowser type to use (chromium, firefox, webkit). Defaults to chromium
headlessboolean optionalRun browser in headless mode (default: false)
heightnumber optionalViewport height in pixels (default: 720)
timeoutnumber optionalNavigation timeout in milliseconds
waitUntilstring optionalNavigation wait condition
widthnumber optionalViewport width in pixels (default: 1280)

Tool: playwright_patch

Perform an HTTP PATCH request

ParametersTypeDescription
urlstringURL to perform PUT operation
valuestringData to PATCH in the body

Tool: playwright_post

Perform an HTTP POST request

ParametersTypeDescription
urlstringURL to perform POST operation
valuestringData to post in the body
headersobject optionalAdditional headers to include in the request
tokenstring optionalBearer token for authorization

Tool: playwright_press_key

Press a keyboard key

ParametersTypeDescription
keystringKey to press (e.g. 'Enter', 'ArrowDown', 'a')
selectorstring optionalOptional CSS selector to focus before pressing key

Tool: playwright_put

Perform an HTTP PUT request

ParametersTypeDescription
urlstringURL to perform PUT operation
valuestringData to PUT in the body

Tool: playwright_save_as_pdf

Save the current page as a PDF file

ParametersTypeDescription
outputPathstringDirectory path where PDF will be saved
filenamestring optionalName of the PDF file (default: page.pdf)
formatstring optionalPage format (e.g. 'A4', 'Letter')
marginobject optionalPage margins
printBackgroundboolean optionalWhether to print background graphics

Tool: playwright_screenshot

Take a screenshot of the current page or a specific element

ParametersTypeDescription
namestringName for the screenshot
downloadsDirstring optionalCustom downloads directory path (default: user's Downloads folder)
fullPageboolean optionalStore screenshot of the entire page (default: false)
heightnumber optionalHeight in pixels (default: 600)
savePngboolean optionalSave screenshot as PNG file (default: false)
selectorstring optionalCSS selector for element to screenshot
storeBase64boolean optionalStore screenshot in base64 format (default: true)
widthnumber optionalWidth in pixels (default: 800)

Tool: playwright_select

Select an element on the page with Select tag

ParametersTypeDescription
selectorstringCSS selector for element to select
valuestringValue to select

Tool: playwright_upload_file

Upload a file to an input[type='file'] element on the page

ParametersTypeDescription
filePathstringAbsolute path to the file to upload
selectorstringCSS selector for the file input element

Tool: start_codegen_session

Start a new code generation session to record Playwright actions

ParametersTypeDescription
optionsobjectCode generation options

Use this MCP Server

{
  "mcpServers": {
    "playwright-mcp-server": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/local-directory:/local-directory",
        "mcp/mcp-playwright"
      ]
    }
  }
}

Why is it safer to run MCP Servers with Docker?

Install from MCP:Hub

ExecuteAutomation Playwright

ExecuteAutomation Playwright

View and Install from MCP:Hub

Tag summary

Content type

Image

Digest

sha256:5ffcdfc3d

Size

74.6 MB

Last updated

about 1 year ago

docker pull mcp/mcp-playwright

This week's pulls

Pulls:

108

Last week