Skip to main content
Glama
MCP-Undetected-Chromedriver

MCP-Undetected-Chromedriver

by dragons96

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

Related MCP server: web-scraper-server

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 URL

  • browser_screenshot: Take a screenshot of the current page

  • browser_click: Click on page elements

  • browser_iframe_click: Click on elements within an iframe

  • browser_fill: Fill content in input fields

  • browser_select: Select options in dropdown selection boxes

  • browser_hover: Hover the mouse over elements

  • browser_evalute: Execute JavaScript code

  • browser_close: Close the browser

  • browser_get_visible_text: Get visible text on the page

  • browser_get_visible_html: Get visible HTML on the page

  • browser_go_back: Navigate backward in browser history

  • browser_go_forward: Navigate forward in browser history

  • browser_drag: Drag elements

  • browser_press_key: Simulate key presses

  • browser_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.

Available Tools

16 tools
browser_clickC

Click an element on the page

Args:
    selector: The selector of the element to click - required
NameRequiredDescriptionDefault
selectorYes
browser_closeA

Close the browser and release all resources

NameRequiredDescriptionDefault

No parameters

browser_dragC

Drag an element to another element

Args:
    sourceSelector: The selector for the element to drag - required
    targetSelector: The selector for the target location - required
NameRequiredDescriptionDefault
sourceSelectorYes
targetSelectorYes
browser_evaluteC

Evaluate a JavaScript expression in the browser console

Args:
    script: The JavaScript expression to evaluate - required
NameRequiredDescriptionDefault
scriptYes
browser_fillC

fill out an input field

Args:
    selector: CSS selector for input field - required
    value: The value to fill - required
NameRequiredDescriptionDefault
selectorYes
valueYes
browser_get_visible_htmlB

Get the HTML of the current page

NameRequiredDescriptionDefault

No parameters

browser_get_visible_textB

Get the visible text of the current page

NameRequiredDescriptionDefault

No parameters

browser_go_backA

Navigate back in browser history

NameRequiredDescriptionDefault

No parameters

browser_go_forwardB

Navigate forward in browser history

NameRequiredDescriptionDefault

No parameters

browser_hoverC

Hover over an element on the page

Args:
    selector: CSS selector for element to hover over - required
NameRequiredDescriptionDefault
selectorYes
browser_iframe_clickB

Click an element inside an iframe on the page

Args:
    iframeSelector: The selector of the iframe - required
    selector: The selector of the element to click - required
NameRequiredDescriptionDefault
iframeSelectorYes
selectorYes
browser_navigateC

Navigate to a URL

Args:
    url: The URL to navigate to - required
    timeout: The timeout for the navigation - optional, default is 30000
NameRequiredDescriptionDefault
timeoutNo
urlYes
browser_press_keyB

Press a key on the keyboard

Args:
    key: The key to press - required, (e.g. 'Enter', 'ArrowDown', 'a')
    selector: Optional CSS selector to focus on before pressing the key - optional
NameRequiredDescriptionDefault
keyYes
selectorNo
browser_save_as_pdfB

Save the current page as a PDF

Args:
    outputPath: The path to save the PDF to - required
    filename: The name of the PDF file - optional, default is "page.pdf"
    format: The format of the PDF - optional, default is "A4" (e.g. "A4", "LETTER", "LEGAL", "TABLOID")
    printBackground: Whether to print the background - optional, default is True
    margin: The margin of the PDF - optional, default is None (e.g. {"top": "1cm", "right": "1cm", "bottom": "1cm", "left": "1cm"})
NameRequiredDescriptionDefault
filenameNopage.pdf
formatNoA4
marginNo
outputPathYes
printBackgroundNo
browser_screenshotC

Take a screenshot of the current page or a specific element

Args:
    name: The name of the screenshot - required, default is "screenshot"
    storeBase64: Whether to store the screenshot as a base64 string - optional, default is True
    downloadsDir: The directory to save the screenshot to - optional, default is the user's Downloads directory
NameRequiredDescriptionDefault
downloadsDirNo
nameYes
storeBase64No
browser_selectC

Select an element on the page with Select tag

Args:
    selector: CSS selector for element to select - required
    value: The value to select - required
NameRequiredDescriptionDefault
selectorYes
valueYes

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 16 tool updatesv1.0.0
    • First observedbrowser_click
    • First observedbrowser_close
    • First observedbrowser_drag
    • First observedbrowser_evalute
    • First observedbrowser_fill
    • First observedbrowser_get_visible_html
    • First observedbrowser_get_visible_text
    • First observedbrowser_go_back
    • First observedbrowser_go_forward
    • First observedbrowser_hover
    • First observedbrowser_iframe_click
    • First observedbrowser_navigate
    • First observedbrowser_press_key
    • First observedbrowser_save_as_pdf
    • First observedbrowser_screenshot
    • First observedbrowser_select

TDQS

A3.5/5.0

Scored across 16 tools

Disambiguation4/5

Most tools have distinct purposes targeting specific browser automation tasks like navigation, interaction, and content extraction. However, some overlap exists between browser_click and browser_iframe_click, where the latter is essentially a specialized version of the former for iframes, which could cause minor confusion.

Naming Consistency5/5

All tools follow a consistent snake_case naming pattern with a clear 'browser_' prefix followed by a verb_noun structure (e.g., browser_click, browser_navigate, browser_screenshot). This uniformity makes the tool set predictable and easy to understand.

Tool Count4/5

With 16 tools, the count is slightly high but reasonable for a browser automation server, covering a wide range of common web interaction tasks. It might feel a bit heavy, but each tool appears to serve a specific function without obvious redundancy.

Completeness4/5

The tool set provides comprehensive coverage for core browser automation, including navigation, clicking, typing, hovering, and content extraction. Minor gaps exist, such as no explicit tool for handling cookies, managing tabs, or waiting for elements, but agents can likely work around these using existing tools like browser_evalute or timeouts.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    An MCP server for stealth browser automation that uses human-like interaction patterns to bypass bot detection via the Chrome DevTools Protocol. It enables users to navigate, interact with elements, and capture data from websites using undetectable behaviors like Bezier mouse movements and Gaussian typing delays.
    112 npm
    1
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Provides browser automation and web scraping as MCP tools, enabling autonomous URL ingestion, crawling, extraction, and anti-bot handling with interactive browser control.
    62
    6
    MIT
  • A
    license
    C
    quality
    B
    maintenance
    MCP server for agent-piloted browser automation that clears Cloudflare, providing multi-session parallel Chromes, persistent profiles, stealth features, credential vault, and vision-first clicking.
    89
    79 PyPI
    9
    Apache 2.0