Playwright CDP

Playwright CDP

🚀 MCP Playwright CDP

MCP Playwright CDP是一个提供浏览器自动化功能的模型上下文协议(MCP)服务器,它借助Playwright并支持Chrome DevTools Protocol (CDP)。该服务器能让LLM在真实浏览器环境中与网页交互、截取屏幕截图,还能在浏览器上下文中执行JavaScript,同时支持通过CDP连接到运行中的Chrome实例。

smithery badge License: MIT

🚀 快速开始

此项目是executeautomation/mcp-playwright v0.2.7的分支版本,增强了通过CDP连接到运行中的Chrome实例的功能。

✨ 主要特性

  • 🔗 通过CDP连接到现有Chrome实例
  • 🌐 完整的浏览器自动化能力
  • 📸 截取整个页面或特定元素的屏幕截图
  • 🖱️ 全面的网页交互(导航、点击、表单填写)
  • 📊 控制台日志监控
  • 🔧 浏览器上下文中执行JavaScript
  • 🌍 支持HTTP API测试

📦 安装指南

使用npm或Smithery均可安装:

使用Smithery自动安装

通过Smithery为Claude Desktop自动安装MCP Playwright CDP:

npx -y @smithery/cli install @lars-hagen/mcp-playwright-cdp --client claude

手动安装

使用npm:

npm install

📚 详细文档

配置

将以下内容添加到Claude Desktop配置文件中:

{
"mcpServers": {
"playwright": {
"command": "node",
"args": ["/path/to/mcp-playwright/dist/index.js"]
}
}
}

请将/path/to/mcp-playwright替换为您实际的仓库路径。

CDP连接

此分支增加了通过CDP连接到运行中的Chrome实例的功能。使用方法如下:

  1. 启动Chrome并启用远程调试:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
  1. 服务器将自动尝试首先连接到正在运行的Chrome实例,然后再启动新的浏览器。

致谢

该项目基于executeautomation/mcp-playwright fork,并增强了通过CDP连接到运行中的Chrome实例的功能。

📄 许可证

本项目采用MIT许可证 - 查看LICENSE文件获取详细信息。

  • 0 关注
  • 0 收藏,26 浏览
  • system 提出于 2025-10-04 23:21

相似服务问题

相关AI产品