这是一个使用Playwright并支持Chrome DevTools Protocol (CDP) 的Model Context Protocol服务器。该服务器使LLMs能够与网页进行交互,抓取整个页面或特定元素的截图,并在真实的浏览器环境中执行JavaScript,同时可以通过CDP连接到现有的Chrome实例。
这是executeautomation/mcp-playwright v0.2.7的一个分支,增加了对连接到正在运行的Chrome实例的支持。
<a href="https://glama.ai/mcp/servers/fdvu5n58kv"><img width="380" height="200" src="https://gips1.baidu.com/it/u=1631933620,3354036468&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Playwright CDP MCP 服务器" /></a>
您可以使用npm或Smithery来安装此包:
要通过Smithery自动安装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连接到现有Chrome实例的能力。要使用此功能:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
本项目是executeautomation/mcp-playwright的一个分支,增加了对连接到正在运行的Chrome实例的支持。
本项目采用MIT许可证 - 查看LICENSE文件以获取详细信息。