capmonster-mcp-patchright-captcha-solver

v1.1.3
io.github.CapMonsterCloud/capmonster-mcp-patchright-captcha-solver Checked 1 day ago Published 2 months ago

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

ParameterTypeDescription
browserstring
cdpEndpointstringExisting Chrome remote debugging endpoint, e.g. http://127.0.0.1:9222
channelstring
colorSchemestring
devicestringEmulate a device from the Playwright registry, e.g. "iPhone 15", "Pixel 7". Sets viewport, UA, scale factor, and touch.
geolocationobjectSpoof geolocation. Grants the geolocation permission automatically.
headlessboolean
heightnumber
localestring
mobilebooleanEnable mobile emulation (touch + mobile hints) without a full device descriptor.
proxyobjectProxy for this session (persistent launch only). Keep IP country consistent with locale/timezone/geo to avoid bot detection.
recordVideoRecord 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.
timezoneIdstring
userAgentstring
userDataDirstring
widthnumber

browser_status

Return current browser status.

browser_navigate

Navigate the active page to a URL.

ParameterTypeDescription
url *string
timeoutnumber
waitUntilstring

browser_new_page

Open a new page/tab and make it active. Optionally navigate to a URL.

ParameterTypeDescription
urlstring

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.

ParameterTypeDescription
pageId *string

browser_close_page

Close a page/tab by pageId, or the active page if omitted.

ParameterTypeDescription
pageIdstring

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.

ParameterTypeDescription
includeUrlsbooleanKeep /url lines for links. Default false for token efficiency.
maxLengthnumberTruncate 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.

ParameterTypeDescription
query *stringText substring, or a regex source when regex=true.
contextnumberLines of surrounding context per match. Default 2.
ignoreCasebooleanCase-insensitive match. Default true.
maxMatchesnumberMax matches to return. Default 20.
regexbooleanTreat query as a regular expression.

browser_take_screenshot

Take a screenshot. Returns base64 if path is omitted.

ParameterTypeDescription
fullPageboolean
pathstring
scalestringcss = smaller, device-consistent CSS pixels; device = full device-pixel resolution.

browser_click

Click an element by CSS selector or aria ref from browser_snapshot.

ParameterTypeDescription
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
timeoutnumber

browser_fill

Fill an input by CSS selector or aria ref from browser_snapshot.

ParameterTypeDescription
text *string
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
timeoutnumber

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.

ParameterTypeDescription
text *string
delaynumberDeprecated/ignored; timing is randomized.
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
timeoutnumber
verifybooleanVerify typed value matches request (default true) for input/textarea.

browser_hover

Hover an element by CSS selector or aria ref from browser_snapshot.

ParameterTypeDescription
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
timeoutnumber

browser_press_key

Press a keyboard key, optionally focused on a selector or aria ref first.

ParameterTypeDescription
key *string
frameSelectorstringOptional iframe CSS selector; selector/ref resolve inside it.
refstring
selectorstring
timeoutnumber

browser_wait_for

Wait for time or for selector/ref state. If no selector/ref, waits timeout milliseconds.

ParameterTypeDescription
frameSelectorstringOptional iframe CSS selector; selector/ref resolve inside it.
refstring
selectorstring
statestring
timeoutnumber

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…

ParameterTypeDescription
expressionstring
frameSelectorstringRun 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…
functionstring
scriptstring
worldstringExecution 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_navigate_back

Navigate back in browser history.

browser_select_option

Select options from a <select> element by CSS selector or aria ref.

ParameterTypeDescription
values *arrayOption values or labels to select.
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
timeoutnumber

browser_handle_dialog

Accept or dismiss a JavaScript dialog (alert / confirm / prompt).

ParameterTypeDescription
accept *booleantrue = accept, false = dismiss
promptTextstringText to enter for prompt dialogs
timeoutnumberMilliseconds to wait when wait=true
waitbooleanWhen 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.

ParameterTypeDescription
paths *arrayLocal file paths to upload.
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
timeoutnumber

browser_network_requests

List captured network requests. Set activeOnly=true for in-flight only.

ParameterTypeDescription
activeOnlyboolean

browser_network_request

Get details for a single network request by stable id from browser_network_requests. Legacy zero-based index is also accepted.

ParameterTypeDescription
detailsbooleanInclude response body preview when true
idstring
indexnumberLegacy 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.

ParameterTypeDescription
height *numberViewport height in pixels
width *numberViewport width in pixels

browser_drag

Drag an element from source to target by CSS selector or aria ref.

ParameterTypeDescription
sourceobject{ selector|ref, frameSelector? }
targetobject{ selector|ref, frameSelector? }
timeoutnumber

