P

Playwright浏览器自动化工具

一个使用 Playwright 提供浏览器自动化功能的模型上下文协议服务器。此服务器使大型语言模型(LLMs)能够与网页交互、截屏以及在真实的浏览器环境中执行 JavaScript。

browser-automation

2.1w 查看 · 2026-07-07 更新

简介

一个使用 Playwright 提供浏览器自动化功能的模型上下文协议服务器。此服务器使大型语言模型(LLMs)能够与网页交互、截屏以及在真实的浏览器环境中执行 JavaScript。

简介

一个使用 Playwright 提供浏览器自动化功能的模型上下文协议服务器。此服务器使大型语言模型(LLMs)能够与网页交互、截屏以及在真实的浏览器环境中执行 JavaScript。

Playwright MCP 服务器 🎭

smithery 徽章

这是一个使用 Playwright 提供浏览器自动化功能的模型上下文协议服务器。该服务器使大语言模型能够与网页交互、截屏、生成测试代码、网页抓取以及在真实的浏览器环境中执行 JavaScript。

mcp-playwright MCP 服务器

截图

Playwright + Claude

文档 | 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 -y @smithery/cli install @executeautomation/playwright-mcp-server --client claude

配置以使用 Playwright 服务器

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

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

测试

该项目使用 Jest 进行测试。测试文件位于 src/__tests__ 目录中。

运行测试

您可以使用以下命令之一来运行测试:

# Run tests using the custom script (with coverage) node run-tests.cjs # Run tests using npm scripts npm test # Run tests without coverage npm run test:coverage # Run tests with coverage npm run test:custom # Run tests with custom script (same as node run-tests.cjs)

测试覆盖率报告将生成在 coverage 目录中。

Star 历史

Star 历史图表

工具列表

  • playwright_navigate: Navigate to a URL

  • playwright_screenshot: Take a screenshot of the current page or a specific element

  • playwright_click: Click an element on the page

  • playwright_iframe_click: Click an element in an iframe on the page

  • playwright_fill: fill out an input field

  • playwright_select: Select an element on the page with Select tag

  • playwright_hover: Hover an element on the page

  • playwright_evaluate: Execute JavaScript in the browser console

  • playwright_get: Perform an HTTP GET request

  • playwright_post: Perform an HTTP POST request

  • playwright_put: Perform an HTTP PUT request

  • playwright_patch: Perform an HTTP PATCH request

  • playwright_delete: Perform an HTTP DELETE request

服务配置

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

来源