Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MCP server (zendriver-mcp)

zendriver-mcp is a Model Context Protocol server that exposes zendriver-rs through 49 MCP tools, so any MCP-compatible client (Claude Desktop, Claude Code, custom agents) can drive a real, stealth-by-default Chrome browser.

Install

cargo install zendriver-mcp

The default build enables all gated features (interception, expect, cloudflare, fetcher). For a lean build:

cargo install zendriver-mcp --no-default-features

Claude Desktop

{
  "mcpServers": {
    "zendriver": {
      "command": "zendriver-mcp"
    }
  }
}

HTTP mode

zendriver-mcp --http 127.0.0.1:8765

Bind localhost-only by default. It is the operator's responsibility to expose the endpoint via a reverse proxy + mTLS / network policy for remote access.

CLI flags

zendriver-mcp [OPTIONS]

OPTIONS:
    --http <ADDR>                  Run streamable HTTP transport on ADDR
                                   (e.g. 127.0.0.1:8765). Default: stdio.
    --stealth-profile <KIND>       Default stealth profile.
                                   [auto|native|spoof_macos|spoof_linux|spoof_windows]
                                   Default: auto
    --log <FILTER>                 Tracing log filter (EnvFilter syntax).
                                   Default: info
    -h, --help
    -V, --version

Tool surface

49 tools across these categories:

CategoryToolsCount
Lifecyclebrowser_open / _close / _status3
Navigationbrowser_goto / _back / _forward / _reload / _wait_for_idle5
Tabsbrowser_tab_list / _new / _switch / _close / _activate5
Findbrowser_find / _find_all2
Actionsbrowser_click / _hover / _type / _press / _set_value / _clear / _focus / _scroll_into_view / _upload9
Readsbrowser_element_state1
Snapshotsbrowser_html / _screenshot2
Evalbrowser_evaluate / _evaluate_main2
Cookiesbrowser_cookies_get / _set / _delete / _clear / _persist5
Storagebrowser_storage_get / _set / _delete / _clear4
Framesbrowser_frame_list1
Stealthbrowser_set_stealth_profile1
Interception (gated)browser_intercept_add_rule / _remove_rule / _list_rules / _clear_rules4
Expect (gated)browser_expect_register / _await / _cancel3
Cloudflare (gated)browser_solve_turnstile1
Fetcher (gated)browser_install_chrome1

All find / action tools share a Selector arg — one-of css | xpath | text | text_exact | text_regex | role, with modifiers nth / visible_only / timeout_ms / frame_id. State-changing tools accept return_snapshot: bool for one-call action + observe.

Full JSON Schema for every tool's input + output is captured in crates/zendriver-mcp/tests/snapshots/ and changes there require an explicit cargo insta accept — the wire shape is reviewed.

Stealth

Stealth is on by default (matching the zendriver library). Configure the default fingerprint via --stealth-profile at server start; switch live via browser_set_stealth_profile (takes effect on the next browser_open).

Troubleshooting

  • Logs go to stderr in stdio mode — stdout is reserved for MCP JSON-RPC. Use --log debug for verbose CDP-call logging.
  • Errors include _meta.suggested_next hints when applicable (e.g. ElementNotFound suggests reconnaissance via browser_html or a fresh browser_find_all snapshot).
  • HTTP smoke test binds 127.0.0.1:18765 by convention — if your environment has that port taken, set a different port via --http.
  • Real-Chrome integration tests are gated behind cargo feature integration-tests and #[ignore] markers: run via cargo test -p zendriver-mcp --features integration-tests -- --ignored.