Skip to main content
Glama

CloakBrowser MCP

Stealth browser automation for AI agents — a Model Context Protocol server combining CloakBrowser's anti-detection with Playwright MCP-inspired architecture.

CloakBrowser is a source-level patched Chromium that passes Cloudflare Turnstile, reCAPTCHA v3 (0.9 score), FingerprintJS, BrowserScan, and 30+ bot detection services.

Why CloakBrowser MCP?

Feature

Playwright MCP

CloakBrowser MCP

Anti-detection

❌ None

✅ Source-patched Chromium

Cloudflare bypass

❌

✅

reCAPTCHA v3

❌

✅ 0.9 score

Snapshot-first

✅

✅

Markdown extraction

❌

✅ Readability-style

Annotated screenshots

❌

✅ browser-use style

Smart page settling

Basic

✅ MutationObserver + networkidle

Auto-retry clicks

❌

✅

Humanized input

❌

✅ Mouse curves, keyboard timing

Capability gating

✅ --caps

✅ --caps

Related MCP server: agent-browser-mcp

Quick Start

Install

pip install cloakbrowsermcp

Use with Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "cloakbrowser": {
      "command": "cloakbrowsermcp"
    }
  }
}

Use with VS Code / Cursor

Add to .vscode/mcp.json:

{
  "servers": {
    "cloakbrowser": {
      "command": "cloakbrowsermcp",
      "args": ["--caps", "all"]
    }
  }
}

Use with Hermes Agent

Add to ~/.hermes/config.yaml:

mcp_servers:
  cloakbrowser:
    command: cloakbrowsermcp
    args: ["--caps", "all"]
    timeout: 120

How It Works

Snapshot-First Architecture

CloakBrowser MCP uses accessibility tree snapshots as the primary way for AI models to understand web pages — not screenshots, not raw HTML.

1. cloak_launch()           → Start stealth browser
2. cloak_navigate(pid, url) → Go to page (auto-waits for settle)
3. cloak_snapshot(pid)      → Get interactive elements with [@eN] refs
4. cloak_click(pid, '@e5')  → Click element by ref
5. cloak_type(pid, '@e3', 'hello')  → Type into input
6. cloak_read_page(pid)     → Get content as clean markdown
7. cloak_close()            → Done

Each interactive element gets a [@eN] ref ID. All interaction tools use these refs — no CSS selectors needed.

Three Ways to See a Page

  1. cloak_snapshot() — Accessibility tree with [@eN] refs. Fast, cheap, reliable. Use this.

  2. cloak_read_page() — Clean markdown extraction. For reading content, not interacting.

  3. cloak_screenshot() — Annotated screenshot with element indices. For visual context (images, charts, CAPTCHAs).

Stealth by Default

All anti-detection features are ON by default:

  • Source-patched Chromium binary (not Playwright patches — actual Chromium source modifications)

  • Human-like mouse curves, keyboard timing, and scroll patterns (humanize=True)

  • Stealth fingerprint arguments (consistent canvas, WebGL, audio fingerprints)

  • Proxy support with GeoIP-based timezone/locale detection

Tools

Core Tools (20 — always available)

Tool

Description

cloak_launch

Start stealth browser (all anti-detection ON)

cloak_close

Close browser and release resources

cloak_snapshot

PRIMARY — accessibility tree with [@eN] refs

cloak_click

Click element by ref (auto-retry)

cloak_type

Type into input by ref (with submit option)

cloak_select

Select dropdown option by ref

cloak_hover

Hover over element by ref

cloak_check

Check/uncheck checkbox by ref

cloak_read_page

Page content as clean markdown

cloak_screenshot

Annotated screenshot with element indices

cloak_navigate

Go to URL (auto-waits for settle)

cloak_back

Navigate back in history

cloak_forward

Navigate forward in history

cloak_press_key

Press keyboard key

cloak_scroll

Scroll page up/down

cloak_wait

Wait for page to settle

cloak_evaluate

Execute JavaScript in page

cloak_new_page

Open new page/tab

cloak_list_pages

List all open pages

cloak_close_page

