Agent skill
playwright-mcp
Browser automation via Playwright MCP server. Navigate websites, click elements, fill forms, extract data, take screenshots, and perform full browser automation workflows.
Install this agent skill to your Project
npx add-skill https://github.com/LeoYeAI/openclaw-master-skills/tree/main/skills/playwright-mcp
Metadata
Additional technical details for this skill
- openclaw
-
{ "os": [ "linux", "darwin", "win32" ], "emoji": "\ud83c\udfad", "install": [ { "id": "npm-playwright-mcp", "bins": [ "playwright-mcp" ], "kind": "npm", "label": "Install Playwright MCP", "package": "@playwright/mcp" } ], "requires": { "bins": [ "playwright-mcp", "npx" ] } }
SKILL.md
Playwright 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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
audit-website
Audit websites for SEO, performance, security, technical, content, and 15 other issue cateories with 230+ rules using the squirrelscan CLI. Returns LLM-optimized reports with health scores, broken links, meta tag analysis, and actionable recommendations. Use to discover and asses website or webapp issues and health.
firecrawl
Web search and scraping via Firecrawl API. Use when you need to search the web, scrape websites (including JS-heavy pages), crawl entire sites, or extract structured data from web pages. Requires FIRECRAWL_API_KEY environment variable.
computer-use
Full desktop computer use for headless Linux servers. Xvfb + XFCE virtual desktop with xdotool automation. 17 actions (click, type, scroll, screenshot, drag, etc). Unlike OpenClaw's browser tool, operates at the X11 level so websites cannot detect automation. Includes VNC for live viewing.
social-media-analyzer
Social media campaign analysis and performance tracking. Calculates engagement rates, ROI, and benchmarks across platforms. Use for analyzing social media performance, calculating engagement rate, measuring campaign ROI, comparing platform metrics, or benchmarking against industry standards.
business-growth-skills
4 production-ready business and growth skills: customer success manager with health scoring and churn prediction, sales engineer with RFP analysis, revenue operations with pipeline and GTM metrics, and contract & proposal writer. Python tools included (all stdlib-only). Works with Claude Code, Codex CLI, and OpenClaw.
contract-and-proposal-writer
Contract & Proposal Writer
Didn't find tool you were looking for?