详细分析 ▾
运行时依赖
版本
- Initial release of playwright-mcp-skill for deterministic browser automation via @playwright/mcp over UXC stdio MCP. - Supports daemon-friendly session reuse and safe action guardrails. - Default workflow includes headless, isolated sessions; persistent shared profiles are optionally supported. - Provides fixed command linking with `playwright-mcp-cli` for streamlined usage. - Enforces JSON envelope protocol parsing and explicit guardrails for safe browser actions. - Designed for CLI integration with prerequisites for Node.js, npx, and uxc.
安装命令 点击复制
技能文档
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
uxcinstalled 和 可用 在...中PATH.npx可用 在...中PATH(节点.js installed).- Network access 对于 第一个-时间
@playwright/mcp包 获取. - Browser runtime 可以 开始 locally (headless mode 默认 在...中 skill).
Core Workflow (Playwright-Specific)
Endpoint candidate inputs before finalizing:
- Raw 包 表单 从 docs:
npx @playwright/mcp@latest - Reliable non-interactive 表单:
npx -y @playwright/mcp@latest - Isolated/headless stable 表单 (默认 对于 skill):
npx -y @playwright/mcp@latest --headless --isolated
- Shared-个人资料 headless 表单 (对于 persistent 登录 state):
- npx -y @playwright/mcp@latest --headless --用户-data-dir ~/.uxc/playwright-个人资料
- Shared-个人资料 headed 表单 (对于 interactive debug 带有 相同 登录 state):
- npx -y @playwright/mcp@latest --用户-data-dir ~/.uxc/playwright-个人资料- 验证 protocol/path 从 official source 和 probe:
https://github.com/microsoft/playwright-mcp
- probe candidate endpoints 带有:
- uxc "npx -y @playwright/mcp@latest --headless --isolated" -h
- Confirm protocol MCP stdio (protocol == "mcp" 在...中 envelope).
- Detect auth requirement explicitly:
@playwright/mcp 默认 flow 否 OAuth/API 键 对于 local stdio 使用.
- 使用 fixed 链接 command 由 默认:
command -v playwright-mcp-cli
- 如果 missing, 创建 :
- uxc 链接 playwright-mcp-cli "npx -y @playwright/mcp@latest --headless --isolated"
- 可选 shared-个人资料 dual command setup 对于 persistent sessions:
- command -v playwright-mcp-headless
- command -v playwright-mcp-ui
- uxc 链接 --daemon-exclusive ~/.uxc/playwright-个人资料 playwright-mcp-headless "npx -y @playwright/mcp@latest --headless --用户-data-dir ~/.uxc/playwright-个人资料"
- uxc 链接 --daemon-exclusive ~/.uxc/playwright-个人资料 playwright-mcp-ui "npx -y @playwright/mcp@latest --用户-data-dir ~/.uxc/playwright-个人资料"
- playwright-mcp-cli -h
- 如果 command conflict detected 和 cannot safely reused, 停止 和 ask skill maintainers 到 pick 另一个 fixed command name.
- Inspect operation schema 之前 execution:
playwright-mcp-cli browser_navigate -h
- playwright-mcp-cli browser_snapshot -h
- playwright-mcp-cli browser_click -h
- Prefer 读取-第一个 interaction:
- Execute actions 带有 explicit confirmation 当...时 impact high:
Guardrails
- Keep automation 在...上 JSON 输出 envelope; 做 不 rely 在...上
--text. - 解析 stable fields 第一个:
ok,kind,protocol,data,错误. - 使用
playwright-mcp-cli作为 默认 command path. playwright-mcp-cliequivalent 到... uxc "npx -y @playwright/mcp@latest --headless --isolated".... - 使用 direct
uxc "仅 作为 temporary fallback 当...时 链接 setup 不可用." ... - 如果 browser 个人资料 conflict appears, keep
--isolated在...中 endpoint 和 重试 通过 相同 fixed 链接 command. - 当...时 使用 shared
--用户-data-dir, run headless/headed links serially (不 concurrently). - 到 enable seamless switching 之间 headed UI 登录 和 headless CLI automation 使用 相同 个人资料 directory, 设置 daemon exclusive 键:
UXC_DAEMON_EXCLUSIVE=~/.uxc/playwright-个人资料 对于 ad-hoc runs.
- 如果 个人资料 仍然 busy (另一个 会话 actively running), fallback: uxc daemon 停止
- Prefer
browser_snapshot在...上 screenshots 对于 模型-action loops.
References
- Invocation patterns:
references/usage-patterns.md
免费技能或插件可能存在安全风险,如需更匹配、更安全的方案,建议联系付费定制