capmonster-mcp-patchright-captcha-solver
v1.1.3Browser automation MCP for solving captchas with CapMonster Cloud via Patchright.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
browser_start
Start a browser session. Defaults to patchright chromium headed Chrome with a persistent profile.
| Parameter | Type | Description |
|---|---|---|
browser | string | |
cdpEndpoint | string | Existing Chrome remote debugging endpoint, e.g. http://127.0.0.1:9222 |
channel | string | |
colorScheme | string | |
device | string | Emulate a device from the Playwright registry, e.g. "iPhone 15", "Pixel 7". Sets viewport, UA, scale factor, and touch. |
geolocation | object | Spoof geolocation. Grants the geolocation permission automatically. |
headless | boolean | |
height | number | |
locale | string | |
mobile | boolean | Enable mobile emulation (touch + mobile hints) without a full device descriptor. |
proxy | object | Proxy for this session (persistent launch only). Keep IP country consistent with locale/timezone/geo to avoid bot detection. |
recordVideo | Record a video of the whole session. Pass true for defaults, or an object to customize. Saved as .webm; files finalize on browser_close. Not available over cdpEndpoint. | |
timezoneId | string | |
userAgent | string | |
userDataDir | string | |
width | number |
browser_status
Return current browser status.
browser_new_page
Open a new page/tab and make it active. Optionally navigate to a URL.
| Parameter | Type | Description |
|---|---|---|
url | string |
browser_pages
List open pages/tabs with ids, active state, URL, and title.
browser_switch_page
Switch the active page/tab by pageId from browser_pages.
| Parameter | Type | Description |
|---|---|---|
pageId * | string |
browser_close_page
Close a page/tab by pageId, or the active page if omitted.
| Parameter | Type | Description |
|---|---|---|
pageId | string |
browser_snapshot
Return a distilled AI-oriented aria snapshot (verbose /url lines dropped and data: URLs collapsed to save tokens). Use [ref=eN] values with browser_click/fill/type/hover/press/wait_for.
| Parameter | Type | Description |
|---|---|---|
includeUrls | boolean | Keep /url lines for links. Default false for token efficiency. |
maxLength | number | Truncate snapshot to this many chars. |
browser_find
Search the current page's aria snapshot for text or a regex. Returns matching nodes with their [ref] and a few lines of surrounding context — cheaper than a full browser_snapshot when you only need to locate an element.
| Parameter | Type | Description |
|---|---|---|
query * | string | Text substring, or a regex source when regex=true. |
context | number | Lines of surrounding context per match. Default 2. |
ignoreCase | boolean | Case-insensitive match. Default true. |
maxMatches | number | Max matches to return. Default 20. |
regex | boolean | Treat query as a regular expression. |
browser_take_screenshot
Take a screenshot. Returns base64 if path is omitted.
| Parameter | Type | Description |
|---|---|---|
fullPage | boolean | |
path | string | |
scale | string | css = smaller, device-consistent CSS pixels; device = full device-pixel resolution. |
browser_click
Click an element by CSS selector or aria ref from browser_snapshot.
| Parameter | Type | Description |
|---|---|---|
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
timeout | number |
browser_fill
Fill an input by CSS selector or aria ref from browser_snapshot.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
timeout | number |
browser_type
Type text into an element (CSS selector or aria ref) with human-like input: real per-key events, real Shift keyDown/up for capitals & symbols, variable dwell and inter-key gaps. Verifies the result against the request for input/textarea and errors on mismatch.
| Parameter | Type | Description |
|---|---|---|
text * | string | |
delay | number | Deprecated/ignored; timing is randomized. |
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
timeout | number | |
verify | boolean | Verify typed value matches request (default true) for input/textarea. |
browser_hover
Hover an element by CSS selector or aria ref from browser_snapshot.
| Parameter | Type | Description |
|---|---|---|
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
timeout | number |
browser_press_key
Press a keyboard key, optionally focused on a selector or aria ref first.
| Parameter | Type | Description |
|---|---|---|
key * | string | |
frameSelector | string | Optional iframe CSS selector; selector/ref resolve inside it. |
ref | string | |
selector | string | |
timeout | number |
browser_wait_for
Wait for time or for selector/ref state. If no selector/ref, waits timeout milliseconds.
| Parameter | Type | Description |
|---|---|---|
frameSelector | string | Optional iframe CSS selector; selector/ref resolve inside it. |
ref | string | |
selector | string | |
state | string | |
timeout | number |
browser_evaluate
Evaluate JavaScript in the active page. Pass 'function' for a function body, 'expression' for a plain expression, or 'script' (deprecated). By default JS runs in an isolated stealth world (DOM is shared, but the page's own window globals are NOT visible). Set world:'main' to run in the page's real world — required to read or call globals the page defined (e.g. a page-registered callback). Pass frameSelector to run inside a specific iframe (including cross-origin ones, e.g. a captcha widget hosted on a different domain) instead of the top-level page — same CSS selector browser_click/browser…
| Parameter | Type | Description |
|---|---|---|
expression | string | |
frameSelector | string | Run inside this iframe (CSS selector) instead of the top-level page — reaches cross-origin iframe content that plain JS (element.contentDocument) cannot, the same way browser_click/browser_fill/brow… |
function | string | |
script | string | |
world | string | Execution world. 'isolated' (default) = stealth, page globals hidden; 'main' = page's real world, page globals visible/callable. |
browser_fingerprint_check
Collect browser fingerprint diagnostics from the active page.
browser_select_option
Select options from a <select> element by CSS selector or aria ref.
| Parameter | Type | Description |
|---|---|---|
values * | array | Option values or labels to select. |
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
timeout | number |
browser_handle_dialog
Accept or dismiss a JavaScript dialog (alert / confirm / prompt).
| Parameter | Type | Description |
|---|---|---|
accept * | boolean | true = accept, false = dismiss |
promptText | string | Text to enter for prompt dialogs |
timeout | number | Milliseconds to wait when wait=true |
wait | boolean | When true, wait for and handle the next dialog before returning. Default false arms a one-shot handler for the next action. |
browser_file_upload
Upload files to a <input type=file> by CSS selector or aria ref.
| Parameter | Type | Description |
|---|---|---|
paths * | array | Local file paths to upload. |
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
timeout | number |
browser_network_requests
List captured network requests. Set activeOnly=true for in-flight only.
| Parameter | Type | Description |
|---|---|---|
activeOnly | boolean |
browser_network_request
Get details for a single network request by stable id from browser_network_requests. Legacy zero-based index is also accepted.
| Parameter | Type | Description |
|---|---|---|
details | boolean | Include response body preview when true |
id | string | |
index | number | Legacy zero-based index into the retained request list |
browser_console_messages
List captured console messages (log / warn / error etc.).
browser_resize
Resize the active page viewport.
| Parameter | Type | Description |
|---|---|---|
height * | number | Viewport height in pixels |
width * | number | Viewport width in pixels |
browser_drag
Drag an element from source to target by CSS selector or aria ref.
| Parameter | Type | Description |
|---|---|---|
source | object | { selector|ref, frameSelector? } |
target | object | { selector|ref, frameSelector? } |
timeout | number |
browser_fill_form
Fill multiple form fields at once. Each field needs selector or ref, and value.
| Parameter | Type | Description |
|---|---|---|
fields * | array | |
timeout | number |
browser_run_code_unsafe
Execute arbitrary JavaScript in page context. Prefer browser_evaluate when possible. Runs in the isolated stealth world by default; set world:'main' to run in the page's real world (page-defined window globals visible/callable).
| Parameter | Type | Description |
|---|---|---|
script * | string | |
args | array | |
world | string | Execution world. 'isolated' (default) = stealth; 'main' = page's real world, page globals visible/callable. |
browser_add_init_script
Register JavaScript that runs before any page script, on every navigation (Playwright's page.addInitScript — always in the page's main world). Unlike browser_evaluate, this is proactive: it wins the race against a site's own inline <script> (e.g. Cloudflare/Turnstile checks that run synchronously on document parse), which a reactive evaluate call issued over the MCP connection cannot. Call this BEFORE browser_navigate to the target URL — it has no effect on a page already loaded, only on the page it's called on and future navigations of that same page. Scoped to the current page only.
| Parameter | Type | Description |
|---|---|---|
function | string | Function body/expression to install as the init script, e.g. '() => { window.foo = 1; }'. |
script | string | Deprecated alias for function. |
browser_network_state_set
Set network state: pass offline=true to simulate offline, offline=false to restore connectivity.
| Parameter | Type | Description |
|---|---|---|
offline * | boolean |
browser_api_request
Make an HTTP request reusing the browser session's cookies/storage (authenticated API calls without re-login). Returns status, headers, and body.
| Parameter | Type | Description |
|---|---|---|
url * | string | |
data | Request body: a string, or an object (sent as JSON). | |
headers | object | Request headers as key/value strings. |
maxBytes | number | Truncate response body to this many chars. Default 100000. |
method | string | |
timeout | number |
browser_get_visible_text
Get the visible text (document.body.innerText) of the active page. Lighter than a full aria snapshot.
| Parameter | Type | Description |
|---|---|---|
maxLength | number | Truncate to this many chars. Default 100000. |
browser_get_visible_html
Get page HTML, optionally scoped to a selector. Strips script/style/svg by default for token efficiency.
| Parameter | Type | Description |
|---|---|---|
maxLength | number | Truncate to this many chars. Default 100000. |
removeScripts | boolean | Remove script/style/noscript/svg. Default true. |
selector | string | Limit to this element's outerHTML. Default whole document. |
browser_iframe_click
Shorthand for clicking inside an iframe. (Most tools now accept a frameSelector directly — prefer browser_click with frameSelector.)
| Parameter | Type | Description |
|---|---|---|
frameSelector * | string | CSS selector for the iframe element. |
selector * | string | CSS selector for the target element inside the iframe. |
timeout | number |
browser_iframe_fill
Shorthand for filling inside an iframe. (Most tools now accept a frameSelector directly — prefer browser_fill with frameSelector.)
| Parameter | Type | Description |
|---|---|---|
frameSelector * | string | CSS selector for the iframe element. |
selector * | string | CSS selector for the input inside the iframe. |
value * | string | |
timeout | number |
browser_route_block
Block requests by resource type and/or URL pattern (e.g. block images/fonts/media to speed up loads and shrink fingerprint surface). Applies to all pages in the context.
| Parameter | Type | Description |
|---|---|---|
resourceTypes | array | Resource types to abort. If omitted, blocks every request matching urlPattern. |
urlPattern | string | Glob/URL pattern to match. Default **/* (all). |
browser_route_mock
Mock matching requests with a canned response (fulfill). Useful for stubbing APIs or bypassing endpoints.
| Parameter | Type | Description |
|---|---|---|
urlPattern * | string | Glob/URL pattern to match. |
body | string | Response body. |
contentType | string | Content-Type, default text/plain. |
status | number | HTTP status, default 200. |
browser_route_clear
Remove all active block/mock routes.
browser_storage_save
Export current session (cookies + localStorage) as a Playwright storageState. Saves to path, or returns the state JSON if path omitted.
| Parameter | Type | Description |
|---|---|---|
path | string | Output JSON file path. If omitted, returns the state inline. |
browser_storage_load
Restore a session from a storageState (cookies + localStorage). Provide a file path or an inline state object. Note: localStorage restore navigates to each origin.
| Parameter | Type | Description |
|---|---|---|
path | string | Path to a storageState JSON file. |
state | object | Inline storageState object ({ cookies, origins }). |
browser_cookie_list
List cookies in the current session, optionally filtered by domain and/or path.
| Parameter | Type | Description |
|---|---|---|
domain | string | Filter cookies by domain (substring match). |
path | string | Filter cookies by path (exact match). |
browser_cookie_get
Get a single cookie by name. Returns null if not present.
| Parameter | Type | Description |
|---|---|---|
name * | string | Cookie name to get. |
browser_cookie_set
Set a cookie with optional flags. Provide url, or domain (path defaults to /). If neither given, the active page's origin is used.
| Parameter | Type | Description |
|---|---|---|
name * | string | |
value * | string | |
domain | string | Cookie domain, e.g. .example.com |
expires | number | Expiry as Unix timestamp (seconds). Session cookie if omitted. |
httpOnly | boolean | |
path | string | Cookie path, default /. |
sameSite | string | |
secure | boolean | |
url | string | URL the cookie applies to. Alternative to domain/path. |
browser_cookie_delete
Delete cookies by name, optionally narrowed by domain/path.
| Parameter | Type | Description |
|---|---|---|
name * | string | Cookie name to delete. |
domain | string | |
path | string |
browser_cookie_clear
Clear all cookies in the current session.
browser_localstorage_list
List all localStorage key-value pairs for the active page's origin.
browser_localstorage_get
Get a localStorage item by key. Returns null if absent.
| Parameter | Type | Description |
|---|---|---|
key * | string |
browser_localstorage_set
Set a localStorage item on the active page's origin.
| Parameter | Type | Description |
|---|---|---|
key * | string | |
value * | string |
browser_localstorage_delete
Delete a localStorage item by key.
| Parameter | Type | Description |
|---|---|---|
key * | string |
browser_localstorage_clear
Clear all localStorage for the active page's origin.
browser_sessionstorage_list
List all sessionStorage key-value pairs for the active page's origin.
browser_sessionstorage_get
Get a sessionStorage item by key. Returns null if absent.
| Parameter | Type | Description |
|---|---|---|
key * | string |
browser_sessionstorage_set
Set a sessionStorage item on the active page's origin.
| Parameter | Type | Description |
|---|---|---|
key * | string | |
value * | string |
browser_sessionstorage_delete
Delete a sessionStorage item by key.
| Parameter | Type | Description |
|---|---|---|
key * | string |
browser_sessionstorage_clear
Clear all sessionStorage for the active page's origin.
browser_passkey_install
Install Patchright's virtual WebAuthn authenticator in the current browser context. Call before a page first uses navigator.credentials.
browser_passkey_create
Generate or import a virtual passkey. To import, provide all four key-material fields. Private keys are omitted unless includePrivateKey=true.
| Parameter | Type | Description |
|---|---|---|
rpId * | string | Relying-party id, usually the site's effective domain. |
id | string | Base64url credential id. |
includePrivateKey | boolean | Return private key material. Default false. |
privateKey | string | Base64url PKCS#8 DER private key. |
publicKey | string | Base64url SPKI DER public key. |
userHandle | string | Base64url user handle. |
browser_passkey_list
List virtual passkeys, optionally filtered by rpId or credential id. Private keys are omitted unless includePrivateKey=true.
| Parameter | Type | Description |
|---|---|---|
id | string | Base64url credential id. |
includePrivateKey | boolean | Return private key material. Default false. |
rpId | string |
browser_passkey_delete
Delete one virtual passkey by its base64url credential id.
| Parameter | Type | Description |
|---|---|---|
id * | string |
browser_video_save
Direct the active page's session recording to a specific output path (requires the session to have been started with recordVideo). The .webm finalizes when the page or browser closes. Without a path, returns the pending video location.
| Parameter | Type | Description |
|---|---|---|
path | string | Target .webm path. If omitted, returns the auto-generated pending path. |
browser_highlight
Draw a persistent highlight overlay around an element (by CSS selector or aria ref). Useful for screenshots and video recording to show what the agent is focusing on. Does not affect page behavior.
| Parameter | Type | Description |
|---|---|---|
frameSelector | string | Optional CSS selector for an iframe. When set, selector/ref resolve inside that frame. |
label | string | Optional text label shown above the highlight; also used as the key for browser_hide_highlight. |
ref | string | aria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref. |
selector | string | CSS selector. Provide exactly one of selector or ref. |
style | string | Optional extra inline CSS for the overlay, e.g. 'outline: 3px dashed lime'. |
timeout | number |
browser_hide_highlight
Remove highlight overlays. Pass label/selector/ref to remove a specific one, or omit all to clear every highlight.
| Parameter | Type | Description |
|---|---|---|
label | string | Label/key used when the highlight was added. |
ref | string | aria ref used when the highlight was added. |
selector | string | Selector used when the highlight was added. |
browser_save_blob
Evaluate JavaScript in the page and write the result straight to a file on disk — the value itself never passes through this tool's response. Use this instead of browser_evaluate whenever you need to get a large/opaque blob (base64 image(s), a full page's HTML, a big JSON dump) out of the live page and into a request body: reading it via browser_evaluate and then re-typing/pasting it into another tool call's arguments (e.g. create_task's imagesBase64/htmlPageBase64) risks silently corrupting it — a dropped character or an unclosed quote partway through a multi-KB string merges what should…
| Parameter | Type | Description |
|---|---|---|
path * | string | Output file path. |
encoding | string | 'base64' decodes the evaluated string into raw bytes before writing. 'text' (default) writes UTF-8 (JSON-stringifying non-string results). |
expression | string | |
function | string | |
world | string | Execution world. 'isolated' (default) = stealth, page globals hidden; 'main' = page's real world, page globals visible/callable. |
browser_save_pdf
Render the active page to PDF via CDP (works in headed/stealth mode). Saves to path, or returns base64 if path omitted.
| Parameter | Type | Description |
|---|---|---|
format | string | |
landscape | boolean | |
path | string | Output file path. If omitted, returns base64. |
printBackground | boolean | Include background graphics. Default true. |
scale | number | Render scale, default 1. |
browser_close
Close the browser session.