Close a specific page

Capability-Gated Tools (enabled via --caps)

Enable with cloakbrowsermcp --caps network,cookies,pdf,console or --caps all.

Tool

Capability

Description

cloak_network_intercept

network

Block/mock/passthrough requests

cloak_network_continue

network

Remove interception rule

cloak_get_cookies

cookies

Get all cookies

cloak_set_cookies

cookies

Set cookies

cloak_pdf

pdf

Save page as PDF

cloak_console

console

Get browser console output

Configuration

CLI Options

cloakbrowsermcp [--caps CAPS] [--transport {stdio,sse}] [--port PORT]
  • --caps: Comma-separated capabilities: network, cookies, pdf, console, all

  • --transport: MCP transport — stdio (default) or sse

  • --port: Port for SSE transport (default: 8931)

Environment Variables

Variable

Default

Description

CLOAKBROWSER_LOG_LEVEL

INFO

Log level

CLOAKBROWSER_LOG_FILE

~/.cloakbrowser/logs/server.log

Log file path

CLOAKBROWSER_LOG_STDERR

false

Also log to stderr

Launch Options

cloak_launch(
    headless=True,        # False for headed mode (some sites require it)
    proxy="http://...",   # Residential proxy recommended
    humanize=True,        # Human-like input (ON by default)
    stealth_args=True,    # Stealth fingerprints (ON by default)
    timezone="America/New_York",
    locale="en-US",
    geoip=False,          # Auto-detect from proxy IP
    fingerprint_seed="my-identity",  # Consistent fingerprint across sessions
    user_data_dir="/path",  # Persistent profile
)

Backend note: SessionConfig.backend is deprecated. CloakBrowser 0.4.0 removed the patchright backend (it broke proxy auth and add_init_script without improving stealth), so current versions ignore the setting and log a one-time warning. If you still need it, pip install "cloakbrowsermcp[patchright]" pins cloakbrowser<0.4, where the old backend still works, but it carries those upstream bugs.

Architecture

cloakbrowsermcp/
├── server.py      # FastMCP server, tool registration, error handling
├── session.py     # Browser lifecycle, page management, ref storage
├── snapshot.py    # Accessibility tree JS, ref resolution
├── markdown.py    # Readability-style HTML-to-markdown extraction
├── vision.py      # Annotated screenshots with element indices
├── waiting.py     # Smart wait, page settle, retry logic
├── stealth.py     # Stealth config inspection
├── network.py     # Network intercept, cookies (capability-gated)
├── __init__.py
└── __main__.py

Design Principles

  1. Snapshot-first — Tool descriptions steer models to use cloak_snapshot() as the primary page understanding tool

  2. Ref-based only — No CSS selector tools. All interaction via [@eN] refs from snapshots

  3. Stealth by default — Anti-detection, humanization, and stealth args all ON without configuration

  4. Auto-snapshot after actions — Click, type, navigate all return an updated snapshot

  5. Smart waiting — Auto-wait on navigation (networkidle + MutationObserver settle), auto-retry on failed clicks

  6. Capability gating — Advanced tools (network, cookies, PDF) off by default to keep tool count low

  7. Clean content extraction — Markdown for reading, snapshot for interaction, annotated screenshots for vision

Development

git clone https://github.com/overtimepog/CloakMCP
cd CloakMCP
pip install -e ".[dev]"
pytest

License

Apache-2.0

Available Tools

20 tools
cloak_backB

Navigate back in browser history. Returns an updated snapshot.

Args: page_id: Target page ID.

Inputs: page_id (required). Returns: object

cloak_checkA

Check or uncheck a checkbox/radio by ref ID. Returns an updated snapshot.

Args: page_id: Target page ID. ref: Ref ID from snapshot. checked: True to check, False to uncheck.

Inputs: page_id (required), ref (required), checked. Returns: object

cloak_clickA

Click an element by its [@eN] ref ID from cloak_snapshot.

Auto-retries once if the element moved. Returns an updated snapshot.

Args: page_id: Target page ID. ref: Ref ID from snapshot (e.g. '@e5' or 'e5').

