mcp-playwright
MCP ServerFreePlaywright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌
Capabilities14 decomposed
stateful-browser-automation-via-mcp
Medium confidenceLaunches and maintains a single persistent Playwright browser instance (Chromium, Firefox, or WebKit) across multiple MCP tool invocations, with automatic page context management and error recovery. The server implements a global browser state pattern where the browser instance persists until explicitly closed, enabling multi-step workflows where each tool call operates on the same page context without re-initialization overhead.
Implements MCP protocol binding for Playwright with a global browser singleton pattern, allowing LLMs to invoke 27 browser tools against a persistent page context without managing browser lifecycle — the server handles all browser state internally via BrowserToolBase inheritance and requestHandler.ts dispatch logic
Simpler than Selenium Grid or Puppeteer clusters for LLM integration because it abstracts browser lifecycle entirely behind MCP tools, eliminating the need for agents to manage WebDriver sessions or connection pooling
dom-interaction-via-playwright-selectors
Medium confidenceProvides 8+ DOM interaction tools (click, fill, hover, drag, select, type, focus, blur) that use Playwright's selector engine to locate and manipulate elements. Each tool accepts CSS selectors, XPath, or Playwright's built-in locator strategies (role-based, text-based), validates element visibility and interactability before action, and returns detailed error messages if elements are not found or disabled.
Wraps Playwright's locator engine with MCP tool contracts, enabling LLMs to use role-based and text-based selectors (e.g., 'button with text Submit') instead of brittle CSS selectors, with built-in visibility and interactability validation via Playwright's isVisible() and isEnabled() checks before action execution
More robust than raw Selenium WebDriver for LLM use because Playwright's locator strategies (role, text, label) are more resilient to DOM changes, and the MCP abstraction eliminates the need for agents to manage WebDriver waits or exception handling
form-interaction-and-select-dropdown-handling
Medium confidenceProvides playwright_fill, playwright_select, and playwright_check tools that handle form input, dropdown selection, and checkbox/radio button toggling. The tools use Playwright's fill() for text inputs, selectOption() for <select> elements, and check()/uncheck() for checkboxes and radio buttons. Each tool validates element type before interaction and returns success/error status.
Provides separate MCP tools for fill, select, and check operations, each with element-type validation and error handling, enabling LLMs to interact with standard HTML forms without understanding the differences between input types or managing Playwright's type-specific APIs
More robust than generic click-and-type automation because it uses Playwright's type-specific APIs (selectOption for dropdowns, check for checkboxes) which handle browser quirks and validation, reducing flakiness compared to simulating clicks and keyboard input
page-context-and-frame-switching
Medium confidenceProvides playwright_switch_frame and playwright_get_frames tools that manage frame and iframe context switching. The tools use Playwright's frame() API to select frames by name, URL, or index, and return frame information (name, URL, parent frame). Enables automation of pages with iframes, nested frames, and cross-origin frames (if allowed by CORS).
Exposes Playwright's frame() API as MCP tools for frame switching and enumeration, enabling LLMs to navigate iframe hierarchies without understanding Playwright's frame context model or managing frame references across tool invocations
More explicit than Selenium's frame switching because it provides frame enumeration (get_frames) and returns frame metadata (name, URL), allowing agents to discover frames dynamically rather than hardcoding frame selectors
response-validation-and-assertion-tools
Medium confidenceProvides expect_response and assert_response tools that validate HTTP responses from API calls or page navigation. The tools check response status codes, headers, body content (JSON schema, text patterns), and return validation results (pass/fail) with detailed error messages. Useful for verifying API contracts and detecting unexpected responses during automation.
Provides dedicated assertion tools (expect_response, assert_response) that validate HTTP responses with structured error reporting, enabling LLMs to verify API contracts and detect errors without writing custom validation logic or parsing response objects
More integrated than generic assertion libraries because it works directly with MCP tool responses and provides structured validation results that agents can reason about, rather than requiring agents to parse response objects and write custom validation code
screenshot-and-pdf-export-with-viewport-control
Medium confidenceProvides playwright_screenshot and playwright_save_as_pdf tools that capture page visuals in PNG or PDF format with optional viewport and full-page rendering. The tools accept options for full-page capture, viewport dimensions, clip regions, and quality settings. Screenshots are returned as base64-encoded PNG, and PDFs are returned as binary files. Useful for visual testing, documentation, and evidence collection.
Exposes Playwright's screenshot() and pdf() APIs as MCP tools with base64 encoding for easy transport over STDIO, enabling LLMs to capture visual evidence without managing file I/O or image encoding, and returning images directly in tool responses for agent reasoning
More convenient than raw Playwright screenshots because it returns base64-encoded images directly in MCP tool responses, allowing LLMs to reason about visual content without requiring separate file handling or image transport mechanisms
page-content-extraction-and-screenshot-capture
Medium confidenceExtracts visible text, HTML structure, and accessibility tree from the current page via playwright_get_visible_text and playwright_get_page_content tools, and captures full-page or viewport screenshots as PNG/PDF via playwright_screenshot and playwright_save_as_pdf. The extraction logic uses Playwright's textContent() and innerHTML() APIs with optional filtering to return only visible, non-hidden elements.
Combines Playwright's textContent(), innerHTML(), and accessibility tree APIs into MCP tools that return structured data (text, HTML, ARIA tree) alongside visual captures (PNG, PDF), enabling LLMs to reason about page state using both textual and visual information without requiring separate vision models
More comprehensive than Puppeteer's screenshot-only approach because it extracts both visual (PNG/PDF) and semantic (text, HTML, accessibility tree) representations, allowing agents to understand page structure without vision model overhead
browser-navigation-and-history-control
Medium confidenceProvides playwright_navigate, playwright_go_back, playwright_go_forward, and playwright_reload tools that control page navigation using Playwright's page.goto(), page.goBack(), page.goForward(), and page.reload() APIs. Each tool accepts URLs, handles redirects and timeouts, and returns navigation status (success, timeout, network error) with optional wait-for-load-state configuration (load, domcontentloaded, networkidle).
Wraps Playwright's navigation APIs with MCP tool contracts that expose wait-until strategies (load, domcontentloaded, networkidle) as tool parameters, allowing LLMs to specify load-state expectations without understanding Playwright internals, and returns structured navigation status (success/timeout/error) for agent decision-making
More flexible than Selenium's WebDriver.get() because Playwright's wait-until strategies (networkidle) detect when dynamic content has finished loading, not just when DOM is ready, reducing flaky waits in AJAX-heavy applications
rest-api-testing-with-request-context
Medium confidenceProvides 5 HTTP method tools (playwright_api_get, playwright_api_post, playwright_api_put, playwright_api_patch, playwright_api_delete) that create APIRequestContext instances on-demand to execute REST requests. Each tool accepts URL, headers, body, authentication (Bearer token, Basic auth), query parameters, and returns response status, headers, and body (JSON or text) with optional response validation via expect_response and assert_response tools.
Leverages Playwright's APIRequestContext to share cookies and session state between API calls and browser automation, enabling seamless workflows where API authentication tokens can be used in subsequent browser requests without manual cookie management, implemented via ApiToolBase inheritance pattern
More integrated than separate curl/axios tools because it shares browser cookies and session context automatically, eliminating the need for agents to manually extract and pass authentication tokens between API and browser layers
browser-console-monitoring-and-logging
Medium confidenceCaptures browser console messages (log, warn, error, debug) via playwright_console_logs tool using Playwright's page.on('console') event listener. The ConsoleLogsTool registers a message handler that buffers console messages in memory and returns them as structured objects with message type, text content, and optional stack traces. Useful for debugging JavaScript errors and monitoring application behavior during automation.
Implements a ConsoleLogsTool that registers Playwright's page.on('console') event listener to capture all console messages in a structured format, enabling LLMs to inspect JavaScript errors and application logs without requiring separate DevTools protocol connections or browser extensions
Simpler than DevTools protocol inspection because it exposes console messages directly as MCP tool output, allowing agents to reason about errors without parsing DevTools JSON or managing separate protocol connections
action-recording-and-codegen-session-management
Medium confidenceProvides start_codegen_session, end_codegen_session, get_codegen_session, and clear_codegen_session tools that manage ActionRecorder instances. When a codegen session is active, all browser tool invocations (click, fill, navigate, etc.) are recorded as action objects. When end_codegen_session is called, the PlaywrightGenerator converts recorded actions into executable Playwright test code (JavaScript or TypeScript) that can be saved and run independently.
Implements ActionRecorder that intercepts all browser tool invocations during a codegen session and converts them to Playwright test code via PlaywrightGenerator, enabling LLMs to generate executable test scripts from recorded interactions without requiring users to understand Playwright API syntax
More integrated than Playwright Inspector because it generates code automatically from MCP tool invocations without requiring users to interact with a separate UI, and it works within LLM agent workflows where recording and code generation happen programmatically
mcp-protocol-tool-dispatch-and-request-handling
Medium confidenceImplements the Model Context Protocol (MCP) server that exposes 36 tools (27 browser, 5 API, 4 codegen) as MCP resources. The server receives tool invocation requests via STDIO transport, routes them through requestHandler.ts and toolHandler.ts, executes the appropriate tool via the tool's execute(args, context) method, and returns ToolResponse objects with result or error. Each tool is registered with JSON schema describing parameters and return types, enabling MCP clients (Claude Desktop, Cline, Cursor) to discover and invoke tools with type safety.
Implements a complete MCP server that wraps Playwright tools with MCP protocol contracts, enabling seamless integration with Claude Desktop, Cline, and Cursor without requiring users to write custom tool bindings or manage Playwright lifecycle — the server handles all MCP protocol details and tool dispatch internally
More standardized than custom Playwright integrations because it uses the MCP protocol, allowing the same tool set to work across multiple AI clients (Claude, Copilot, custom agents) without reimplementation, and it provides automatic tool discovery and schema validation
element-wait-and-visibility-polling
Medium confidenceProvides playwright_wait_for_selector and playwright_wait_for_navigation tools that poll for element visibility or navigation completion using Playwright's waitForSelector() and waitForNavigation() APIs. The tools accept CSS selectors, XPath, or Playwright locators, and timeout values (default 30s), and return success/timeout status. Useful for handling dynamic content loading, AJAX requests, and asynchronous page updates.
Wraps Playwright's waitForSelector() and waitForNavigation() APIs as MCP tools with configurable timeout and state parameters, enabling LLMs to wait for dynamic content without understanding Playwright's async/await patterns or managing Promise resolution
More reliable than hardcoded sleep() delays because it polls for actual element visibility or navigation completion, reducing flakiness in AJAX-heavy applications, and it integrates timeout and state configuration as tool parameters for agent control
keyboard-and-mouse-event-simulation
Medium confidenceProvides playwright_type, playwright_press, playwright_hover, and playwright_drag tools that simulate keyboard and mouse events using Playwright's type(), press(), hover(), and drag() APIs. The tools accept element selectors, keyboard input strings, modifier keys (Shift, Ctrl, Alt, Meta), and drag source/target coordinates. Useful for complex interactions like keyboard shortcuts, form filling with special characters, and drag-and-drop operations.
Exposes Playwright's type(), press(), hover(), and drag() APIs as separate MCP tools with modifier key support, enabling LLMs to simulate complex keyboard and mouse interactions without understanding Playwright's event API or timing semantics
More flexible than click-only automation because it supports keyboard shortcuts, special characters, and drag-and-drop, enabling agents to interact with complex UIs that require multi-key combinations or gesture-based interactions
Capabilities are decomposed by AI analysis. Each maps to specific user intents and improves with match feedback.
Related Artifactssharing capabilities
Artifacts that share capabilities with mcp-playwright, ranked by overlap. Discovered automatically through the match graph.
@executeautomation/playwright-mcp-server
Model Context Protocol servers for Playwright
@executeautomation/playwright-mcp-server
Model Context Protocol servers for Playwright
playwright-mcp
Playwright MCP server
onestep-puppeteer-mcp-server
Experimental MCP server for browser automation using Puppeteer (inspired by @modelcontextprotocol/server-puppeteer)
bb-browser
Your browser is the API. CLI + MCP server for AI agents to control Chrome with your login state.
@hisma/server-puppeteer
Fork and update (v0.6.5) of the original @modelcontextprotocol/server-puppeteer MCP server for browser automation using Puppeteer.
Best For
- ✓AI agents and LLMs (Claude, Copilot) automating multi-step web workflows
- ✓Teams building browser automation agents that need persistent session state
- ✓Developers integrating Playwright automation into MCP-compatible IDEs (Claude Desktop, Cline, Cursor)
- ✓LLM agents automating web forms, e-commerce checkouts, and user workflows
- ✓QA automation engineers generating test code from recorded interactions
- ✓Non-technical users recording browser actions and converting them to executable scripts
- ✓LLM agents automating web forms, surveys, and checkout flows
- ✓QA engineers testing form validation and submission workflows
Known Limitations
- ⚠Single global browser instance means concurrent requests from multiple clients will serialize or conflict — no multi-browser isolation per client
- ⚠Browser state is in-memory only — no persistence across server restarts, requiring external state management for long-lived sessions
- ⚠Page context is shared across all tool invocations, so one tool's navigation can affect subsequent tools' page state unexpectedly
- ⚠Selector brittleness — if DOM structure changes, selectors may fail; no built-in selector repair or fuzzy matching
- ⚠Shadow DOM and iframe traversal requires explicit frame context switching; no automatic cross-frame selector resolution
- ⚠Drag-and-drop operations are limited to Playwright's drag() API — complex gesture sequences (multi-touch, pinch) not supported
Requirements
Input / Output
UnfragileRank
UnfragileRank is computed from adoption signals, documentation quality, ecosystem connectivity, match graph feedback, and freshness. No artifact can pay for a higher rank.
Repository Details
Last commit: Dec 13, 2025
About
Playwright Model Context Protocol Server - Tool to automate Browsers and APIs in Claude Desktop, Cline, Cursor IDE and More 🔌
Categories
Alternatives to mcp-playwright
Are you the builder of mcp-playwright?
Claim this artifact to get a verified badge, access match analytics, see which intents users search for, and manage your listing.
Get the weekly brief
New tools, rising stars, and what's actually worth your time. No spam.
Data Sources
Looking for something else?
Search →