MCP ExplorerExplorer

Playwright MCP

@microsofton 10 days ago
11476 MIT
HostedFreeOfficial
Web Services
#browser automation#web#playwright#accessibility#LLM#MCP#Model Context Protocol#web navigation#form-filling#data extraction
A Model Context Protocol (MCP) server that provides browser automation capabilities using [Playwright](https://playwright.dev). This server enables LLMs to interact with web pages through structured accessibility snapshots, bypassing the need for screenshots or visually-tuned models.

Overview

What is Playwright MCP

Playwright MCP is a Model Context Protocol server that enables browser automation using Playwright’s accessibility tree, providing a structured way to interact with web pages without relying on visual models or screenshots.

Use cases

It is designed for fast and reliable browser automation in scenarios like testing web applications, web scraping, and any other interactive tasks that require precise control over web elements using structured data.

How to use

To use Playwright MCP, install the server in your preferred development environment, configure its settings, and connect it to an MCP client like VS Code, Cursor, or others. After setting it up, you can perform various actions on web pages by sending structured commands.

Key features

Key features include fast and lightweight interactions using the accessibility tree, deterministic tool application that avoids the ambiguities of pixel-based approaches, and the ability for large language models (LLMs) to operate without vision models, improving accessibility and performance.

Where to use

Playwright MCP can be used in various development and testing environments where browser automation is required, particularly in code editors, integrated development environments (IDEs), and continuous integration/continuous deployment (CI/CD) pipelines, enhancing automation capabilities for web applications.

Content

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.

Key Features

  • Fast and lightweight. Uses Playwright's accessibility tree, not pixel-based input.
  • LLM-friendly. No vision models needed, operates purely on structured data.
  • Deterministic tool application. Avoids ambiguity common with screenshot-based approaches.

Requirements

  • Node.js 18 or newer
  • VS Code, Cursor, Windsurf, Claude Desktop or any other MCP client

Getting started

First, install the Playwright MCP server with your client. A typical configuration looks like this:

Local

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": [
        "@playwright/mcp@latest"
      ]
    }
  }
}

Remote

{
  "mcpServers": {
    "playwright": {
      "type": "streamable-http",
      "url": "https://router.mcpso.cc/mcp/playwright"
    }
  }
}

Tools

browser_close
Close the page
browser_wait
Wait for a specified time in seconds
browser_resize
Resize the browser window
browser_file_upload
Upload one or multiple files
browser_install
Install the browser specified in the config. Call this if you get an error about the browser not being installed.
browser_press_key
Press a key on the keyboard
browser_navigate
Navigate to a URL
browser_navigate_back
Go back to the previous page
browser_navigate_forward
Go forward to the next page
browser_pdf_save
Save page as PDF
browser_screen_capture
Take a screenshot of the current page
browser_screen_move_mouse
Move mouse to a given position
browser_screen_click
Click left mouse button
browser_screen_drag
Drag left mouse button
browser_screen_type
Type text
browser_tab_list
List browser tabs
browser_tab_new
Open a new tab
browser_tab_select
Select a tab by index
browser_tab_close
Close a tab

Comments