Inputs: page_id (required), ref (required). Returns: object

cloak_closeA

Close the stealth browser and release all resources. Always call when done.

Inputs: no named parameters. Returns: object

cloak_close_pageB

Close a specific page by ID.

Args: page_id: Page ID to close.

Inputs: page_id (required). Returns: object

cloak_evaluateB

Execute JavaScript in the page context and return the result.

Args: page_id: Target page ID. expression: JavaScript expression to evaluate.

Inputs: page_id (required), expression (required). Returns: object

cloak_forwardB

Navigate forward in browser history. Returns an updated snapshot.

Args: page_id: Target page ID.

Inputs: page_id (required). Returns: object

cloak_hoverC

Hover over an element by ref ID. Returns an updated snapshot.

Args: page_id: Target page ID. ref: Ref ID from snapshot.

Inputs: page_id (required), ref (required). Returns: object

cloak_launchA

Launch a stealth CloakBrowser instance. All anti-detection is ON by default.

CloakBrowser is a source-patched Chromium passing Cloudflare Turnstile, reCAPTCHA v3 (0.9 score), FingerprintJS, BrowserScan, and 30+ detectors.

Args: headless: Run headless. Some aggressive sites need headed mode (False). proxy: Proxy URL (e.g. 'http://user:pass@proxy:8080'). Residential recommended. humanize: Human-like mouse/keyboard/scroll (default: True). human_preset: 'default' or 'careful' (slower, more deliberate). stealth_args: Apply stealth fingerprint args (default: True). timezone: IANA timezone (e.g. 'America/New_York'). locale: BCP 47 locale (e.g. 'en-US'). geoip: Auto-detect timezone/locale from proxy IP. fingerprint_seed: Fixed seed for consistent identity across sessions. user_data_dir: Persistent profile path (cookies/localStorage survive restarts). viewport_width: Viewport width in pixels (default: 1920 headless; 1280 headed fallback, or auto-detected). viewport_height: Viewport height in pixels (default: 947 headless; 800 headed fallback, or auto-detected). color_scheme: 'light', 'dark', or 'no-preference'. user_agent: Custom user agent override. extra_args: Additional Chromium CLI flags.

Inputs: headless, proxy, humanize, human_preset, +11 more. Returns: object

cloak_list_pagesB

List all open pages with their IDs and URLs.

Inputs: no named parameters. Returns: object

cloak_navigateA

Navigate to a URL. Auto-waits for the page to settle (network idle + DOM stable).

Handles Cloudflare challenge pages with extra wait time. Returns an updated snapshot of the loaded page.

Args: page_id: Target page ID. url: URL to navigate to. timeout: Navigation timeout in milliseconds.

Inputs: page_id (required), url (required), timeout. Returns: object

cloak_new_pageB

Open a new browser page/tab. Optionally navigate to a URL.

Args: url: URL to navigate to after creating the page.

Inputs: url. Returns: object

cloak_press_keyA

Press a keyboard key (Enter, Tab, Escape, ArrowDown, etc.).

Returns an updated snapshot.

Args: page_id: Target page ID. key: Key name (DOM KeyboardEvent key).

Inputs: page_id (required), key (required). Returns: object

cloak_read_pageA

Get the page content as clean, readable markdown.

Best for reading articles, docs, search results, or any content-heavy page. Strips navigation, ads, footers — returns just the main content. Much more token-efficient than raw HTML (60-80% savings).

Args: page_id: Target page ID. max_length: Max characters to return (default: 50000).

Inputs: page_id (required), max_length. Returns: object

cloak_screenshotA

Take an annotated screenshot with element indices overlaid.

Each numbered element maps to [@eN] refs from cloak_snapshot. Use when you need VISUAL context — images, charts, CAPTCHAs, or layout. For most interactions, prefer cloak_snapshot() instead.

Returns: file path to saved PNG, element count.

Args: page_id: Target page ID. full_page: Capture entire scrollable page (default: viewport only).

Inputs: page_id (required), full_page. Returns: object

cloak_scrollC

Scroll the page. Returns an updated snapshot.

Args: page_id: Target page ID. direction: 'up' or 'down'. amount: Pixels to scroll.

Inputs: page_id (required), direction, amount. Returns: object

cloak_selectC

Select a dropdown option by ref ID. Provide one of: value, label, or index.

Returns an updated snapshot.

Args: page_id: Target page ID. ref: Ref ID of the element. value: Option value attribute to select. label: Option visible text to select. index: Option index (0-based) to select.

Inputs: page_id (required), ref (required), value, label, +1 more. Returns: object

cloak_snapshotA

Capture the page's accessibility tree — the PRIMARY way to understand pages.

Returns interactive elements with [@eN] ref IDs for use with cloak_click, cloak_type, cloak_select, etc. Call this BEFORE interacting with a page.

full=False (default): interactive elements only — compact and fast. full=True: includes surrounding text content for reading context.

This is FASTER, CHEAPER, and MORE RELIABLE than screenshots. Always prefer this over cloak_screenshot for deciding what to click.

Args: page_id: Target page ID from cloak_launch or cloak_new_page. full: Include text content alongside interactive elements. max_length: Max characters to return (default: 12000).

Inputs: page_id (required), full, max_length. Returns: object

cloak_typeA

Type text into an input by its [@eN] ref ID from cloak_snapshot.

Clears the field first by default. Set submit=True to press Enter after. Returns an updated snapshot.

Args: page_id: Target page ID. ref: Ref ID from snapshot (e.g. '@e3' or 'e3'). text: Text to type. clear: Clear field before typing (default: True). submit: Press Enter after typing (default: False).

Inputs: page_id (required), ref (required), text (required), clear, +1 more. Returns: object

cloak_waitA

Wait for the page to settle (no DOM mutations + network idle).

Use after actions that trigger dynamic content loading. Returns whether the page settled and how many DOM mutations occurred.

Args: page_id: Target page ID. timeout_ms: Max wait time in milliseconds (default: 5000).

Inputs: page_id (required), timeout_ms. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 20 tools

    Disambiguation5/5

    Each tool has a distinct, well-defined purpose with no overlap. For example, cloak_click is for clicking elements, cloak_type is for typing text, and cloak_snapshot is for capturing the accessibility tree. The descriptions clearly differentiate actions like navigation (cloak_back, cloak_forward), interaction (cloak_hover, cloak_press_key), and content handling (cloak_read_page, cloak_screenshot).

    Naming Consistency5/5

    All tools follow a consistent 'cloak_verb' or 'cloak_verb_noun' pattern with snake_case throughout. Examples include cloak_launch, cloak_navigate, cloak_snapshot, and cloak_wait. This uniformity makes the tool set predictable and easy to understand, with no deviations in naming conventions.

    Tool Count4/5

    With 20 tools, the count is slightly high but reasonable for a comprehensive browser automation server. It covers a wide range of actions from launching and navigating to interacting and reading content. While it might feel a bit heavy, each tool serves a specific function in the domain, justifying its inclusion without being excessive.

    Completeness5/5

    The tool set provides complete coverage for browser automation, including launch/close, navigation, interaction (click, type, hover, scroll, select, check), content reading (snapshot, read_page, screenshot), and utility functions (evaluate, wait, list_pages). There are no obvious gaps; it supports full lifecycle management and interaction workflows for web pages.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides AI assistants with full control over a real browser session via a Chrome extension, supporting 36 tools for navigation, data extraction, and DOM manipulation. It bypasses bot detection by utilizing the user's active browser session, including cookies, authentication tokens, and installed extensions.
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      An MCP server that provides browser automation capabilities, enabling LLMs to control a web browser for navigation, interaction, and data extraction.
      32
      119 npm
      14
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      A stealth-enhanced browser automation MCP server for AI agents to interact with websites while bypassing anti-bot detection mechanisms like Cloudflare and reCAPTCHA.
      9
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that provides an undetectable Playwright browser to bypass Cloudflare and other bot detection systems, enabling AI agents to navigate and scrape web pages without being blocked.
      11 npm
      MIT