Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器clawhub未标认证来源可访问clear审计提醒

playwright-mcp-automationPlaywright MCP 自动化

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

14,636

周安装

616

GitHub Stars

公开资料未说明

下载量

5,125
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:playwright-mcp-automation(Playwright MCP 自动化)
来源仓库:https://github.com/zhanglinghao01-rakuten/playwright-mcp-automation
安装命令:
openclaw skills install playwright-mcp-automation
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install playwright-mcp-automation

简介

playwright-mcp-automation 启动并管理 Playwright MCP 服务器,支持代理通过工具链操控真实网站。

  • 适用于电商结账、用户登录、数据仪表板访问等需要身份验证的自动化场景。
  • 通过 clawhub 安装后,可按需调用各阶段操作接口组成完整工作流。
  • 使用前应确保目标网站允许自动化访问,避免违反服务条款导致账号受限。
  • 建议启用会话持久化功能以维持登录状态,提升连续任务执行效率。

SKILL.md

name
playwright-mcp-automation
description
Launch and operate the Playwright MCP server to let agents browse real websites (login, search, checkout, dashboards) through structured tools. Use when the task requires interacting with live pages beyond simple fetches—e.g., filling ecommerce carts, downloading statements behind auth, capturing screenshots, or testing UI flows with Playwright automation.

Playwright MCP Automation

Overview

Use this skill whenever an agent must drive a real browser session via the Playwright MCP server. It covers standing up the MCP daemon, wiring it into your MCP client, and running reliable automation loops (login → navigate → act → verify). Pair these instructions with the upstream repo (<https://github.com/microsoft/playwright-mcp>) for the latest binaries.

Bundled resources

Quick start (once per host)

  1. Install prerequisites

- Ensure Node.js ≥ 18. - Install Playwright browsers and system deps once:

     npx playwright install chromium
     # Linux only: installs missing libraries (x11, fonts, etc.)
     sudo npx playwright install-deps chromium
  1. Launch the MCP server

- Fast path: run scripts/start_playwright_mcp.sh from this skill directory. Override with PWMCP_BROWSER, PWMCP_PORT, etc. - Need custom flags? Copy-paste from references/setup.md §2–5.

  1. Register the server with your agent

- Local STDIO client:

     {
       "mcpServers": {
         "playwright": {
           "command": "npx",
           "args": ["@playwright/mcp@latest", "--browser=chromium", "--user-data-dir=/home/ai/.cache/playwright/mcp-profile", "--allowed-hosts=*", "--snapshot-mode=incremental"]
         }
       }
     }

- Remote HTTP transport: expose --port/--host then set "url": "http://HOST:PORT/mcp".

  1. Sanity check

- Call browser_navigate to https://example.com, then browser_snapshot. If the tree renders, automation is ready.

Core workflow

Follow this loop for every task. Refer to references/tools.md for exact tool signatures.

1. Plan & prep

  • Clarify success criteria (e.g., "reach checkout confirmation", "download CSV").
  • Decide on headed vs headless mode. Use headed when debugging CAPTCHAs/visual states.
  • Make sure secrets (login cookies, OTP hooks) are available. If not, fall back to manual storage-state provisioning.

2. Navigate & observe

  1. browser_navigate to the starting URL.
  2. Immediately browser_snapshot to capture the accessibility tree.
  3. If layout depends on viewport/device, adjust via launch flags (--device, --viewport-size) or call browser_resize.

3. Interact deterministically

Use semantic tools whenever possible:

  • Inputs/buttons: browser_click, browser_type, browser_fill_form.
  • Dropdowns: browser_select_option.
  • Dynamic menus/tooltips: browser_hoverbrowser_wait_for.
  • Multi-step flows (wizards, carts): after every step, browser_snapshot + assert expected text before proceeding.
  • When markup lacks good roles, enable --caps=vision and fall back to browser_mouse_* tools, but only as a last resort.
  • For brittle sequences (e.g., injecting JS, intercepting fetch), wrap logic inside browser_run_code:
  async (page) => {
    await page.waitForSelector('text=Place order');
    await page.getByRole('button', { name: 'Place order' }).click();
    return await page.getByTestId('order-number').innerText();
  }

4. Handle waits & retries

  • Prefer browser_wait_for with text / textGone over arbitrary sleeps.
  • On timeout, fetch a fresh snapshot, confirm element existence, then retry once before escalating.
  • Capture console/network logs (browser_console_messages, browser_network_requests) to debug API errors or CSP blocks.

5. Verify & capture artefacts

  • Collect evidence via browser_snapshot and, if needed, browser_take_screenshot or browser_pdf_save (enable --caps=pdf).
  • For multi-tab flows, list tabs via browser_tabs and ensure the correct tab is selected before final actions.
  • Always browser_close at the end of unattended runs to release the browser.

Authentication & state strategies

  1. Persistent profile (default script)

- Keeps cookies/localStorage inside PWMCP_PROFILE. Great for daily automations. - Rotate profile path per task to avoid cross-site contamination.

  1. Storage-state bootstrap

- Use Playwright CLI or manual login to create storage.json. Launch with --storage-state=/path/to/storage.json (see setup reference §4). - Update file whenever passwords change.

  1. Secrets file

- Launch with --secrets path/.env so MCP can expose sensitive values via secrets.get. Include API keys or 2FA tokens there instead of SKILL files.

  1. Browser extension bridge

- When you must reuse an already-signed-in Chrome profile, install the Playwright MCP Bridge extension and launch with --extension. Follow upstream README for pairing.

Resilience checklist

  • CAPTCHA / MFA: Surface snapshots promptly so a human can intervene or provide MFA codes. Document fallback in your agent conversation.
  • Slow sites: Increase --timeout-action/--timeout-navigation, or stage requests via browser_wait_for { time }.
  • Resource throttling: Use headless mode and disable --save-video/--save-trace unless debugging.
  • Logging: Save snapshots to files (browser_snapshot filename) for audit trails, especially when producing evidence (e.g., order confirmations).

When to read the references/scripts

Keep SKILL.md lean by offloading details to the references. Update references/scripts whenever the upstream Playwright MCP release adds new capabilities (vision, pdf, devtools, etc.).

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

97.23%
按下载量换算4,983

安全审计

VirusTotal

可疑

ClawScan

通过

Static analysis

未展示

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills