Get Started in Minutes
This guide will walk you through setting up Playwright MCP and creating your first web automation.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.Configure Your MCP Client
Add Playwright MCP to your client’s configuration. Most clients use a standard JSON configuration:
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.
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 URLbrowser_snapshot- Capture page accessibility tree
Explore Available Tools
Playwright MCP provides dozens of tools for browser automation:
Core Automation Tools
Core Automation Tools
browser_navigate- Navigate to URLsbrowser_snapshot- Capture page accessibility treebrowser_click- Click elementsbrowser_type- Type text into fieldsbrowser_fill_form- Fill multiple form fieldsbrowser_take_screenshot- Capture screenshotsbrowser_evaluate- Execute JavaScriptbrowser_run_code- Run Playwright code snippets
Advanced Tools
Advanced Tools
browser_network_requests- Monitor network activitybrowser_console_messages- Capture console logsbrowser_tabs- Manage browser tabsbrowser_pdf_save- Generate PDFs (with —caps=pdf)browser_verify_*- Test assertions (with —caps=testing)
Example Workflows
Web Scraping
- Navigate to the website
- Capture the accessibility snapshot
- Parse the structured data to find story titles
- Return the top 5 results
Form Automation
- Navigate to the contact page
- Locate form fields using the accessibility tree
- Fill in each field
- Click the submit button
Testing Workflows
- Navigate and capture the page
- Use
browser_verify_element_visibleto check for the button - Interact with the login form
- Verify the authentication flow
Configuration Options
You can customize Playwright MCP behavior with command-line arguments:--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
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

