MCP-Undetected-Chromedriver
An MCP service that automates Chrome browser control while bypassing anti-bot detection mechanisms, enabling web scraping, testing and automation on sites with sophisticated bot protection.
README
MCP-Undetected-Chromedriver
An MCP service built on undetected-chromedriver, providing a comprehensive interface for automating Chrome browser control while bypassing anti-bot detection.
Installation
To install MCP-Undetected-Chromedriver for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @dragons96/mcp-undetected-chromedriver --client claude
Configuration to use Undetected Chromedriver Server
Here's the Claude Desktop configuration to use the Undetected-chromedriver server:
{
"mcpServers": {
"mcp-undetected-chromedriver": {
"command": "npx",
"args": [
"-y",
"@smithery/cli@latest",
"run",
"@dragons96/mcp-undetected-chromedriver",
"--config",
"{}"
]
}
}
}
Requirements
- Python >= 3.11
- Chrome browser
Installation with uv
# Create virtual environment
uv venv
# Activate virtual environment
# Windows
.venv\Scripts\activate
# Linux/MacOS
source .venv/bin/activate
# Install dependencies
uv pip install -e .
Project Introduction
MCP-Undetected-Chromedriver is an MCP (Multi Channel Protocol) service that wraps the functionality of the undetected-chromedriver library into a series of easy-to-use APIs. This project is particularly suitable for scenarios that require bypassing modern website anti-bot detection mechanisms in automated testing, data scraping, or web automation scripts.
Key Features
- Based on undetected-chromedriver, effectively bypassing website anti-bot detection
- Provides rich browser operation API interfaces
- Supports screenshots, PDF export, and other functionalities
- Supports complex page interaction operations such as clicking, form filling, dragging, etc.
- Seamlessly integrates with other tools in the MCP ecosystem
Todo List
- [ ] Optimize browser driver management and handle driver interruptions
- [ ] Extend API capabilities
- [ ] Add more comprehensive error handling and logging
- [ ] Improve documentation with more usage examples
- [ ] Add support for browser profiles and extensions
Usage
Starting the Service
mcp-server-undetected-chromedriver
Available APIs
The service provides the following main API interfaces:
browser_navigate: Navigate to a specified URLbrowser_screenshot: Take a screenshot of the current pagebrowser_click: Click on page elementsbrowser_iframe_click: Click on elements within an iframebrowser_fill: Fill content in input fieldsbrowser_select: Select options in dropdown selection boxesbrowser_hover: Hover the mouse over elementsbrowser_evalute: Execute JavaScript codebrowser_close: Close the browserbrowser_get_visible_text: Get visible text on the pagebrowser_get_visible_html: Get visible HTML on the pagebrowser_go_back: Navigate backward in browser historybrowser_go_forward: Navigate forward in browser historybrowser_drag: Drag elementsbrowser_press_key: Simulate key pressesbrowser_save_as_pdf: Save the page as a PDF
Code Example
from mcp.client import Client
# Create MCP client
client = Client()
client.start("undetected-chromedriver-mcp-server")
# Navigate to website
response = client.call("browser_navigate", {"url": "https://example.com"})
print(response)
# Take a screenshot
response = client.call("browser_screenshot", {"name": "example"})
print(response)
# Get page text
response = client.call("browser_get_visible_text")
print(response.content[0].text)
# Close the browser
client.call("browser_close")
How It Works
This service uses the undetected-chromedriver library to create a specialized Chrome browser instance that effectively evades common anti-bot detection mechanisms. The service wraps these features through the MCP protocol, providing an easy-to-use API interface that makes automated testing and web scraping more convenient.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contribution Guidelines
Bug reports and feature requests are welcome on the GitHub Issues page. If you want to contribute code, please create an issue to discuss your ideas first.
FAQ
Q: Why choose undetected-chromedriver instead of the standard selenium webdriver?
A: undetected-chromedriver is specifically designed to bypass anti-bot detection mechanisms of modern websites, such as Cloudflare, Distil Networks, etc., making it more reliable for data scraping and automated testing scenarios.
Q: How does the service handle browser instances?
A: The service maintains a global browser instance, which is automatically created when an API requiring a browser is first called. The browser can be explicitly closed using the browser_close API.
Q: How to handle elements within iframes?
A: The browser_iframe_click API can directly operate on elements within iframes, without the need to manually switch frame contexts.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。