SuperAPI AI 工具集

playwright-mcp-skill

智能体与模型

查看项目

更新于 10-16 08:48

技能介绍

用途:该技能用于通过 uxc 以固定 stdio 端点运行 Playwright MCP 操作,实现浏览器自动化,并复用 uxc 技能进行通用协议发现、认证/错误处理与信封解析。

前提条件:uxc 已安装并在 PATH 中;npx 可用(已安装 Node.js);首次获取 @playwright/mcp 包需要网络访问;浏览器运行时可在本地启动(本技能默认无头模式)。

核心工作流:端点候选形式包括 npx @playwright/mcp@latest、npx -y @playwright/mcp@latest、默认隔离无头形式 npx -y @playwright/mcp@latest --headless --isolated、共享配置无头形式 npx -y @playwright/mcp@latest --headless --user-data-dir ~/.uxc/playwright-profile,以及共享配置有头形式 npx -y @playwright/mcp@latest --user-data-dir ~/.uxc/playwright-profile。可用 uxc "npx -y @playwright/mcp@latest --headless --isolated" -h 探测端点,确认协议为 MCP stdio。默认本地 stdio 使用无需 OAuth/API 密钥。

固定命令:默认使用 playwright-mcp-cli,缺失时用 uxc link playwright-mcp-cli "npx -y @playwright/mcp@latest --headless --isolated" 创建。可选共享配置双命令: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 browser_navigate -h 等查看操作模式。

护栏:保持 JSON 输出信封,解析 ok、kind、protocol、data、error 等稳定字段;优先读操作(导航/快照)再变更页面状态;高风险操作(表单提交、结账、删除等)需显式确认;优先 browser_snapshot 而非截图;共享配置时串行运行无头/有头链接;配置冲突时保留 --isolated 重试,必要时 uxc daemon stop。

限制:资料未提供更多功能、收费、平台或效果信息。