stealth-browser-mcp
v0.1.2Stealth browser automation MCP server: CDP-first attach, Patchright fallback, shared daemon
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
status
Check connection status to Stealth Browser and list all open tabs.
keep_alive
Keep a tab session alive: trusted CDP mouse/wheel input, modal auto-click, optional click_selector and heartbeat ping_url.
| Parameter | Type | Description |
|---|---|---|
click_selector | ||
enable | boolean | |
max_seconds | integer | |
min_seconds | integer | |
ping_url | ||
tab |
new_tab
Open a new browser tab and navigate to url (default 'about:blank'). Set block_media=True for high-speed text-only browsing.
| Parameter | Type | Description |
|---|---|---|
block_media | ||
url | string |
wait_for_human
Hand off a tab to the human for login/2FA/CAPTCHA without stealing focus: sends an optional macOS notification naming the tab and polls until url_contains, url_not_contains, selector visible, or URL change (switches to headed mode only if the browser currently runs headless).
| Parameter | Type | Description |
|---|---|---|
notify | boolean | |
poll_interval_s | number | |
reason | string | |
selector | string | |
tab | ||
timeout_s | integer | |
url_contains | string | |
url_not_contains | string |
set_media
Toggle media loading (images, videos, web fonts) on a tab. enable_media=False blocks heavy media for fast text-only browsing.
| Parameter | Type | Description |
|---|---|---|
enable_media | boolean | |
tab |
set_animations
Freeze CSS animations/transitions via reduced-motion emulation + a kill-stylesheet; sites may serve reduced-motion content variants, and re-enabling fully applies only after restart_browser() because init scripts cannot be removed.
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | |
persist | boolean | |
tab |
snapshot
List visible interactive elements with refs (e0, e1, ...) across DOM, Shadow DOM, and same-origin iframes. Use filter/viewport_only to narrow; include_hrefs=True to show link URLs. Refs are stable for the document lifetime and reused across calls, so they are sparse and non-positional: do not assume e3 sits above e7. Reuse a ref only while its element survives; take a new snapshot after navigation or reload. diff=True returns only [+]/[~]/[-] changes since the last snapshot on this tab.
| Parameter | Type | Description |
|---|---|---|
diff | boolean | |
filter | string | |
include_hrefs | boolean | |
include_iframes | boolean | |
include_shadow | boolean | |
max_elements | integer | |
max_length | integer | |
selector | string | |
tab | ||
viewport_only | boolean |
batch
Run sequential actions in one turn. Valid actions: click, fill, type, select, press, wait_for, sleep, evaluate (fields: selector, ref, text, value, key, state, ms, force, expression, main_world, timeout_ms). Set snap_diff=True to append one combined snapshot delta after the last step.
| Parameter | Type | Description |
|---|---|---|
actions * | array | |
snap_diff | boolean | |
tab |
get_content
Extract visible text from a tab. Supports offset (negative for tail, e.g. -3000), filter (regex/substring with context), clean=True (strips nav/hidden/whitespace), or interactive_only=True (calls snapshot).
| Parameter | Type | Description |
|---|---|---|
clean | boolean | |
filter | string | |
interactive_only | boolean | |
max_length | integer | |
offset | integer | |
selector | string | |
tab |
extract
Extract JSON rows from containers (cards/tables/forms) across DOM/Shadow/iframes. fields: name -> 'text:.sel'|'@attr .sel' ('@value'/'@checked' for inputs)|'html:.sel'|{selector,mode,attr}.
| Parameter | Type | Description |
|---|---|---|
container_selector * | string | |
fields * | object | |
include_iframes | boolean | |
include_shadow | boolean | |
limit | integer | |
max_length | integer | |
tab |
click
Click an element by CSS selector, snapshot ref ('e12' or '@e12'), or visible text. Set force=True to bypass pointer-interception overlays; snap_diff=True appends an inline snapshot delta.
| Parameter | Type | Description |
|---|---|---|
force | boolean | |
ref | string | |
selector | string | |
snap_diff | boolean | |
tab | ||
text | string | |
timeout_ms | integer |
type
Type text into an input/textarea by CSS selector or snapshot ref ('e3' or '@e3'). snap_diff=True appends an inline snapshot delta.
| Parameter | Type | Description |
|---|---|---|
clear_first | boolean | |
press_enter | boolean | |
ref | string | |
selector | string | |
snap_diff | boolean | |
tab | ||
text | string | |
timeout_ms | integer |
press_key
Press a keyboard key (e.g., 'Enter', 'Tab', 'Escape').
| Parameter | Type | Description |
|---|---|---|
key * | string | |
tab |
scroll
Scroll up or down by amount pixels.
| Parameter | Type | Description |
|---|---|---|
amount | integer | |
direction | string | |
tab |
screenshot
Capture a screenshot of the active page, full page, or a specific element (by selector or snapshot ref). Set annotate=True to temporarily overlay snapshot ref labels (e0, e1, ...).
| Parameter | Type | Description |
|---|---|---|
annotate | boolean | |
full_page | boolean | |
ref | string | |
save_path | string | |
selector | string | |
tab |
fetch
Execute an authenticated in-browser fetch (supports relative, absolute, and blob: URLs). Pass save_path to write binary/PDF responses to disk without entering context.
| Parameter | Type | Description |
|---|---|---|
url * | string | |
body | ||
headers | ||
max_length | integer | |
method | string | |
response_type | string | |
save_path | string | |
tab | ||
timeout_ms | integer |
downloads
List tracked browser downloads (and recent DOWNLOADS_DIR files when include_dir=True).
| Parameter | Type | Description |
|---|---|---|
include_dir | boolean | |
limit | integer |
network_requests
List captured network responses/failures for a tab. Filter by url_filter, resource_type ('xhr,fetch'), content_type ('json','pdf'), or status_min (e.g. 400).
| Parameter | Type | Description |
|---|---|---|
clear | boolean | |
content_type | string | |
limit | integer | |
max_length | integer | |
resource_type | string | |
status_min | integer | |
tab | ||
url_filter | string |
console_logs
List captured browser console messages and page errors (filter by comma-separated level: 'error,warning,log,pageerror'). Attaches CDP console listener on first call.
| Parameter | Type | Description |
|---|---|---|
clear | boolean | |
level | string | |
limit | integer | |
max_length | integer | |
tab |
state
Inspect in-memory client-side state (framework: 'auto'|'next'|'redux'|'react'|'vue'|'apollo'|'query'; optional selector for React Fiber).
| Parameter | Type | Description |
|---|---|---|
framework | string | |
max_length | integer | |
selector | string | |
tab |
evaluate_js
Evaluate JS in isolated world by default (alias: script=). Set main_world=True for page globals.
| Parameter | Type | Description |
|---|---|---|
expression | string | |
main_world | boolean | |
max_length | integer | |
script | string | |
tab | ||
timeout_ms | integer |
wait_for
Wait for a CSS selector state, visible page text substring, URL substring, or combination. Clamped to 60s cap.
| Parameter | Type | Description |
|---|---|---|
selector | string | |
state | string | |
tab | ||
text | string | |
timeout_ms | integer | |
url_contains | string |
switch_tab
Switch tab by index, browser-derived id, or name substring (see status). Accepts 'tab'/'index'.
| Parameter | Type | Description |
|---|---|---|
index | ||
tab |
close_tab
Close tab by index, browser-derived id, or name substring (-1 active, -99 last). Accepts 'tab'/'index'.
| Parameter | Type | Description |
|---|---|---|
index | ||
tab |
close_browser
Completely close the browser window, terminate all browser and renderer processes, and release all resources.
| Parameter | Type | Description |
|---|---|---|
force | boolean | |
force_kill | boolean |
restart_browser
Restart Chromium cleanly, preserving non-blank tabs unless url overrides tab [0]. headless=None keeps current mode.
| Parameter | Type | Description |
|---|---|---|
force | boolean | |
headless | ||
url |
set_headless
Switch headed (default) vs headless mode; restarts Chromium on change (switching to headless refuses if non-blank tabs exist unless force=True). Prefer wait_for_human() for login/2FA.
| Parameter | Type | Description |
|---|---|---|
force | boolean | |
headless | boolean |