MCP Playwright CDP
MCP 剧作家 CDP
一个模型上下文协议 (MLM) 服务器,使用支持 Chrome DevTools 协议 (CDP) 的 Playwright 提供浏览器自动化功能。该服务器使 LLM 能够在真实的浏览器环境中与网页交互、截取屏幕截图和执行 JavaScript,并能够通过 CDP 连接到现有的 Chrome 实例。
这是executeautomation/mcp-playwright v0.2.7的一个分支,增强了CDP支持,可以连接到正在运行的Chrome实例。
主要特点
🔗 通过 CDP 连接到现有的 Chrome 实例
🌐 完整的浏览器自动化功能
📸 整个页面或特定元素的屏幕截图
🖱️ 全面的网络交互(导航、点击、表单填写)
📊 控制台日志监控
🔧 在浏览器上下文中执行 JavaScript
🌍 HTTP API 测试支持
Related MCP server: Browser Manager MCP Server
安装
您可以使用 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 连接
此 fork 版本新增了通过 CDP 连接到现有 Chrome 实例的功能。使用方法如下:
启动启用远程调试的 Chrome:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222在启动新的浏览器之前,服务器将首先自动尝试连接到正在运行的 Chrome 实例。
致谢
该项目是executeautomation/mcp-playwright的一个分支,增强了 CDP 支持以连接正在运行的 Chrome 实例。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
Available Tools
12 toolsplaywright_clickC
Click an element on the page
Inputs: selector (required).
playwright_deleteC
Perform an HTTP DELETE request
Inputs: url (required).
playwright_evaluateC
Execute JavaScript in the browser console
Inputs: script (required).
playwright_fillC
fill out an input field
Inputs: selector (required), value (required).
playwright_getC
Perform an HTTP GET request
Inputs: url (required).
playwright_hoverC
Hover an element on the page
Inputs: selector (required).
playwright_patchC
Perform an HTTP PATCH request
Inputs: url (required), value (required).
playwright_postC
Perform an HTTP POST request
Inputs: url (required), value (required).
playwright_putC
Perform an HTTP PUT request
Inputs: url (required), value (required).
playwright_screenshotC
Take a screenshot of the current page or a specific element
Inputs: name (required), selector, width, height, +3 more.
playwright_selectC
Select an element on the page with Select tag
Inputs: selector (required), value (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 12 tools
Most tools have distinct purposes, but there is some overlap between playwright_click and playwright_select as both interact with page elements, which could cause minor confusion. The HTTP methods (GET, POST, PUT, PATCH, DELETE) are clearly differentiated, and other tools like playwright_navigate, playwright_screenshot, and playwright_evaluate have unique functions.
All tool names follow a consistent 'playwright_' prefix with a verb or action (e.g., click, get, navigate), using snake_case uniformly. This predictable pattern makes it easy for agents to understand and navigate the tool set without naming conflicts or style variations.
With 12 tools, the count is well-scoped for a Playwright CDP server, covering essential web automation tasks like navigation, interaction, HTTP requests, and debugging. Each tool serves a specific purpose, avoiding bloat while providing comprehensive functionality for the domain.
The tool set covers key areas: navigation, element interaction, HTTP methods, and debugging (screenshot, evaluate). Minor gaps exist, such as missing tools for handling cookies, waiting for elements, or managing browser contexts, but core workflows are well-supported, allowing agents to perform most common automation tasks.
Maintenance
Related MCP Connectors
Playwright browser automation — navigate, click, fill forms, extract, screenshot — 17 agent tools.
Control a real browser from AI agents: navigate, click, type, screenshot, read the page.
Give AI agents a real cloud Chrome: open sessions, navigate, read pages, click, type and screenshot.
Provides cloud browser automation capabilities using Stagehand and Browserbase, enabling LLMs to i…
Related MCP Servers
AlicenseNot gradedqualityDmaintenanceEnables comprehensive browser automation and web interaction through Playwright with 50+ specialized functions for navigation, form filling, data extraction, and Chrome DevTools Protocol support. Designed specifically for AI agents to perform complex web workflows including scraping, testing, and automated browsing tasks.14 npm1Apache 2.0- AlicenseNot gradedqualityDmaintenanceEnables comprehensive browser automation and control through Playwright, including launching browsers, managing tabs, web navigation, element interaction, and screenshot capture. Supports detecting and controlling external browsers with remote debugging capabilities.ISC
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to perform browser automation tasks including web scraping, taking screenshots, and executing JavaScript using Playwright. It facilitates real-time interaction with web pages and the generation of automated test code.27 npmMIT
- -licenseNot gradedqualityNot gradedmaintenanceEnables AI coding assistants to control and inspect a live Chrome browser for automated debugging, performance analysis, and web interaction. It leverages Puppeteer and Chrome DevTools to provide capabilities like network monitoring, console logging, and automated browser actions.-