even-better-playwright-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| browser | No | Browser to use: chromium, firefox, webkit (default: chromium) | chromium |
| headless | No | Run browser in headless mode (default: false) | false |
| cdp-endpoint | No | Connect to existing browser via CDP endpoint | |
| user-data-dir | No | Use persistent browser profile directory |
Capabilities
Features and capabilities supported by this server
| Capability | Details |
|---|---|
| tools | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| snapshotA | Get compressed accessibility snapshot with ref IDs. Returns: DOM tree with [ref=e1], [ref=e2] etc. Use refs with execute tool: await $('e1').click() Call again after navigation (refs become stale). Options:
|
| screenshotA | Capture page screenshot. Options:
When withLabels is used, labels are color-coded by role:
|
| browser_executeA | Execute Playwright code with these in scope:
Rules
Checking Page StateAfter any action (click, submit, navigate), verify what happened: For visually complex pages (grids, galleries, dashboards), use screenshotWithAccessibilityLabels({ page }) instead. Accessibility SnapshotsExample output: Use aria-ref to interact - NO quotes around the ref value: For pagination: Choosing snapshot method:
Selector Best PracticesFor unknown sites: use accessibilitySnapshot() with aria-ref For development (with source access), prefer:
If locator matches multiple elements (strict mode violation), use Working with PagesNavigationCommon PatternsPopups: page.evaluateCode inside page.evaluate() runs in the browser - use plain JavaScript only. console.log inside evaluate runs in browser, not visible here: Utility Functions
Network InterceptionFor scraping/reverse-engineering APIs, intercept network instead of scrolling DOM: Then trigger actions and analyze: IMPORTANT: After navigation, refs are stale - call snapshot tool again. |
| browser_search_snapshotA | Search current snapshot with regex. Requires: Call snapshot first. Returns: Matching lines with refs. Options:
Use this to find specific elements in large pages without re-reading the entire snapshot. |
| browser_network_requestsA | Get captured network requests from the browser. Automatically starts capturing when first called. Use includeStatic:true to include images/CSS/fonts. Returns recent requests with status, timing, and response previews. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| Debugger API | CDP Debugger API - set breakpoints, step through code, inspect variables |
| Editor API | CDP Editor API - view and live-edit page scripts and CSS at runtime |
| Styles API | CDP Styles API - inspect CSS styles applied to elements |
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/SJMakin/even-better-playwright-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server