P

Playwright浏览器自动化工具

@lebrodus/mcp-playwright
0 Stars 1.5k 次浏览 lebrodus 更新于 2026-08-23

一个启用 Playwright 浏览器自动化的服务器,允许通过大语言模型在浏览器环境中与网页交互、截取屏幕截图以及执行 JavaScript。

MCP 服务配置

复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用

{
  "mcpServers": {
    "playwright": {
      "args": [
        "-y",
        "@executeautomation/playwright-mcp-server"
      ],
      "command": "npx"
    }
  }
}

可用工具 (12 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

playwright_navigate 1 个参数 需填 1 项

Navigate to a URL

必填参数:url

playwright_screenshot 7 个参数 需填 1 项

Take a screenshot of the current page or a specific element

必填参数:name

playwright_click 1 个参数 需填 1 项

Click an element on the page

必填参数:selector

playwright_fill 2 个参数 需填 2 项

fill out an input field

必填参数:selector、value

playwright_select 2 个参数 需填 2 项

Select an element on the page with Select tag

必填参数:selector、value

playwright_hover 1 个参数 需填 1 项

Hover an element on the page

必填参数:selector

playwright_evaluate 1 个参数 需填 1 项

Execute JavaScript in the browser console

必填参数:script

playwright_get 1 个参数 需填 1 项

Perform an HTTP GET request

必填参数:url

playwright_post 2 个参数 需填 2 项

Perform an HTTP POST request

必填参数:url、value

playwright_put 2 个参数 需填 2 项

Perform an HTTP PUT request

必填参数:url、value

playwright_patch 2 个参数 需填 2 项

Perform an HTTP PATCH request

必填参数:url、value

playwright_delete 1 个参数 需填 1 项

Perform an HTTP DELETE request

必填参数:url

服务介绍

Playwright MCP 服务器

smithery 徽章

这是一个使用 Playwright 提供浏览器自动化功能的 Model Context Protocol 服务器。该服务器使 LLMs 能够与网页交互、截屏并在真实的浏览器环境中执行 JavaScript。

截图

文档 | API 参考

安装

您可以使用 npm、mcp-get 或 Smithery 来安装此包:

使用 npm:

npm install -g @executeautomation/playwright-mcp-server

使用 mcp-get:

npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server

使用 Smithery

通过 Smithery 自动安装适用于 Claude Desktop 的 Playwright MCP:

npx @smithery/cli install @executeautomation/playwright-mcp-server --client claude

配置以使用 Playwright 服务器

以下是使用 Playwright 服务器的 Claude Desktop 配置:

{
  "mcpServers": {
    "playwright": {
      "command": "npx",
      "args": ["-y", "@executeautomation/playwright-mcp-server"]
    }
  }
}

相关 MCP 服务