Labsco
MCP SERVER

Playwright Server

by ziux

Drive a real browser from a conversation — navigate, click by text or label, screenshot, and read the page back.

Browser Automation, Control & Screenshots
Summary
Locators the way a person would describe them.

Most browser servers hand you a CSS selector and wish you luck; exposing `get_by_text`, `get_by_placeholder`, `get_by_label` and `get_by_role` through one action tool means the model can click "the Login button" instead of guessing at a class name that changes next deploy. The text-extraction tool filtering duplicate content is the other quiet win — it keeps a page read from swamping the context.

What it is

A Python server on Playwright that gives a model a live browser session. Beyond navigation and screenshots it exposes Playwright's own locator strategies, so an element can be addressed the way a person describes it — by visible text, placeholder, label or role — rather than by a brittle CSS path.

What you get
  • `playwright_new_session` opens a browser window, optionally at a starting `url`; `playwright_navigate` goes to an address and adds `https://` when the scheme is missing, creating a session if none is open
  • `playwright_screenshot` captures the page, or one element when given a `selector`
  • `playwright_get_text_content` returns the visible text of the page, filtering duplicates; `playwright_get_html_content` returns the HTML of one element
  • `playwright_evaluate` runs a JavaScript `script` in the page console
  • `playwright_action` is the interaction tool: `by` picks the locator strategy (get_by_text, get_by_placeholder, get_by_label, get_by_role and others), `by_value` supplies the value, and `action` is fill, click, dblclick, hover, check and similar — with optional `value`, `force` and `delay`
  • A note store on a `note://` URI scheme, plus a `summarize-notes` prompt whose `style` argument takes brief or detailed
Requirements

Python 3.10+ and Playwright 1.44+. Run it through `uvx` with the argument `playwright-server`, or during development point `uv --directory <path> run playwright-server` at your checkout. Stdio transport, so it runs on the machine whose browser you want driven. Documentation is in Chinese.

Setup effort

One command — uvx playwright-server