stealth-browser-mcp

v0.1.2
io.github.levontumanyan/stealth-browser-mcp Checked 3 days ago Published 4 days ago

Stealth 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.

ParameterTypeDescription
click_selector
enableboolean
max_secondsinteger
min_secondsinteger
ping_url
tab

navigate

Navigate a tab to url. block_media=True blocks images/fonts/video (None preserves state); wait_until: 'domcontentloaded'|'commit'|'load'|'networkidle'. Clamped to 60s tool cap.

ParameterTypeDescription
url *string
block_media
new_tabboolean
tab
timeout_msinteger
wait_untilstring

new_tab

Open a new browser tab and navigate to url (default 'about:blank'). Set block_media=True for high-speed text-only browsing.

ParameterTypeDescription
block_media
urlstring

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).

ParameterTypeDescription
notifyboolean
poll_interval_snumber
reasonstring
selectorstring
tab
timeout_sinteger
url_containsstring
url_not_containsstring

set_media

Toggle media loading (images, videos, web fonts) on a tab. enable_media=False blocks heavy media for fast text-only browsing.

ParameterTypeDescription
enable_mediaboolean
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.

ParameterTypeDescription
enabledboolean
persistboolean
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.

ParameterTypeDescription
diffboolean
filterstring
include_hrefsboolean
include_iframesboolean
include_shadowboolean
max_elementsinteger
max_lengthinteger
selectorstring
tab
viewport_onlyboolean

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.

ParameterTypeDescription
actions *array
snap_diffboolean
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).

ParameterTypeDescription
cleanboolean
filterstring
interactive_onlyboolean
max_lengthinteger
offsetinteger
selectorstring
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}.

ParameterTypeDescription
container_selector *string
fields *object
include_iframesboolean
include_shadowboolean
limitinteger
max_lengthinteger
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.

ParameterTypeDescription
forceboolean
refstring
selectorstring
snap_diffboolean
tab
textstring
timeout_msinteger

type

Type text into an input/textarea by CSS selector or snapshot ref ('e3' or '@e3'). snap_diff=True appends an inline snapshot delta.

ParameterTypeDescription
clear_firstboolean
press_enterboolean
refstring
selectorstring
snap_diffboolean
tab
textstring
timeout_msinteger

press_key

Press a keyboard key (e.g., 'Enter', 'Tab', 'Escape').

ParameterTypeDescription
key *string
tab

scroll

Scroll up or down by amount pixels.

ParameterTypeDescription
amountinteger
directionstring
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, ...).

ParameterTypeDescription
annotateboolean
full_pageboolean
refstring
save_pathstring
selectorstring
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.

ParameterTypeDescription
url *string
body
headers
max_lengthinteger
methodstring
response_typestring
save_pathstring
tab
timeout_msinteger

downloads

List tracked browser downloads (and recent DOWNLOADS_DIR files when include_dir=True).

ParameterTypeDescription
include_dirboolean
limitinteger

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).

ParameterTypeDescription
clearboolean
content_typestring
limitinteger
max_lengthinteger
resource_typestring
status_mininteger
tab
url_filterstring

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.

ParameterTypeDescription
clearboolean
levelstring
limitinteger
max_lengthinteger
tab

state

Inspect in-memory client-side state (framework: 'auto'|'next'|'redux'|'react'|'vue'|'apollo'|'query'; optional selector for React Fiber).

ParameterTypeDescription
frameworkstring
max_lengthinteger
selectorstring
tab

evaluate_js

Evaluate JS in isolated world by default (alias: script=). Set main_world=True for page globals.

ParameterTypeDescription
expressionstring
main_worldboolean
max_lengthinteger
scriptstring
tab
timeout_msinteger

wait_for

Wait for a CSS selector state, visible page text substring, URL substring, or combination. Clamped to 60s cap.

ParameterTypeDescription
selectorstring
statestring
tab
textstring
timeout_msinteger
url_containsstring

switch_tab

Switch tab by index, browser-derived id, or name substring (see status). Accepts 'tab'/'index'.

ParameterTypeDescription
index
tab

close_tab

Close tab by index, browser-derived id, or name substring (-1 active, -99 last). Accepts 'tab'/'index'.

ParameterTypeDescription
index
tab

close_browser

Completely close the browser window, terminate all browser and renderer processes, and release all resources.

ParameterTypeDescription
forceboolean
force_killboolean

restart_browser

Restart Chromium cleanly, preserving non-blank tabs unless url overrides tab [0]. headless=None keeps current mode.

ParameterTypeDescription
forceboolean
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.

ParameterTypeDescription
forceboolean
headlessboolean