
Playwright Mcp
Playwright MCP provides browser automation capabilities to LLMs through structured accessibility snapshots rather than screenshots, enabling deterministic web page interactions without requiring vision models. The server exposes Playwright's automation tools via the Model Context Protocol, making it suitable for exploratory automation, self-healing tests, and long-running autonomous workflows that benefit from persistent browser state and rich page structure introspection. It operates as a lightweight, token-efficient alternative to visual approaches, particularly valuable for specialized agentic loops requiring iterative reasoning over page content.
- install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
- 42
- GitHub stars
- 39.5K
- tools
- 23
- transport
- STDIO
- last updated
- Nov 9, 2026
Install
From registry metadata$ npx add-mcp @playwright/mcp --name playwright-mcpRun in your terminal. add-mcp asks which agents to add it to (Claude Code, Codex, Cursor and more). Add -g to install it for every project.
Review the command, arguments and environment values before installing. MCP servers run with your local permissions.
Other ways
Claude Code
$ claude mcp add playwright-mcp -- npx -y @playwright/mcpRun in your terminal. Replace YOUR_* placeholders with real values; add --scope user to install for every project.
Tools
Verified live · 23 toolsVerified live against the running server on Jun 10, 2026.
browser_closeClose the page
Close the page
No parameters. Call it with no arguments.
browser_resizeResize the browser window2 params
Resize the browser window
height*numberwidth*numberbrowser_console_messagesReturns all console messages3 params
Returns all console messages
allbooleanfilenamestringlevel*stringerror · warning · info · debugdefault: infobrowser_handle_dialogHandle a dialog2 params
Handle a dialog
accept*booleanpromptTextstringbrowser_evaluateEvaluate JavaScript expression on page or element4 params
Evaluate JavaScript expression on page or element
elementstringfilenamestringfunction*stringtargetstringbrowser_file_uploadUpload one or multiple files1 params
Upload one or multiple files
pathsarraybrowser_dropDrop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.4 params
Drop files or MIME-typed data onto an element, as if dragged from outside the page. At least one of "paths" or "data" must be provided.
dataobjectelementstringpathsarraytarget*stringbrowser_fill_formFill multiple form fields1 params
Fill multiple form fields
fields*arraybrowser_press_keyPress a key on the keyboard1 params
Press a key on the keyboard
key*stringbrowser_typeType text into editable element5 params
Type text into editable element
elementstringslowlybooleansubmitbooleantarget*stringtext*stringbrowser_navigateNavigate to a URL1 params
Navigate to a URL
url*stringbrowser_navigate_backGo back to the previous page in the history
Go back to the previous page in the history
No parameters. Call it with no arguments.
browser_network_requestsReturns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.3 params
Returns a numbered list of network requests since loading the page. Use browser_network_request with the number to get full details.
filenamestringfilterstringstatic*booleanbrowser_network_requestReturns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.3 params
Returns full details (headers and body) of a single network request, or a single part if `part` is set. Use the number from browser_network_requests.
filenamestringindex*integerpartstringrequest-headers · request-body · response-headers · response-bodybrowser_run_code_unsafeRun a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.2 params
Run a Playwright code snippet. Unsafe: executes arbitrary JavaScript in the Playwright server process and is RCE-equivalent.
codestringfilenamestringbrowser_take_screenshotTake a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.5 params
Take a screenshot of the current page. You can't perform actions based on the screenshot, use browser_snapshot for actions.
elementstringfilenamestringfullPagebooleantargetstringtype*stringpng · jpegdefault: pngbrowser_snapshotCapture accessibility snapshot of the current page, this is better than screenshot4 params
Capture accessibility snapshot of the current page, this is better than screenshot
boxesbooleandepthnumberfilenamestringtargetstringbrowser_clickPerform click on a web page5 params
Perform click on a web page
buttonstringleft · right · middledoubleClickbooleanelementstringmodifiersarraytarget*stringbrowser_dragPerform drag and drop between two elements4 params
Perform drag and drop between two elements
endElementstringendTarget*stringstartElementstringstartTarget*stringbrowser_hoverHover over element on page2 params
Hover over element on page
elementstringtarget*stringbrowser_select_optionSelect an option in a dropdown3 params
Select an option in a dropdown
elementstringtarget*stringvalues*arraybrowser_tabsList, create, close, or select a browser tab.3 params
List, create, close, or select a browser tab.
action*stringlist · new · close · selectindexnumberurlstringbrowser_wait_forWait for text to appear or disappear or a specified time to pass3 params
Wait for text to appear or disappear or a specified time to pass
textstringtextGonestringtimenumberSponsors
Readme
Playwright MCP
A Model Context Protocol (MCP) server that provides browser automation capabilities using Playwright. This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.
Playwright MCP vs Playwright CLI
This package provides MCP interface into Playwright. If you are using a coding agent, you might benefit from using the CLI+SKILLS instead.
- CLI: Modern coding agents increasingly favor CLI–based workflows exposed as SKILLs over MCP because CLI invocations are more token-efficient: they avoid loading large tool schemas and verbose accessibility trees into the model context, allowing agents to act through concise, purpose-built commands. This makes CLI + SKILLs better suited for high-throughput coding agents that must balance browser automation with large codebases, tests, and reasoning within limited context windows.
Learn more about Playwright CLI with SKILLS.
Details
- Repository
- github.com/microsoft/playwright-mcp
- Category
- Web & Browser Automation
- Package
@playwright/mcp- Transport
- STDIO
- Registry
- MCP registry, active
- Tools verified
- Jun 10, 2026