cdpilot
v0.9.13Zero-npm-dependency browser automation over raw CDP — no Puppeteer, Playwright, or Selenium.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
browser_screenshot
Save a viewport screenshot and return the file path (image enters context only if the file is read). Defaults to CSS pixels on HiDPI displays (env CDPILOT_SHOT_SCALE=device keeps device pixels). A w x h image costs ceil(w/28)*ceil(h/28) vision tokens: crop with element to cut pixels; format and quality change only file size.
| Parameter | Type | Description |
|---|---|---|
element | string | CSS selector to crop to element bounding box |
filename | string | Output file path (.png, .jpg, .webp) |
quality | number | JPEG quality 1-100 (.jpg only; default 80): file size only, same vision tokens |
browser_click
Click an element by CSS selector, scrolling into view and auto-waiting up to 5 seconds (MutationObserver). Returns clicked tag name and text. When a mouse click press lands but the page changes before release so the target is missed, nothing is clicked again and the first line is JSON {"clicked": false, "reason": "moved"|"gone"|"unknown"} (isError stays false): check page state before retrying.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector; chain into an iframe or shadow root with '>>>' (e.g. 'iframe#card >>> .inner') |
browser_type
Type text into an input or textarea using React-compatible value setting (native setter + input/change events), auto-waiting up to 5 seconds. Alias of browser_fill.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector; chain into an iframe or shadow root with '>>>' (e.g. 'iframe#card >>> .inner') |
text * | string | Text value to type into the element |
browser_content
Get visible text of current page (document.body.innerText) up to 10000 characters without HTML markup. Prefer browser_a11y for structured navigation data.
browser_html
Get full HTML source of current page (document.documentElement.outerHTML) up to 50000 characters. Prefer browser_content or browser_a11y for smaller, more targeted data.
browser_eval
Execute JavaScript in the page context via Runtime.evaluate and return the result.
| Parameter | Type | Description |
|---|---|---|
expression * | string | JavaScript expression to evaluate |
browser_eval_batch
Evaluate multiple JavaScript expressions in a single CDP round-trip, returning an array of {ok, value} or {ok:false, error} objects without aborting on individual failures.
| Parameter | Type | Description |
|---|---|---|
expressions * | array | Array of JavaScript expressions (each runs in its own try/catch) |
browser_tabs
List all open browser tabs with their IDs, URLs, and titles.
browser_console
Navigate to a URL and capture all console messages (log, warn, error, info) and uncaught exceptions.
| Parameter | Type | Description |
|---|---|---|
url | string | URL to navigate to while capturing console output |
browser_network
Navigate to a URL and monitor network requests and responses, returning each request's URL, HTTP status code, and MIME type.
| Parameter | Type | Description |
|---|---|---|
url | string | URL to navigate to while monitoring network traffic |
browser_a11y
Get page accessibility tree as structured data with @N element references usable with browser_click (preferred for page structure). Use 'summary' mode for interactive elements only.
| Parameter | Type | Description |
|---|---|---|
mode | string | Detail level: 'full' for complete tree, 'summary' for interactive elements only |
browser_fill
Set an input or textarea value via native descriptor setter and change events, auto-waiting up to 5 seconds. Works with regular inputs and React controlled components.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector; chain into an iframe or shadow root with '>>>' (e.g. 'iframe#card >>> .inner') |
value * | string | Value to set in the input field |
browser_launch
Launch an isolated browser instance with Chrome DevTools Protocol enabled using local Brave/Chrome/Chromium (no download) and an isolated profile: the user's own browser data is never touched.
browser_close
Close all tabs opened by cdpilot, and gracefully quit the browser only if no user-opened tabs remain. Set force=true to quit even if user tabs remain; set keep_browser=true to close cdpilot tabs and keep browser running.
| Parameter | Type | Description |
|---|---|---|
force | boolean | Close the browser application even if user-opened tabs remain. |
keep_browser | boolean | Only close cdpilot's own tabs; never quit the browser. |
browser_extract
Extract structured DOM data matching a CSS selector without an LLM: returns text, JSON (tag, text, attrs, href, src), or list. Limits: 100 elements for JSON, 200 for text.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector to match elements |
format | string | Output format: 'text' (one per line), 'json' (with attributes), 'list' (numbered) |
browser_observe
List all interactive elements on current page with available actions (CLICK, FILL, NAVIGATE, TOGGLE, SELECT, SUBMIT, UPLOAD) deterministically without an LLM.
browser_agent_observe
Token-budget page state for an agent: numbered @refs (role, name, value) for actionable elements, headings and clickable items (full=true lists every entry), text summary, `frames` (visible iframes; blocking=true: inspect with frame=<i>), token_estimate, and known_flows for this host. With CDPILOT_OBSERVE_FORMAT=rows entries are [ref, role, name, value?] arrays (role is "" when equal to previous row). With diff=true returns only changes since last observe/act (added descriptors, removed refs, value changes, text delta). injection_suspect marks page text that addresses the model, not the user (…
| Parameter | Type | Description |
|---|---|---|
all | boolean | Bypass the 400-entry limit (CDPILOT_OBSERVE_MAX) in default view |
diff | boolean | Only changes since the last agent observe/act |
frame | integer | Iframe index from `frames` to read |
full | boolean | Every entry without filtering or size limits |
browser_agent_find
Find entries by accessible name substring (any case) and optional role across the whole page, including entries cut off by observe limits. Returns matches [{ref, role, name}] (at most max, default 20) and total_matches for use with browser_agent_act without writing a trail.
| Parameter | Type | Description |
|---|---|---|
text * | string | Name substring to match (case-insensitive) |
max | integer | Maximum matches to return (default 20) |
role | string | Filter by role (e.g. link, button, textbox) |
browser_agent_act
Act on an observe @ref (click, fill/type with text, hover, submit) or navigate to url, returning state diffs (changed.added descriptors, changed.removed refs, value changes, text delta). Actions are recorded for browser_agent_flow_save. Navigation triggers guard checks: guard {rule, host, mode} in result indicates secret_in_url (other site cookie), url_from_hidden (host only in hidden/suspect text), or outside_origins (CDPILOT_AGENT_ORIGINS); navigation still ran (warn) — stop and ask user before proceeding. Detected cookies are «redacted» in url.
| Parameter | Type | Description |
|---|---|---|
action | string | Action to perform (default: click) |
ref | string | Element @ref from browser_agent_observe (e.g. @3) |
text | string | Text value for fill or type actions |
url | string | URL to navigate to instead of acting on a ref |
browser_agent_flow_save
Save agent acts since the last navigation (or the last N) as a replayable flow for this project using role, name, and position anchors, with passwords replaced by {{placeholders}}. Replay later with browser_agent_run without a model.
| Parameter | Type | Description |
|---|---|---|
name * | string | Flow name (slugified) |
last | integer | Save only the last N actions |
browser_agent_run
Replay a saved flow by anchors without a model in the loop, returning {status:'ok', steps, url, title, ms, tokens_avoided}. On drift (missing anchor or host change), returns status:'drift' with full observation to act with browser_agent_act and repair via browser_agent_flow_save with the same name. Requires vars {name: value} for {{placeholders}} (fails before execution if missing). dry_run previews steps without browser action. A navigation step that browser_agent_act would guard returns guard {rule, host, mode, step} (warn: the step still ran).
| Parameter | Type | Description |
|---|---|---|
flow * | string | Flow name (see known_flows in browser_agent_observe) |
dry_run | boolean | |
vars | object | Values for the flow's {{placeholders}} |
browser_smart_click
Click an element by visible text without selectors, using fuzzy matching across text, aria-label, title, placeholder, and value. Returns match score and alternatives. Use when the exact selector is unknown.
| Parameter | Type | Description |
|---|---|---|
text * | string | Visible text of element to click (e.g. 'Login', 'Submit Order') |
browser_dismiss
Find and click modal dismiss buttons ('Stay signed out', 'No thanks', 'Skip', etc. in EN/TR), explicitly excluding destructive lookalikes (Delete account, Sign out, Subscribe). Pass repeat=1-10 or 'aggressive' (up to 5) for chained modals.
| Parameter | Type | Description |
|---|---|---|
repeat | string | Dismiss attempts (1-10) or 'aggressive' (up to 5 chained modals) |
browser_captcha_solve
Solve Amazon classic image CAPTCHAs (opt-in) via OCR, input filling, and submission, returning JSON status. Providers: 'amazon-local' (offline OCR; pip install amazoncaptcha), or API providers 'capsolver' / '2captcha' (CAPSOLVER_API_KEY / TWOCAPTCHA_API_KEY). For token CAPTCHAs (reCAPTCHA, hCaptcha, Turnstile) use the captcha config/auto CLI.
| Parameter | Type | Description |
|---|---|---|
provider | string | Solver provider: 'amazon-local' (offline OCR), 'capsolver', or '2captcha' |
browser_press_hold
Solve PerimeterX/HUMAN behavioural 'Press & Hold' challenges (opt-in) via humanized CDP Input events (Gaussian-randomized ~3-7s hold with +/-1-2px micro-jitter). Auto-locates #px-captcha unless selector is specified. Returns JSON with solved status, hold_ms, and attempts. Use when browser_friction reports perimeterx.
| Parameter | Type | Description |
|---|---|---|
selector | string | Optional CSS selector for hold target (auto-locates #px-captcha if omitted) |
browser_friction
Detect active anti-bot friction rung via bilingual (EN/TR) heuristics and return recommended policy as JSON: none, rate_limited (exponential backoff), soft_captcha (use captcha tools), or login_wall/otp_sms/hard_block (flagged for human handoff). Read-only; does not bypass defenses.
browser_smart_fill
Fill an input by associated label, placeholder, aria-label, name, or id using React-compatible value setting. Use when the exact selector is unknown.
| Parameter | Type | Description |
|---|---|---|
label * | string | Label or placeholder text (e.g. 'Email', 'Password', 'Search') |
value * | string | Value to fill in the input |
browser_smart_select
Select a dropdown option by label/name and option text without knowing CSS selectors.
| Parameter | Type | Description |
|---|---|---|
label * | string | Label or name of the select dropdown |
option * | string | Text of the option to select |
browser_describe
Get a comprehensive page description combining accessibility tree (@N references), saved PNG screenshot, and visible text. Vision fallback for Canvas/WebGL, visual verification, or when browser_a11y is insufficient.
browser_assert
Assert that an element matching CSS selector exists and optionally contains expected text substring, returning PASS or FAIL with details. Checks visibility by default.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector to check |
text | string | Expected text substring match |
visible | boolean | Check that element is visible (not hidden or zero-size) |
browser_wait_for
Wait for a CSS selector element to appear in the DOM via MutationObserver up to timeout, returning its tag and text or TIMEOUT.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector to wait for |
timeout | number | Maximum wait time in milliseconds |
browser_wait_for_text
Wait for text to appear in document.body via MutationObserver (subtree + characterData) up to timeout, returning surrounding context immediately upon render. Ideal for streaming AI responses, toasts, and banners without selectors.
| Parameter | Type | Description |
|---|---|---|
text * | string | Text substring to wait for in document.body.innerText |
timeout | number | Maximum wait time in milliseconds |
browser_check
Run a batch of assertions verifying element existence and optional text content, returning a summary report with PASS/FAIL counts.
| Parameter | Type | Description |
|---|---|---|
checks * | array | Array of check objects with required 'selector' and optional 'text' |
browser_assert_url
Assert current page URL contains expected substring, returning PASS with full URL or FAIL.
| Parameter | Type | Description |
|---|---|---|
expected_url * | string | Expected substring in current URL |
browser_assert_title
Assert page title contains expected substring, returning PASS with full title or FAIL.
| Parameter | Type | Description |
|---|---|---|
expected_title * | string | Expected substring in page title |
browser_assert_count
Assert count of elements matching CSS selector equals expected count, returning PASS with count or FAIL with actual vs expected.
| Parameter | Type | Description |
|---|---|---|
expected_count * | integer | Expected number of matching elements |
selector * | string | CSS selector to count matching elements |
browser_assert_value
Assert an input, textarea, or select element's value equals expected string, returning PASS or FAIL with actual value.
| Parameter | Type | Description |
|---|---|---|
expected_value * | string | Expected exact value of the element |
selector * | string | CSS selector for the input, textarea, or select element |
browser_assert_attr
Assert an element's HTML attribute contains expected substring, returning PASS with actual value or FAIL.
| Parameter | Type | Description |
|---|---|---|
attr * | string | Attribute name (e.g. 'href', 'src', 'data-id', 'aria-label') |
expected * | string | Expected substring in attribute value |
selector * | string | CSS selector for the element |
browser_assert_visible
Assert an element is visible on page (checking display, visibility, opacity, and bounding rect), returning PASS or FAIL.
| Parameter | Type | Description |
|---|---|---|
selector * | string | CSS selector for element to check for visibility |
browser_screenshot_diff
Compare two screenshot PNG files byte-by-byte for visual regression, returning MATCH or DIFF with file sizes.
| Parameter | Type | Description |
|---|---|---|
path1 * | string | Absolute path to first (baseline) screenshot PNG |
path2 * | string | Absolute path to second (current) screenshot PNG |
browser_watch_start
Start a continuous JPEG screencast to disk via CDP Page.startScreencast (10-30 fps) for multimodal analysis of animations and visual events. Spawns a background daemon writing to a per-project ring buffer (default 300s retention, 100MB cap).
| Parameter | Type | Description |
|---|---|---|
disk_cap_mb | integer | Maximum total frame size in MB before oldest-first eviction. |
fps | integer | Frames per second (1-30). |
max_width | integer | Maximum frame width in pixels (shrinks proportionally). |
quality | integer | JPEG quality 1-100. |
retention_s | integer | Seconds to keep frames before eviction. |
seek | string | Optional MM:SS or seconds to seek page first <video> element before recording. |
url | string | URL or file path to load, or '-' to attach to active page. |
browser_watch_stop
Stop background screencast daemon and delete captured frames by default. Pass keep_frames=true to retain ring buffer on disk.
| Parameter | Type | Description |
|---|---|---|
keep_frames | boolean | Keep captured frames on disk instead of deleting them. |
browser_watch_query
Return file paths of screencast JPEG frames around a target time window for multimodal vision analysis. Choose ONE mode: at+window (centered on video time from start), last (duration before newest frame), or since_last (frames since previous query). Returns at most max frames (default 16), downsampled with high-motion preference when Pillow is available.
| Parameter | Type | Description |
|---|---|---|
at | string | Video timestamp to center on (MM:SS or seconds from screencast start). |
last | string | Duration before newest frame on disk (e.g. '5s'). |
max | integer | Maximum frame paths to return (downsampled if window has more). |
since_last | boolean | Return only frames captured after previous watch_query call. |
window | string | Window duration around `at` (e.g. '5s', '500ms'). |
browser_watch_status
Report screencast daemon state: running flag, frame count, total disk usage, and oldest/newest timestamps.
browser_mode
Get or set 3-tier stealth mode, applied on next navigation. Tiers: 'regular' (default; no anti-fingerprint patches), 'stealth' (light: navigator.webdriver, chrome.runtime, permissions), 'undetected' (full: plugins, WebGL vendor, Worker patch). Omit tier to read current mode. 'regular' suits most sites; escalate to 'undetected' (most fingerprint entropy) only for hard anti-bot targets.
| Parameter | Type | Description |
|---|---|---|
tier | string | Stealth tier to set ('regular', 'stealth', 'undetected'). Omit to read current tier. |
browser_log
Read this project's local session log (read-only; reading does not add to it). Records commands, redacted secrets and inputs, exit codes, durations, URLs, titles, summaries, errors, and output files. Formats: 'table' (default compact table), 'md' (Markdown report of visits, actions, errors, files), or 'json' (raw JSON lines). Covers today unless 'days' is specified. Call it when a browser task is finished to report what was done.
| Parameter | Type | Description |
|---|---|---|
days | integer | Include the last N days (1 = today). |
format | string | Output format ('table', 'md', or 'json'). |
browser_connect
Connect this project to a Chrome/Chromium the user started with --remote-debugging-port=<p> --user-data-dir=<dir> (CAPTCHAs, logins); 127.0.0.1/localhost only. Refused unless this server runs with CDPILOT_MCP_ALLOW_CONNECT=1 (or the user runs `cdpilot connect`). Then every tool runs in that browser, with its cookies and logins, until browser_disconnect; cdpilot never closes it.
| Parameter | Type | Description |
|---|---|---|
target * | string | CDP port number, ws:// URL, or '--auto' to auto-detect. |
browser_disconnect
Disconnect from connected external browser, removing its registration while leaving the browser running. Only way to drop connection.