Patchright Lite MCP 服务器
精简的模型上下文协议 (MCP) 服务器,封装了 Patchright Node.js SDK,为 AI 模型提供隐秘的浏览器自动化功能。这款轻量级服务器专注于核心功能,方便更简单的 AI 模型使用。
Patchright 是什么?
Patchright 是 Playwright 测试和自动化框架的隐蔽版本。它旨在作为 Playwright 的直接替代品,但具备先进的隐蔽功能,可以规避反机器人系统的检测。Patchright 可以修补各种检测技术,包括:
- Runtime.enable 泄漏
- Console.enable 泄漏
- 命令标志泄漏
- 通用检测点
- 封闭的影子根交互
该 MCP 服务器包装了 Patchright 的 Node.js 版本,以便通过简单、标准化的协议将其功能提供给 AI 模型。
特征
- 简洁的界面:仅使用 4 个基本工具专注于核心功能
- 隐身自动化:使用 Patchright 的隐身模式来避免被发现
- MCP 标准:实现模型上下文协议,轻松实现 AI 集成
- Stdio Transport :使用标准输入/输出实现无缝集成
先决条件
- Node.js 18+
- npm 或 yarn
安装
- 克隆此存储库:
- 安装依赖项:
- 构建 TypeScript 代码:
用法
使用以下命令运行服务器:
这将使用 stdio 传输启动服务器,使其准备好与支持 MCP 的 AI 工具集成。
与人工智能模型集成
克劳德桌面
将其添加到您的claude-desktop-config.json
文件中:
VS Code 与 GitHub Copilot
使用 VS Code CLI 添加 MCP 服务器:
可用工具
该服务器仅提供 4 个基本工具:
1. 浏览
启动浏览器,导航到 URL,并提取内容。
返回:
- 页面标题
- 可见文本预览
- 浏览器ID(用于后续操作)
- 页面ID(用于后续操作)
- 截图路径
2. 互动
在页面上执行简单的交互。
返回:
- 操作结果
- 当前网址
- 截图路径
3. 提取
从当前页面提取特定内容。
返回:
- 根据请求类型提取内容
4. 关闭
关闭浏览器以释放资源。
使用流程示例
- 启动浏览器并导航到站点:
- 填写登录表格:
- 填写密码:
- 点击登录按钮:
- 提取文本以验证登录:
- 关闭浏览器:
安全注意事项
- 此服务器提供强大的自动化功能。请以负责任且合乎道德的方式使用它。
- 避免自动执行违反网站服务条款的操作。
- 注意速率限制,不要使网站请求过载。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
致谢
- Kaliiiiiiiiii-Vinyzu 的 Patchright-nodejs
- 模型上下文协议(modelcontextprotocol)
Docker 使用
您可以使用 Docker 运行此服务器:
在本地构建 Docker 镜像
构建 Docker 镜像:
运行容器:
Docker 中心
当更改合并到主分支时,镜像会自动发布到 Docker Hub。您可以在以下位置找到最新镜像: dylangroos/patchright-mcp
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
简化的模型上下文协议服务器,使 AI 模型能够使用 Patchright 执行隐形浏览器自动化,避免被反机器人系统检测,同时提供必要的 Web 交互功能。
Related MCP Servers
- -securityAlicense-qualityA Model Context Protocol server that provides enhanced browser automation capabilities using Puppeteer-Extra with Stealth Plugin, enabling LLMs to interact with web pages in a way that better emulates human behavior and avoids detection as automation.Last updated -2TypeScriptMIT License
- AsecurityFlicenseAqualityA Model Context Protocol server that enables AI assistants to interact with web browsers through Playwright, providing automation capabilities for navigation, interaction, and screenshots.Last updated -143JavaScript
- -securityFlicense-qualityA Model Context Protocol server that enables AI assistants to control a real web browser with stealth capabilities, avoiding bot detection while performing tasks like clicking, filling forms, taking screenshots, and extracting data.Last updated -857TypeScript
- AsecurityFlicenseAqualityA Model Context Protocol server that provides browser automation capabilities using Playwright, enabling AI assistants to interact with web pages through a standardized interface.Last updated -143JavaScript