browser_fill_form

Fill multiple form fields at once. Each field needs selector or ref, and value.

ParameterTypeDescription
fields *array
timeoutnumber

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

ParameterTypeDescription
script *string
argsarray
worldstringExecution 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.

ParameterTypeDescription
functionstringFunction body/expression to install as the init script, e.g. '() => { window.foo = 1; }'.
scriptstringDeprecated alias for function.

browser_network_state_set

Set network state: pass offline=true to simulate offline, offline=false to restore connectivity.

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

ParameterTypeDescription
url *string
dataRequest body: a string, or an object (sent as JSON).
headersobjectRequest headers as key/value strings.
maxBytesnumberTruncate response body to this many chars. Default 100000.
methodstring
timeoutnumber

browser_get_visible_text

Get the visible text (document.body.innerText) of the active page. Lighter than a full aria snapshot.

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

ParameterTypeDescription
maxLengthnumberTruncate to this many chars. Default 100000.
removeScriptsbooleanRemove script/style/noscript/svg. Default true.
selectorstringLimit 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.)

ParameterTypeDescription
frameSelector *stringCSS selector for the iframe element.
selector *stringCSS selector for the target element inside the iframe.
timeoutnumber

browser_iframe_fill

Shorthand for filling inside an iframe. (Most tools now accept a frameSelector directly — prefer browser_fill with frameSelector.)

ParameterTypeDescription
frameSelector *stringCSS selector for the iframe element.
selector *stringCSS selector for the input inside the iframe.
value *string
timeoutnumber

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.

ParameterTypeDescription
resourceTypesarrayResource types to abort. If omitted, blocks every request matching urlPattern.
urlPatternstringGlob/URL pattern to match. Default **/* (all).

browser_route_mock

Mock matching requests with a canned response (fulfill). Useful for stubbing APIs or bypassing endpoints.

ParameterTypeDescription
urlPattern *stringGlob/URL pattern to match.
bodystringResponse body.
contentTypestringContent-Type, default text/plain.
statusnumberHTTP 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.

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

ParameterTypeDescription
pathstringPath to a storageState JSON file.
stateobjectInline storageState object ({ cookies, origins }).

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.

ParameterTypeDescription
key *string

browser_localstorage_set

Set a localStorage item on the active page's origin.

ParameterTypeDescription
key *string
value *string

browser_localstorage_delete

Delete a localStorage item by key.

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

ParameterTypeDescription
key *string

browser_sessionstorage_set

Set a sessionStorage item on the active page's origin.

ParameterTypeDescription
key *string
value *string

browser_sessionstorage_delete

Delete a sessionStorage item by key.

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

ParameterTypeDescription
rpId *stringRelying-party id, usually the site's effective domain.
idstringBase64url credential id.
includePrivateKeybooleanReturn private key material. Default false.
privateKeystringBase64url PKCS#8 DER private key.
publicKeystringBase64url SPKI DER public key.
userHandlestringBase64url user handle.

browser_passkey_list

List virtual passkeys, optionally filtered by rpId or credential id. Private keys are omitted unless includePrivateKey=true.

ParameterTypeDescription
idstringBase64url credential id.
includePrivateKeybooleanReturn private key material. Default false.
rpIdstring

browser_passkey_delete

Delete one virtual passkey by its base64url credential id.

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

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

ParameterTypeDescription
frameSelectorstringOptional CSS selector for an iframe. When set, selector/ref resolve inside that frame.
labelstringOptional text label shown above the highlight; also used as the key for browser_hide_highlight.
refstringaria-ref from browser_snapshot, for example e12. Provide exactly one of selector or ref.
selectorstringCSS selector. Provide exactly one of selector or ref.
stylestringOptional extra inline CSS for the overlay, e.g. 'outline: 3px dashed lime'.
timeoutnumber

browser_hide_highlight

Remove highlight overlays. Pass label/selector/ref to remove a specific one, or omit all to clear every highlight.

ParameterTypeDescription
labelstringLabel/key used when the highlight was added.
refstringaria ref used when the highlight was added.
selectorstringSelector 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…

ParameterTypeDescription
path *stringOutput file path.
encodingstring'base64' decodes the evaluated string into raw bytes before writing. 'text' (default) writes UTF-8 (JSON-stringifying non-string results).
expressionstring
functionstring
worldstringExecution 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.

ParameterTypeDescription
formatstring
landscapeboolean
pathstringOutput file path. If omitted, returns base64.
printBackgroundbooleanInclude background graphics. Default true.
scalenumberRender scale, default 1.

browser_close

Close the browser session.