![]() |
![]() |
MseeP.ai安全评估 | 特别感谢Warp——开发者AI终端 |
这是一个基于Playwright的模型上下文协议(MCP)服务器,提供浏览器自动化能力。该服务器使大型语言模型(LLM)能够:
您可以通过以下任一方式安装该包:
使用npm安装:
npm install -g @executeautomation/playwright-mcp-server
使用mcp-get安装:
npx @michaellatman/mcp-get@latest install @executeautomation/playwright-mcp-server
使用Smithery安装(自动为Claude Desktop安装Playwright MCP):
npx @smithery/cli install @executeautomation/playwright-mcp-server --client claude
通过以下按钮之一在VS Code中安装Playwright MCP服务器:
或者使用VS Code CLI安装:
# 对于VS Code
code --add-mcp '{"name":"playwright","command":"npx","args":["@executeautomation/playwright-mcp-server"]}'

# 对于VS Code Insiders
code-insiders --add-mcp '{"name":"playwright","command":"npx","args":["@executeautomation/playwright-mcp-server"]}'

安装完成后,ExecuteAutomation Playwright MCP服务器将可在VS Code中与您的GitHub Copilot代理一起使用。
以下是Claude Desktop使用Playwright服务器的配置示例:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@executeautomation/playwright-mcp-server"]
}
}
}

本项目使用Jest进行测试,测试代码位于src/__tests__
目录。
您可以使用以下任一命令运行测试:
# 使用自定义脚本运行测试(带覆盖率)
node run-tests.cjs
# 使用npm脚本运行测试
npm test # 不带覆盖率运行测试
npm run test:coverage # 带覆盖率运行测试
npm run test:custom # 使用自定义脚本运行测试(与node run-tests.cjs相同)

测试覆盖率报告将生成在coverage
目录中。
evals包会加载一个mcp客户端来运行index.ts文件,因此测试之间无需重新构建。您可以通过在npx命令前添加环境变量前缀来加载环境变量。完整文档请参阅这里。
OPENAI_API_KEY=your-key npx mcp-eval src/evals/evals.ts src/tools/codegen/index.ts