MCP-未检测到-Chrome驱动程序
基于未检测到的 chromedriver 构建的 MCP 服务,提供全面的界面,用于自动化 Chrome 浏览器控制,同时绕过反机器人检测。
安装
要通过Smithery自动为 Claude Desktop 安装 MCP-Undetected-Chromedriver:
配置使用未检测到的 Chromedriver 服务器
以下是使用 Undetected-chromedriver 服务器的 Claude Desktop 配置:
要求
- Python >= 3.11
- Chrome 浏览器
紫外线安装
项目介绍
MCP-Undetected-Chromedriver 是一个 MCP(多通道协议)服务,它将 undetected-chromedriver 库的功能封装成一系列易于使用的 API。该项目特别适用于需要在自动化测试、数据抓取或 Web 自动化脚本中绕过现代网站反机器人检测机制的场景。
主要特点
- 基于undetected-chromedriver,有效绕过网站反机器人检测
- 提供丰富的浏览器操作API接口
- 支持截图、PDF导出等功能
- 支持点击、填表、拖拽等复杂的页面交互操作。
- 与 MCP 生态系统中的其他工具无缝集成
待办事项列表
- [ ] 优化浏览器驱动管理,处理驱动中断
- [ ] 扩展API功能
- [ ] 添加更全面的错误处理和日志记录
- [ ] 改进文档,增加更多使用示例
- [ ] 添加对浏览器配置文件和扩展的支持
用法
启动服务
可用的 API
该服务提供以下主要API接口:
browser_navigate
:导航到指定的 URLbrowser_screenshot
:截取当前页面的屏幕截图browser_click
:点击页面元素browser_iframe_click
:点击 iframe 内的元素browser_fill
:在输入字段中填充内容browser_select
:在下拉选择框中选择选项browser_hover
:将鼠标悬停在元素上browser_evalute
:执行 JavaScript 代码browser_close
:关闭浏览器browser_get_visible_text
:获取页面上可见的文本browser_get_visible_html
:获取页面上可见的 HTMLbrowser_go_back
:在浏览器历史记录中向后导航browser_go_forward
:在浏览器历史记录中向前导航browser_drag
:拖动元素browser_press_key
:模拟按键browser_save_as_pdf
:将页面保存为 PDF
代码示例
工作原理
此服务使用 undetected-chromedriver 库创建专用的 Chrome 浏览器实例,可有效规避常见的反机器人检测机制。该服务通过 MCP 协议封装了这些功能,提供了易于使用的 API 接口,使自动化测试和网页抓取更加便捷。
执照
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
贡献指南
欢迎在 GitHub Issues 页面上提交 Bug 报告和功能请求。如果您想贡献代码,请先创建 Issue 来讨论您的想法。
常问问题
问:为什么选择 undetected-chromedriver 而不是标准的 selenium webdriver?
答:undetected-chromedriver 专门设计用于绕过现代网站的反机器人检测机制,例如 Cloudflare、Distil Networks 等,使其对于数据抓取和自动化测试场景更加可靠。
问:该服务如何处理浏览器实例?
答:该服务维护一个全局浏览器实例,该实例会在首次调用需要浏览器的 API 时自动创建。您可以使用browser_close
API 显式关闭浏览器。
问:如何处理 iframe 内的元素?
A: browser_iframe_click
API可以直接操作iframe内的元素,不需要手动切换框架上下文。
You must be authenticated.
local-only server
The server can only run on the client's local machine because it depends on local resources.
一项 MCP 服务,可自动控制 Chrome 浏览器,同时绕过反机器人检测机制,从而能够在具有复杂机器人保护的网站上进行网页抓取、测试和自动化。
Related Resources
Related MCP Servers
- -securityAlicense-qualityProvides Google search capabilities, web content extraction, and screenshot functionality with advanced bot detection avoidance through the MCP protocol.Last updated -394TypeScriptMIT License
- AsecurityAlicenseAqualityAn MCP server that provides tools for interacting with Chrome through its DevTools Protocol, enabling remote control of Chrome tabs to execute JavaScript, capture screenshots, monitor network traffic, and more.Last updated -73014TypeScriptMIT License
- AsecurityAlicenseAqualityProvides stealth browser capabilities using Playwright with anti-detection techniques, allowing MCP clients to navigate websites and take screenshots while evading common bot detection systems.Last updated -14TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that helps AI assistants access text content from websites that implement bot detection, bridging the gap between what you can see in your browser and what the AI can access.Last updated -1PythonApache 2.0