← 返回
AI智能 中文

Playwright Mcp Skill

Run browser automation through @playwright/mcp over UXC stdio MCP, with daemon-friendly session reuse and safe action guardrails. Use when tasks need determi...
通过 UXC stdio MCP 使用 @playwright/mcp 运行浏览器自动化,支持守护进程友好的会话复用及安全的操作护栏。适用于需要确定性浏览器操作的任务。
jolestar
AI智能 clawhub v1.0.0 1 版本 99885.6 Key: 无需
★ 0
Stars
📥 873
下载
💾 80
安装
1
版本
#latest

概述

Playwright MCP Skill

Use this skill to run Playwright MCP operations through uxc using fixed stdio endpoints.

Reuse the uxc skill for generic protocol discovery, auth/error handling, and envelope parsing rules.

Prerequisites

  • uxc is installed and available in PATH.
  • npx is available in PATH (Node.js installed).
  • Network access for first-time @playwright/mcp package fetch.
  • Browser runtime can start locally (headless mode is default in this skill).

Core Workflow (Playwright-Specific)

Endpoint candidate inputs before finalizing:

  • Raw package form from docs: npx @playwright/mcp@latest
  • Reliable non-interactive form: npx -y @playwright/mcp@latest
  • Isolated/headless stable form (default for this skill):
  • npx -y @playwright/mcp@latest --headless --isolated
  • Shared-profile headless form (for persistent login state):
  • npx -y @playwright/mcp@latest --headless --user-data-dir ~/.uxc/playwright-profile
  • Shared-profile headed form (for interactive debug with same login state):
  • npx -y @playwright/mcp@latest --user-data-dir ~/.uxc/playwright-profile
  1. Verify protocol/path from official source and probe:
    • Official source: https://github.com/microsoft/playwright-mcp
    • probe candidate endpoints with:
    • uxc "npx -y @playwright/mcp@latest --headless --isolated" -h
    • Confirm protocol is MCP stdio (protocol == "mcp" in envelope).
  2. Detect auth requirement explicitly:
    • Run host help or a minimal read call and inspect envelope.
    • @playwright/mcp default flow is no OAuth/API key for local stdio use.
  3. Use fixed link command by default:
    • command -v playwright-mcp-cli
    • If missing, create it:
    • uxc link playwright-mcp-cli "npx -y @playwright/mcp@latest --headless --isolated"
    • Optional shared-profile dual command setup for persistent sessions:
    • command -v playwright-mcp-headless
    • command -v playwright-mcp-ui
    • uxc link --daemon-exclusive ~/.uxc/playwright-profile playwright-mcp-headless "npx -y @playwright/mcp@latest --headless --user-data-dir ~/.uxc/playwright-profile"
    • uxc link --daemon-exclusive ~/.uxc/playwright-profile playwright-mcp-ui "npx -y @playwright/mcp@latest --user-data-dir ~/.uxc/playwright-profile"
    • playwright-mcp-cli -h
    • If command conflict is detected and cannot be safely reused, stop and ask skill maintainers to pick another fixed command name.
  4. Inspect operation schema before execution:
    • playwright-mcp-cli browser_navigate -h
    • playwright-mcp-cli browser_snapshot -h
    • playwright-mcp-cli browser_click -h
  5. Prefer read-first interaction:
    • Start with navigation/snapshot before mutating page state.
  6. Execute actions with explicit confirmation when impact is high:
    • Confirm before form submission, checkout, delete/destructive actions, or irreversible multi-step flows.

Guardrails

  • Keep automation on JSON output envelope; do not rely on --text.
  • Parse stable fields first: ok, kind, protocol, data, error.
  • Use playwright-mcp-cli as default command path.
  • playwright-mcp-cli ... is equivalent to uxc "npx -y @playwright/mcp@latest --headless --isolated" ....
  • Use direct uxc "" ... only as temporary fallback when link setup is unavailable.
  • If browser profile conflict appears, keep --isolated in endpoint and retry via the same fixed link command.
  • When using shared --user-data-dir, run headless/headed links serially (not concurrently).
  • To enable seamless switching between headed UI login and headless CLI automation using the same profile directory, set a daemon exclusive key:
  • Prefer link-level setup (recommended above), or set UXC_DAEMON_EXCLUSIVE=~/.uxc/playwright-profile for ad-hoc runs.
  • If the profile is still busy (another session is actively running), fallback: uxc daemon stop
  • Prefer browser_snapshot over screenshots for model-action loops.

References

  • Invocation patterns:
  • references/usage-patterns.md

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 06:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

ai-intelligence

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,362 📥 318,826
developer-tools

Discord OpenAPI Skill

jolestar
通过UXC操作Discord HTTP API,使用Discord OpenAPI模式。建议使用Bot令牌以获取完整API访问权限(包括消息和服务器管理)。支持OAuth2...
★ 0 📥 963
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,059 📥 797,982