
lars-hagen/mcp-playwright-cdp 是从 https://github.com/lars-hagen/mcp-playwright-cdp. 导入的 MCP 服务器候选。
概览
lars-hagen/mcp-playwright-cdp 是从 https://github.com/lars-hagen/mcp-playwright-cdp. 导入的 MCP 服务器候选。
概述(AI 翻译)
一个模型上下文协议服务器,利用Playwright提供浏览器自动化功能,支持Chrome DevTools Protocol(CDP)。该服务器使LLM能够与网页交互、截图并在真实浏览器环境中执行JavaScript,并能通过CDP连接现有的Chrome实例。
维护状态
该项目处于维护阶段。欢迎针对安全性、兼容性和文档的重点修复。目前尚未发布到 npm 注册表。最新的源代码发布是 2025 年 2 月的 v0.2.10 Git 标签。
这是 executeautomation/mcp-playwright v0.2.7 的一个分支,增强了对 CDP 支持,用于连接运行中的 Chrome 实例。
主要特色
- 🔗 通过CDP连接现有的Chrome实例
- 🌐 完整的浏览器自动化功能
- 📸 截图捕捉整页或特定元素
- 🖱️ 全面的网页交互(导航、点击、表单填写)
- 📊 控制台日志监控
- 🔧 浏览器环境中的JavaScript执行
- 🌍 HTTP API 测试支持
安装
你可以用npm或Smithery安装该软件包:
通过Smithery安装
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
MCP Playwright CDP
A Model Context Protocol server that provides browser automation capabilities using Playwright with Chrome DevTools Protocol (CDP) support. This server enables LLMs to interact with web pages, take screenshots, and execute JavaScript in a real browser environment, with the ability to connect to existing Chrome instances via CDP.
Maintenance status
This project is in maintenance mode. Focused fixes for security, compatibility, and documentation are welcome. It is not currently published to the npm registry. The latest source release is the v0.2.10 Git tag from February 2025.
This is a fork of executeautomation/mcp-playwright v0.2.7, enhanced with CDP support for connecting to running Chrome instances.
Key Features
- 🔗 Connect to existing Chrome instances via CDP
- 🌐 Full browser automation capabilities
- 📸 Screenshot capture of entire pages or specific elements
- 🖱️ Comprehensive web interactions (navigation, clicking, form filling)
- 📊 Console log monitoring
- 🔧 JavaScript execution in browser context
- 🌍 HTTP API testing support
Installation
You can install the package using either npm or Smithery:
Installing via Smithery
To install MCP Playwright CDP for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @lars-hagen/mcp-playwright-cdp --client claude
Manual Installation
Clone the repository, then build it with Node.js 20 or 22:
npm ci
npm run build
Use npm install only when updating dependencies.
Configuration
Add this to your Claude Desktop configuration file:
{
"mcpServers": {
"playwright": {
"command": "node",
"args": ["/path/to/mcp-playwright/dist/index.js"]
}
}
}
Replace /path/to/mcp-playwright with your actual path to the repository.
CDP Connection
This fork adds the ability to connect to an existing Chrome instance via CDP. To use this feature:
- Launch Chrome with remote debugging enabled:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
- The server will automatically attempt to connect to the running Chrome instance first, before launching a new browser.
Security
安装
npx -y @smithery/cli install @lars-hagen/mcp-playwright-cdp --client claude配置
{
"mcpServers": {
"playwright": {
"command": "node",
"args": ["/path/to/mcp-playwright/dist/index.js"]
}
}
}