Skill Playwright MCP

Playwright MCP Skill

undermybelt Updated

File contents

Playwright MCP Skill

Browser automation via Official Microsoft MCP server

功能

通过 MCP 协议控制浏览器(自动化、测试、抓取、UI 验证)。

核心能力

  • 导航、点击、输入
  • 截图、快照
  • 元素查找(role/aria)
  • 等待、评估
  • 表单提交

前置要求

  • 安装 MCP server: npm install -g @microsoft/playwright-mcp
  • 启动: playwright-mcp --port 8931

命令

/playwright open <url>              # 打开页面
/playwright click <selector>        # 点击元素
/playwright type <selector> <text>  # 输入文本
/playwright screenshot [path]       # 截图
/playwright snapshot                # 获取页面结构(AI 友好)
/playwright eval <js>               # 执行 JS

示例

/playwright open https://google.com
/playwright type input[name="q"] "OpenClaw"
/playwright click input[type="submit"]
/playwright screenshot ~/search-results.png

配置

mcp:
  server: "playwright-mcp"
  port: 8931
  timeout: 30000
browser:
  headless: true
  viewport: { width: 1280, height: 720 }

Skill: playwright-mcp Created: 2026-02-11 00:58 Inspired by microsoft/playwright-mcp (27k⭐)

Undermybelt/skill-playwright-mcp/tree/main/ commit eb3d228a26

Frequently asked questions

npx skillmds@latest add undermybelt/skill-playwright-mcp