返回市场
mcp-隐身浏览器引擎

mcp-隐身浏览器引擎

作者:pvinis16 星标更新:2025-04-10

项目介绍

Playwright MCP Server 🎭

smithery 徽章

这是一个使用Playwright提供浏览器自动化功能的Model Context Protocol服务器。此服务器使LLMs能够与网页交互、截取屏幕、生成测试代码、抓取网页内容并在真实的浏览器环境中执行JavaScript。

<a href="https://glama.ai/mcp/servers/yh4lgtwgbe"><img width="380" height="200" src="https://gips2.baidu.com/it/u=1251442309,2239210043&fm=3081&app=3081&f=PNG?w=760&h=400" alt="mcp-playwright MCP服务器" /></a>

截图

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自动安装Playwright MCP for Claude Desktop:

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

在VS Code中安装

使用以下按钮之一在VS Code中安装Playwright MCP服务器:

<img alt="在VS Code Insiders中安装" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">

或者,你可以使用VS Code CLI安装Playwright MCP服务器:

# 对于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代理一起使用。

使用Playwright服务器的配置

这是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目录下。

星标历史

星标历史图表