一个基于 Playwright 的 Model Context Protocol 服务器,提供浏览器自动化功能。该服务器可让大语言模型(LLM)与网页进行交互、截取屏幕截图、生成测试代码、抓取页面信息,还能在真实浏览器环境中执行 JavaScript。
你可以通过下面的链接查看文档和 API 参考: 文档 | API 参考
你可以使用 npm、mcp-get 或 Smithery 来安装此包:
npm install -g @executeautomation/playwright-mcp-server
npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server
通过 Smithery 自动安装 Playwright MCP 用于 Claude Desktop:
npx -y @smithery/cli install @executeautomation/playwright-mcp-server --client claude
使用以下按钮之一在 VS Code 中安装 Playwright MCP 服务器:
将以下内容添加到你的 playwright.config.ts 文件中:
import { defineConfig } from '@playwright/test';
export default defineConfig({
testDir: './tests',
forbidOnly: !!process.env.CI,
requireOrder: true,
retries: process.env.CI ? 2 : 0,
workers: process.env.CI ? undefined : 1,
reporter: 'html',
use: {
trace: 'on-first-retry',
},
});
运行以下命令来执行测试:
npx playwright test
对于更多详细信息,请参考我们的 文档。
你可以通过 文档链接 查看更详细的使用说明和配置信息。
文档中未提及许可证信息。若有相关内容,可补充在本章节。