Labsco
MCP SERVER

Playwright MCP Server

by executeautomation

Drive a browser and the API behind it in one session, and leave with a Playwright test for what you did.

Browser Automation, Control & ScreenshotsVerified
Summary
The exploratory session becomes the test.

A codegen session brackets whatever you did in between and produces a Playwright test file from it, so a bug reproduced by hand leaves a regression test rather than a paragraph in a ticket. The HTTP verbs sitting beside the browser calls mean state can be set up through the API and then checked in the UI.

What it is

Playwright behind an agent interface: navigation and interaction by CSS selector including inside iframes, page content as text or cleaned HTML, direct HTTP verbs alongside the browser, response assertions, and a codegen session that writes the test file for whatever happened between start and end.

What you get
  • A browser opened at a URL with the browser type, headless mode, viewport and wait condition set on the call — chromium by default
  • Interaction by selector: click, fill, select, hover, drag, key press and file upload, with click and fill available for elements inside an iframe
  • A click that follows into the tab it opens, so a target=_blank flow does not end the session
  • Page content as visible text, or as HTML cleaned to taste — scripts, styles, comments and meta stripped, minified, or narrowed to one selector
  • Screenshots, the page saved as a PDF, a custom user agent, and resizing either by explicit viewport or by device preset such as iPhone 13, Pixel 7 or Desktop Chrome, which sets user agent, scale factor and touch together
  • GET, POST, PUT, PATCH and DELETE with headers and a bearer token, in the same session as the browser
  • A wait for a named HTTP response registered first, then asserted once it arrives
  • Console logs filtered by type and search term, and JavaScript evaluated in the page
  • Codegen sessions as real objects — started, inspected, cleared and ended — with the end writing the Playwright test file
Requirements

Node, run over stdio from npm as @executeautomation/playwright-mcp-server through npx, or built from a clone and linked locally. The Playwright browser binaries have to be present on the machine — every browser tool fails on launch until they are installed, while the HTTP verbs work without them. Calls take CSS selectors, so you need the page's markup; playwright_get_visible_html will fetch it if you do not have it. The API side does not yet cover OAuth, multipart forms or binary bodies.

Setup effort

One command — npm install -g @executeautomation/playwright-mcp-server