Skip to main content

Get Started in Minutes

This guide will walk you through setting up Playwright MCP and creating your first web automation.
1

Install Playwright MCP

Install the Playwright MCP server using npx. The simplest configuration works with most MCP clients:
The @latest tag ensures you always get the most recent version with the latest features and fixes.
2

Configure Your MCP Client

Add Playwright MCP to your client’s configuration. Most clients use a standard JSON configuration:
For one-click installation in specific clients, see the Installation Guide.
3

Verify Installation

Restart your MCP client and verify that Playwright MCP is connected. You should see browser automation tools available in your client’s tool list.
On first run, Playwright may download browser binaries. This is a one-time setup and may take a few minutes.
4

Create Your First Automation

Let’s create a simple automation that navigates to a website and captures its content:
The LLM will use these tools:
  • browser_navigate - Navigate to the URL
  • browser_snapshot - Capture page accessibility tree
Try asking your LLM to interact with specific elements: “Click the login button” or “Fill in the search form”.
5

Explore Available Tools

Playwright MCP provides dozens of tools for browser automation:
  • browser_navigate - Navigate to URLs
  • browser_snapshot - Capture page accessibility tree
  • browser_click - Click elements
  • browser_type - Type text into fields
  • browser_fill_form - Fill multiple form fields
  • browser_take_screenshot - Capture screenshots
  • browser_evaluate - Execute JavaScript
  • browser_run_code - Run Playwright code snippets
  • browser_network_requests - Monitor network activity
  • browser_console_messages - Capture console logs
  • browser_tabs - Manage browser tabs
  • browser_pdf_save - Generate PDFs (with —caps=pdf)
  • browser_verify_* - Test assertions (with —caps=testing)

Example Workflows

Web Scraping

The LLM will:
  1. Navigate to the website
  2. Capture the accessibility snapshot
  3. Parse the structured data to find story titles
  4. Return the top 5 results

Form Automation

The LLM will:
  1. Navigate to the contact page
  2. Locate form fields using the accessibility tree
  3. Fill in each field
  4. Click the submit button

Testing Workflows

The LLM will:
  1. Navigate and capture the page
  2. Use browser_verify_element_visible to check for the button
  3. Interact with the login form
  4. Verify the authentication flow

Configuration Options

You can customize Playwright MCP behavior with command-line arguments:
Common options:
  • --browser - Choose browser: chrome, firefox, webkit, msedge
  • --headless - Run browser in headless mode
  • --timeout-action - Set action timeout in milliseconds (default: 5000)
  • --timeout-navigation - Set navigation timeout (default: 60000)
  • --caps - Enable additional capabilities: vision, pdf, devtools
See the Configuration Reference for all available options.

Next Steps

Installation Guide

Detailed setup instructions for all MCP clients

Configuration

Learn about all configuration options and advanced setup

Available Tools

Explore all browser automation tools and capabilities

Core Concepts

Understand MCP and browser automation fundamentals