MCP Playwright CDP
该工具使大型语言模型(LLM)能够通过 Playwright 框架执行浏览器自动化,并支持 Chrome DevTools 协议。它能够连接到现有的 Chrome 实例,从而实现高级的网页交互和 JavaScript 执行。
Tools
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_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
README
MCP Playwright CDP
一个模型上下文协议服务器,它使用带有 Chrome DevTools 协议 (CDP) 支持的 Playwright 提供浏览器自动化功能。 该服务器使 LLM 能够与网页交互、截取屏幕截图以及在真实的浏览器环境中执行 JavaScript,并且能够通过 CDP 连接到现有的 Chrome 实例。
这是 executeautomation/mcp-playwright v0.2.7 的一个分支,增强了 CDP 支持,可以连接到正在运行的 Chrome 实例。
<a href="https://glama.ai/mcp/servers/fdvu5n58kv"><img width="380" height="200" src="https://glama.ai/mcp/servers/fdvu5n58kv/badge" alt="Playwright CDP MCP server" /></a>
主要特性
- 🔗 通过 CDP 连接到现有的 Chrome 实例
- 🌐 完整的浏览器自动化功能
- 📸 捕获整个页面或特定元素的屏幕截图
- 🖱️ 全面的 Web 交互(导航、点击、表单填写)
- 📊 控制台日志监控
- 🔧 在浏览器上下文中执行 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 实例的功能。 要使用此功能:
- 启动 Chrome 并启用远程调试:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
- 服务器将自动尝试首先连接到正在运行的 Chrome 实例,然后再启动新的浏览器。
鸣谢
该项目是 executeautomation/mcp-playwright 的一个分支,增强了 CDP 支持,可以连接到正在运行的 Chrome 实例。
许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
推荐服务器
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Excel MCP Server
一个模型上下文协议服务器,使 AI 助手能够读取和写入 Microsoft Excel 文件,支持诸如 xlsx、xlsm、xltx 和 xltm 等格式。
Playwright MCP Server
提供一个利用模型上下文协议的服务器,以实现类人浏览器的自动化,该服务器使用 Playwright,允许控制浏览器行为,例如导航、元素交互和滚动。
@kazuph/mcp-fetch
用于获取网页内容和处理图像的模型上下文协议服务器。这使得 Claude Desktop(或任何 MCP 客户端)能够适当地获取网页内容和处理图像。
Claude Code MCP
一个实现了 Claude Code 作为模型上下文协议(Model Context Protocol, MCP)服务器的方案,它可以通过标准化的 MCP 接口来使用 Claude 的软件工程能力(代码生成、编辑、审查和文件操作)。
Apple MCP Server
通过 MCP 协议与 Apple 应用(如“信息”、“备忘录”和“通讯录”)进行交互,从而使用自然语言发送消息、搜索和打开应用内容。
DuckDuckGo MCP Server
一个模型上下文协议 (MCP) 服务器,通过 DuckDuckGo 提供网页搜索功能,并具有内容获取和解析的附加功能。
contentful-mcp
在你的 Contentful Space 中更新、创建、删除内容、内容模型和资源。