Playwright MCP
Browser automation via Playwright MCP server. Navigate websites, click elements, fill forms, extract data, take screenshots, and perform full browser automation workflows.
Spiceman161
@spiceman161
What This Skill Does
Browser automation tool that controls Chrome, Firefox, or WebKit via an MCP server. Navigates pages, clicks elements, fills forms, extracts text, runs JavaScript, takes screenshots, and handles file uploads through a set of MCP tools.
Replaces manual browser testing and custom Selenium/Puppeteer scripts with a standardized MCP interface for programmatic browser control.
When to Use It
- Automate login flows and form submissions on web applications
- Extract structured data from tables or lists on dynamic web pages
- Take screenshots of pages for visual regression testing
- Fill and submit multi-step web forms with validation
- Scrape content from JavaScript-heavy sites that require full browser rendering
- Test web app interactions across different browser engines (Chromium, Firefox, WebKit)
Install
$ openclaw skills install @spiceman161/playwright-mcpPlaywright MCP Skill
Browser automation powered by Playwright MCP server. Control Chrome, Firefox, or WebKit programmatically.
Installation
npm install -g @playwright/mcp
# Or
npx @playwright/mcp
Install browsers (first time):
npx playwright install chromium
Quick Start
Start MCP Server (STDIO mode)
npx @playwright/mcp
Start with Options
# Headless mode
npx @playwright/mcp --headless
# Specific browser
npx @playwright/mcp --browser firefox
# With viewport
npx @playwright/mcp --viewport-size 1280x720
# Ignore HTTPS errors
npx @playwright/mcp --ignore-https-errors
Common Use Cases
1. Navigate and Extract Data
# MCP tools available:
# - browser_navigate: Open URL
# - browser_click: Click element
# - browser_type: Type text
# - browser_select_option: Select dropdown
# - browser_get_text: Extract text content
# - browser_evaluate: Run JavaScript
# - browser_snapshot: Get page structure
# - browser_close: Close browser
2. Form Interaction
1. browser_navigate to form URL
2. browser_type into input fields
3. browser_click to submit
4. browser_get_text to verify result
3. Data Extraction
1. browser_navigate to page
2. browser_evaluate to run extraction script
3. Parse returned JSON data
MCP Tools Reference
| Tool | Description |
|---|---|
browser_navigate | Navigate to URL |
browser_click | Click element by selector |
browser_type | Type text into input |
browser_select_option | Select dropdown option |
browser_get_text | Get text content |
browser_evaluate | Execute JavaScript |
browser_snapshot | Get accessible page snapshot |
browser_close | Close browser context |
browser_choose_file | Upload file |
browser_press | Press keyboard key |
Configuration Options
# Security
--allowed-hosts example.com,api.example.com
--blocked-origins malicious.com
--ignore-https-errors
# Browser settings
--browser chromium|firefox|webkit
--headless
--viewport-size 1920x1080
--user-agent "Custom Agent"
# Timeouts
--timeout-action 10000 # Action timeout (ms)
--timeout-navigation 30000 # Navigation timeout (ms)
# Output
--output-dir ./playwright-output
--save-trace
--save-video 1280x720
Examples
Login to Website
browser_navigate: { url: "https://example.com/login" }
browser_type: { selector: "#username", text: "user" }
browser_type: { selector: "#password", text: "pass" }
browser_click: { selector: "#submit" }
browser_get_text: { selector: ".welcome-message" }
Extract Table Data
browser_navigate: { url: "https://example.com/data" }
browser_evaluate: {
script: "() => { return Array.from(document.querySelectorAll('table tr')).map(r => r.textContent); }"
}
Screenshot
browser_navigate: { url: "https://example.com" }
browser_evaluate: { script: "() => { document.body.style.zoom = 1; return true; }" }
# Screenshot saved via --output-dir or returned in response
Security Notes
- By default restricts file system access to workspace root
- Host validation prevents navigation to untrusted domains
- Sandboxing enabled by default (use
--no-sandboxwith caution) - Service workers blocked by default
Troubleshooting
# Update browsers
npx playwright install chromium
# Debug mode
npx @playwright/mcp --headless=false --output-mode=stdout
# Check installation
playwright-mcp --version
Links
Top skills in this category
Content Strategy
@jk-0001Build and execute a content marketing strategy for a solopreneur business. Use when planning what content to create, deciding on content formats and channels, building a content calendar, measuring content performance, or systematizing content production. Covers audience research for content, content pillars, distribution strategy, repurposing workflows, and metrics. Trigger on "content strategy", "content marketing", "what content should I create", "content plan", "content calendar", "content ideas", "content distribution", "grow through content".
小红书自动发布助手
@yuf1011Draft and publish posts to 小红书 (Xiaohongshu/RED). Use when creating content for 小红书, drafting posts, generating cover images, or publishing via browser automation. Covers the full workflow from content creation to browser-based publishing, including cover image generation with Pillow.
Agent Browser
@matrixyHeadless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection
Browser Use
@shawnpanaAutomates browser interactions for web testing, form filling, screenshots, and data extraction. Use when the user needs to navigate websites, interact with w...
Playwright (Automation + MCP + Scraper)
@ivangdavilaAutomates, tests, and debugs browsers with Playwright: locators, auto-waiting, traces, CI runs, and MCP browser control. Use when a test is flaky, times out, or fails only in CI or headless; when a locator matches multiple elements or the wrong one (strict mode violation); when clicks need force, waits become sleeps, or networkidle never settles; for storageState and login setup, request mocking and HAR replay, uploads and downloads, iframes and shadow DOM, popups and dialogs, screenshot diffs that change per machine, trace and report artifacts, sharding a slow suite, device and permission emulation, accessibility checks, driving a real browser through Playwright MCP, extracting data from JS-rendered pages, or porting a Cypress, Puppeteer, or Selenium suite to Playwright. Not for maintaining an existing Cypress or Puppeteer suite (cypress, puppeteer) or for work a plain HTTP request answers (http).