Skip to main content
Glama
camoufox-reverse-mcp

camoufox-reverse-mcp

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
osNoOS fingerprint (windows/macos/linux)windows
geoipNoInfer geolocation from proxy IPfalse
proxyNoProxy server URL
headlessNoHeadless modefalse
humanizeNoHumanized mouse movementfalse
block-imagesNoBlock image loadingfalse
block-webrtcNoBlock WebRTCfalse

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

Anti-detection browser MCP server for JavaScript reverse engineering. Uses Camoufox (C++ engine-level fingerprint spoofing) to bypass bot detection while performing JS analysis, debugging, hooking, network interception, and JSVMP bytecode analysis.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}
experimental
{}

Tools

Functions exposed to the LLM to take actions

NameDescription
launch_browserA

Launch the Camoufox anti-detection browser, or attach to a running one.

Leave out any option you do not need to change. It then keeps the value the server was started with (for example --headless), or the default below if the server did not set one. An option passed here wins for this launch.

Args: headless: Run in headless mode (default False). os_type: OS fingerprint - "auto", "windows", "macos", or "linux" (default "auto"). locale: Browser locale (e.g. "zh-CN"). "auto" detects system locale (default "auto"). proxy: Proxy server URL (e.g. "http://127.0.0.1:7890"). humanize: Enable humanized mouse movement. geoip: Auto-infer geolocation from proxy IP. block_images: Block image loading. block_webrtc: Block WebRTC to prevent IP leaks. enable_trace: Enable engine-level property access tracing. Requires camoufox-reverse custom browser build. When enabled, use trace_property_access() to capture DOM access. trace_objects: Optional exact native object-name allowlist (for example ["navigator", "screen", "webgl"]). Empty traces all native sites declared by the selected reverse build. trace_max_events: Per Firefox process/session event cap (1..200000). browser_version: Select one already-installed Camoufox 0.5+ browser without changing its persistent active version. Use a repo-qualified selector such as "official/beta.30" or "whitenightshadow/152.0.4-beta.30-reverse.5". Omit it to preserve the active/default behavior, including Camoufox 0.4.x installations. The selected browser must match the active browser's exact version/build because Camoufox reads shared resources from active. ws_endpoint: Attach to an already-running Camoufox server instead of launching a new browser. Start the server with python -m camoufox server, copy its "Websocket endpoint: ws://127.0.0.1:/" line, and pass that full URL here. When set, all other launch args (os_type/locale/proxy/...) are ignored — fingerprint config is owned by the running server. Start the server with an os fingerprint matching the host for font-metric parity (attach mode cannot inject the host/os font-fallback shim that launch mode does). close_browser() will only disconnect; the server keeps running.

Returns: dict with status, config, and page list.

close_browserA

Close the browser after serializing any native trace transition.

navigateA

Navigate to a URL, with optional hook pre-injection and redirect tracing.

Args: url: Target URL. wait_until: "load", "domcontentloaded", or "networkidle". pre_inject_hooks: Hook preset names to register before navigation. collect_response_chain: Record responses for final_status resolution. clear_network_capture: Clear stale network buffer before navigating.

Returns: dict with url, title, initial_status, final_status, redirect_chain, hooks_injected, reloaded, warnings.

reloadA

Reload the current page, preserving any init scripts.

take_screenshotC

Take a screenshot of the current page or a specific element.

Args: full_page: Capture the entire scrollable page. selector: CSS selector of a specific element to capture.

take_snapshotA

Get a bounded accessibility tree, or a labelled DOM fallback.

Args: timeout_ms: Maximum wait for snapshot collection (1..30000). A hung error-page accessibility query returns an error without restarting the browser or replaying navigation. max_nodes: Maximum retained tree containers (1..5000). Depth is capped at 16 and individual strings at 2000 characters; truncation is explicit.

clickC

Click on a page element.

type_textC

Type text into an input field with realistic keystroke delays.

wait_forA

Wait for an element, a captured network request, or a navigation.

Args: selector: CSS selector to wait for. url_pattern: URL substring (or shell-style glob when it contains *) used by request/navigation modes. timeout: Max wait in milliseconds. mode: Which condition url_pattern means. "auto" (default) matches a captured request when network capture is already running, otherwise falls back to navigation. "request" only matches captured requests and reports a clear hint when nothing arrives, so "the request never fired" is not confused with "the page did not navigate". "navigation" keeps the previous behaviour (page.wait_for_url). after_id: Optional request id; only requests with a larger id match, so an already-captured request cannot satisfy a later wait. poll_interval_ms: Polling interval for request mode.

Returns: dict with status plus mode; request mode also returns the matched request summary (id/url/method/status/ms).

get_page_infoB

Get page metadata plus a zero-based frame list for targeted tools.

reset_browser_stateC

Reset browser residual state after serializing trace transitions.

scriptsA

Script inspection (v0.9.0 unified).

Replaces list_scripts / get_script_source / save_script.

Args: action: "list" — list all loaded scripts (src, type, inline preview) "get" — get full source of one script (requires url; use "inline:" for inline scripts) "save" — save script source to local file (requires url + save_path) url: Script URL or "inline:" (required for "get" and "save"). save_path: Local file path (required for "save").

Returns: For "list": list of script info dicts. For "get": dict with source string. For "save": dict with status, path, size.

search_codeA

Search keyword in loaded scripts (v0.9.0 unified).

Replaces search_code (all scripts) + search_code_in_script (single script).

Args: keyword: The keyword to search for (case-sensitive substring match). script_url: If None, search across ALL loaded scripts. If given, search within that one script only (supports "inline:" for inline scripts). Single-script mode auto-detects minified files and uses character-based context. context_chars: Context window in char mode (default 200 = +/-200 chars). Used when searching single minified scripts. context_lines: Context window in line mode (default 3). max_results: Maximum matches to return (default 200).

Returns: dict with matches, total_matches, mode ("line" | "char"), etc.

evaluate_jsA

Execute an arbitrary JavaScript expression in the page context and return the result.

v1.0.1 fix: correctly handles undefined/null/void/Symbol return values without triggering JSON.parse crashes.

Default auto mode preserves legacy cleaning and smart JSON parsing; it may strip BOM/whitespace and replace lone surrogates. value_raw is not a code-unit-preserving transport. json_ascii returns explicit JSON text before transport/cleaning, preserving JSON string code units. Evaluation is never replayed after a failure.

Args: expression: JavaScript expression. Must be a single expression, not top-level var/let/const/function declarations (Playwright limitation). Wrap in IIFE if needed: (() => { var x = 1; return x; })() await_promise: If True, awaits Promise results (default True). world: "isolated" preserves the existing Playwright execution context. "main" prefers Camoufox's native mw: channel so page globals created by site scripts are visible, with an explicit Firefox window.wrappedJSObject.eval fallback for older/attached servers. frame_url: Optional exact frame URL or shell-style wildcard. frame_name: Optional exact frame name or shell-style wildcard. frame_index: Optional zero-based index from get_page_info().frames. output_file: Write the string result to this path instead of returning it. Use it for page blobs (bytecode, device state, rendered documents): multi-kilobyte values otherwise truncate or flood the conversation. The response carries path/bytes/sha256 and a short preview. output_encoding: "utf8" writes the string as UTF-8; "base64" decodes the string first, for binary payloads. overwrite: Allow replacing an existing output_file. result_format: "auto" (legacy cleanup) or "json_ascii" (ASCII JSON text in value, not parsed/trimmed). json_ascii follows JSON.stringify: tag non-finite numbers/-0/undefined explicitly if their distinction matters; it is not a lossless arbitrary-object graph serializer.

Returns: dict with keys: value - cleaned value (parsed JSON if applicable; None when output_file is used) value_raw - raw string before cleaning (only when cleaning applied) type - "primitive" | "json" | "json_ascii" | "file" | "handle_fallback" | "error" output - (file only) {path, bytes, sha256, encoding} preview - (file only) bounded single-line preview of the string result world - selected execution world frame - selected frame's current snapshot metadata execution_backend - isolated, Camoufox native, or wrappedJSObject warnings - list of applied cleanups, if any hint - (error only) friendly fix suggestion or None

hook_functionA

Hook or trace a function (v0.9.0 unified).

Replaces hook_function + trace_function.

Args: function_path: Full path like "window.encrypt", "XMLHttpRequest.prototype.open", "JSON.stringify". mode: "intercept" — inject custom JS before/after/replace the function. Requires hook_code. (was: hook_function) "trace" — log synchronous returns/throws and optionally args and call stacks. (was: trace_function) hook_code: JS code for "intercept" mode. Context vars: - arguments: original args - __this: the 'this' context - __result: return value (only in position="after") position: For "intercept": "before", "after", or "replace". non_overridable: For "intercept": use Object.defineProperty to lock. persistent: If True, survives page navigation. log_args: For "trace": record arguments (default True). log_return: For "trace": record return values (default True). log_stack: For "trace": record call stacks (default False). max_captures: For "trace": max calls to record (default 50). world: "isolated" (compatible default) or Firefox page "main" world. wait_timeout_ms: How long to wait for a late-bound target. Defaults to 5000 for persistent hooks and 0 for non-persistent hooks. poll_interval_ms: Late-binding polling interval (10..1000ms). watch_assignments: Install a temporary setter on the first missing path segment so assignment-and-immediate-call in one JS task is captured. Defaults to True for persistent hooks and False otherwise. frame_url: Optional exact frame URL or shell-style wildcard. frame_name: Optional exact frame name or shell-style wildcard. frame_index: Optional zero-based index from get_page_info().frames. serialization: For "trace": "json" (default) retains JSON text fields, but executes getters/toJSON and may fall back to String conversion; this can have side effects. "preview" reads no properties of argument, return, or thrown objects and never coerces them: objects/functions are placeholders, symbols omit their description, and undefined, BigInt, NaN, infinities and -0 have string tags. Only the wrapper's own argument array is traversed. Text is truncated at 2000 characters in both modes and is not necessarily complete/parseable JSON.

Trace semantics: Ordinary synchronous calls keep the original receiver, argument values, return/throw identity and one original invocation. Entries retain traceId, callIndex, timestamp, world, frame, args/returnValue and optional stack; outcome is "return" or "throw", with thrownValue for synchronous throws. completion="sync" always: a returned Promise/thenable is only a synchronous return, never an observed settlement (no await or attached handlers). Logging failures do not replace the original result/exception. Calls made by logging/JSON serialization are not recursively traced; real nested calls are. Clearing logs does not reset max_captures or callIndex. Intrinsics are saved at the first trace installation in each realm, so later hooks cannot redirect the logger. Already modified third-party intrinsics cannot be recovered. Preview limits value inspection, not timing/stack/identity visibility of wrappers or page-controlled sinks; optional stack capture may run custom stack formatting. Constructor/new semantics are outside this ordinary-call trace contract.

Returns: dict with status, target, mode.

get_trace_dataC

Retrieve in-page traces and BrowserManager's cross-navigation cache.

The Python-side cache is the authoritative source after reload/navigation. Every new trace entry includes frame metadata (URL, name, best-effort index, and main-frame flag). Trace IDs use installation/call counters, without page randomness. They are local to a realm: frames/reloads may repeat IDs and even complete entries. Merge the two sinks as multisets of full entries, removing only one cached copy per matching live copy. Repetitions within either sink are preserved.

inject_hook_presetA

Inject a pre-built hook into the page main world.

Presets run where page scripts run (v1.10.0; before, they ran in the isolated world and recorded none of the page's own calls). Page code can detect the replaced functions; remove_hooks() restores them in the current document.

Available presets (log location in brackets, read it with evaluate_js("window. || []", world="main")): - "xhr": XMLHttpRequest requests [__mcp_xhr_log]. - "fetch": fetch requests [__mcp_fetch_log]; get_request_initiator also reads its stacks. - "crypto": btoa/atob/JSON.stringify inputs and outputs [__mcp_crypto_log]. - "websocket": WebSocket connections and messages [__mcp_ws_log]. - "debugger_bypass": strip debugger from Function(...) and timers. - "cookie" (alias "cookie_hook"): document.cookie reads/writes [__mcp_cookie_log]. - "runtime_probe": XHR/fetch/canvas/WebGL/navigator/listener calls [__mcp_runtime_log].

Args: preset: One of the above preset names. persistent: True (default) also installs it in every new document, including same-origin iframes; False installs it in the current document only.

Returns: dict with status, preset, world, execution_backend and read_with.

remove_hooksA

Remove installed hooks and restore original objects in-place.

Args: keep_persistent: If True, keep persistent init_scripts registered.

Returns: dict with status, restored_objects, cleared counts.

get_console_logsA

Get console output collected from the page.

Args: level: Filter by log level - "log", "warn", "error", or "info". keyword: Filter logs containing this keyword in the text. clear: If True, clear the log buffer after retrieval.

Returns: List of dicts with level, text, timestamp, and location.

network_captureA

Unified network capture control (v0.9.0).

Replaces start_network_capture / stop_network_capture.

Args: action: "start" — begin capturing network events "stop" — stop capturing (buffer retained) "clear" — clear the capture buffer "status" — return current capture state url_pattern: Glob pattern for "start" (default "**/*" captures all). capture_body: For "start" only; capture response bodies (more memory). max_body_size: For start; retained characters per response, 0..2000000. Playwright still reads the complete response before truncation. wait_timeout_ms: For stop; wait up to 30000ms for captured responses. New requests stop immediately; unfinished work is reported, not replayed. Clear cancels pending work; IDs remain monotonic until browser close.

Returns: dict with action result + current status snapshot.

list_network_requestsA

List captured network requests with optional filters.

Args: url_filter: Substring filter for request URLs. url_contains_domain: Host/subdomain boundary filter (e.g. "example.com"). method: HTTP method filter (e.g. "GET", "POST"). resource_type: Resource type filter (e.g. "xhr", "fetch", "script", "document"). status_code: HTTP status code filter. limit: Optional page size (1..2000); omitted preserves the full list. after_id: Return IDs greater than this cursor, in capture order. Check network_capture(status).dropped_requests for lost history.

Returns: List of request summaries. Legacy size is retained body characters; size_unit is characters and body_bytes is the retained decoded entity byte count when encoding is known. Not compressed wire bytes.

``url`` is a preview capped at URL_PREVIEW_CHARS (200). When it is cut,
the value ends with "…" and ``url_truncated`` is True while
``url_length`` reports the real length. Never read a query parameter,
signature or token out of a truncated preview: call
get_network_request(request_id=...) for the complete URL first.
get_network_requestA

Get full details of a specific captured network request.

Args: request_id: The ID of the request (from list_network_requests). include_body: Include response body (default False). include_headers: Include request/response headers (default True). max_body_size: Max chars of body when include_body=True. Pass -1 for unlimited.

Returns: dict with request and response details.

extract_scriptA

Pull a script string out of a captured response and (optionally) save it.

Use this for SDK code that reaches the page through fetch + eval instead of a <script src> tag: such code has no script resource, so source search cannot see it and route rewriting cannot reach it. Extract it here, patch it locally, then serve the patched file back with intercept_request(action="mock", mock_response={"body_file": ...}).

Args: request_id: Captured request to read response_body from. Requires the body to have been captured (network_capture(capture_body=True)). body: Raw response text to use instead of a captured request (mutually exclusive with request_id). json_path: Dotted/bracketed JSON path to the script string, e.g. data.data or items[0].script. Pass an empty string when the body itself is the script. output_file: Write the extracted script here (UTF-8, regular file only). overwrite: Allow replacing an existing output_file. allow_partial: Allow extracting from a response body truncated by network_capture(max_body_size=...) (default False). preview_chars: Preview length in the response (never the whole script). max_inline_chars: Refuse to inline a script larger than this; ask for output_file instead.

Returns: dict with chars, sha256, preview, partial, and, when written, output = {path, bytes, sha256, encoding, chars}.

get_request_initiatorA

Get the JS call stack that initiated a network request.

Returns a URL-matched hook stack as an investigation lead, not exact request attribution. Repeated/concurrent URLs can match a different invocation; corroborate with captured inputs. Requires inject_hook_preset("xhr"/"fetch") BEFORE navigating.

KNOWN LIMITATIONS (v0.8.1+):

  1. For requests modified by an interceptor registered BEFORE MCP's hooks (e.g. SDKs loaded via sync ), the initiator will be the interceptor's call, not the original business code. Workaround: use instrumentation(action='reload').

  2. For fetch on Firefox, Playwright-native initiator is often null. Requires inject_hook_preset('fetch', persistent=True).

Args: request_id: The ID of the request.

Returns: dict with url, initiator_stack, source, diagnostics and match_confidence. match_confidence is heuristic or unavailable; it never asserts exact identity.

intercept_requestA

Intercept network requests matching a pattern.

Args: url_pattern: URL glob pattern (e.g. "**/api/login*"). action: "log", "block", "modify", "mock", or "stop" (unroute). modify_headers: Headers to add/override (action="modify"). modify_body: Request body replacement (action="modify"). mock_response: Dict for action="mock": "status", "headers", and at most one body source — "body" (inline text) or "body_file" (regular UTF-8 file up to 10 MiB; relative paths resolve against the server working directory). Passing both is an error. The file is re-read on every request in a worker thread, so editing a patched script and reloading the page picks up changes immediately; a missing or unreadable file returns a readable error from the tool call (and aborts that request during serving). When "headers" is omitted, body_file infers the content type from its suffix (.js/.json/.html/.css/...). Security note: fulfilled responses are readable by scripts in the matching page/origin — only point body_file at intended mock or instrumented assets, never at credentials or private local files.

Returns: dict with the interception status; for action="mock" with body_file it also reports the resolved absolute path and its current byte size.

export_network_captureA

Export a versioned JSON snapshot of this manager's retained capture.

Args: save_path: New local JSON path; existing files are never overwritten. include_body: Include captured request/response bodies only together with include_sensitive=True. Does not fetch or replay requests. include_sensitive: Opt in to original headers, query values and bodies. Default masks all header/query values, removes URL credentials and fragments, and omits bodies. URL paths are retained: this is not full anonymization. Keep original captures out of public repositories. url_filter: Optional URL substring filter.

Returns: Path, count, redaction mode and capture status including pending/dropped work. For a settled snapshot call network_capture(stop, wait_timeout_ms).

compare_network_requestsA

Compare 2..10 captured requests without issuing requests or launching a browser.

Args: request_ids: Distinct IDs from list_network_requests in this capture. include_headers: Compare available request headers; incompleteness warns. include_body: Compare exact request body text plus top-level JSON fields. max_value_chars: Preview characters per value (0..2000); digests always cover full values in canonical JSON. Each string also includes raw_utf8 byte length/SHA-256; use that for exact body byte checks. Results may contain credentials; keep them private. max_fields: Maximum changed rows and constant field names (1..200).

Returns: Changed fields, constant names and completeness limits. Query duplicates, value order and raw URL encoding are preserved. Missing differs from null. A varying field is evidence, not proof that it participates in signing.

save_response_bodyA

Save captured response bytes (JS/WASM/JSON/binary) without refetch/replay.

Args: request_id: A captured ID with a completed body (capture_body=True). save_path: New file path. Never overwrites existing files. allow_partial: Explicitly permit a truncated body; default rejects it.

Returns: Path, saved byte length, SHA-256 and partial flag. Bytes are Playwright's decoded HTTP response body (not original compression/wire bytes). If the body was missing or truncated, increase the capture limit and collect a new sample intentionally; this tool never triggers a new request.

cookiesA

Cookie management (v0.9.0 unified).

Replaces get_cookies / set_cookies / delete_cookies.

Args: action: "get" — return cookies (optionally filtered by url, domain, and/or name) "header" — build a ready-to-use Cookie: header value (deduplicated by name) "set" — set cookies (requires cookies_list: [{name, value, domain, ...}]) "delete" — delete cookies (filter by name and/or domain; no filter = clear all) domain: Host or parent domain for get/header/delete (boundary match, includes subdomains). With name, both filters must match. No filters on delete clears all cookies. cookies_list: List of cookie dicts for "set". name: Optional exact cookie name filter for get/header/delete. url: Optional request URL for get/header so Playwright applies RFC 6265 domain, path, Secure, and expiry matching. When action="header" is called without url or domain on an http(s) page, defaults to the active page URL. output_file: For action="header", write the Cookie header to this file (mode 0600) and omit the raw header string from the inline tool response. overwrite: Allow replacing an existing output_file.

Returns: For "get": list of cookie dicts. For "header": {"action", "count", "names", "header", "domain", "url"} plus "output": {path, bytes, sha256, ...} (with "header": None) when output_file is used. For "set"/"delete": dict with status and count.

get_storageA

Get the contents of localStorage or sessionStorage.

Args: storage_type: "local" for localStorage, "session" for sessionStorage.

Returns: dict with all key-value pairs in the storage.

export_stateA

Export the complete browser state (cookies + storage) to a JSON file.

Args: save_path: Local file path to save the state JSON.

Returns: dict with status and the save path.

import_stateA

Import browser state from a JSON file by creating a new context.

Args: state_path: Path to the state JSON file (exported by export_state).

Returns: dict with status and the new context name.

hook_jsvmp_interpreterA

Install a JSVMP runtime probe in the page main world.

The probe runs where page scripts run, so their property reads and calls are recorded. Read the log with evaluate_js("window.__mcp_jsvmp_log || []", world="main"); the default isolated world cannot see it. remove_hooks() restores what the probe replaced. Each event has a seq; window.__mcp_jsvmp_meta.dropped counts events lost to max_entries. Same-origin frames (including about:blank iframes created and removed by the page) log into the top frame's log with frame_url/frame_depth. The result's coverage lists what this probe records and what it cannot see: a missing entry means "not observed", not "not called".

mode="proxy" wraps Function.prototype.apply/call/bind, Reflect.*, Date.now, performance.now and Math.random, and puts Proxies on globals (navigator, screen, etc.). Page code can detect all of this, so RS/AK-style signature-based anti-bot will notice; use instrumentation(action='install') (source-level rewrite) for those. mode="transparent" only replaces getters on prototypes (Navigator, Screen, Document, ...). It changes less, but the getters are no longer the originals: Function.prototype.toString.call(getter) shows JS source.

IMPORTANT — timing for sync-loaded SDKs (e.g. webmssdk): JSVMP interpreters capture native references at startup via closures. If you install hooks AFTER the SDK has loaded, the SDK's closures already hold the original (un-hooked) references — your hooks will never fire. You MUST install hooks BEFORE navigate(): 1. launch_browser() 2. hook_jsvmp_interpreter(mode='transparent', persistent=True) 3. navigate("https://www.douyin.com/...") If already navigated, call instrumentation(action='reload') after installing hooks to force a page reload with hooks active.

Args: script_url: Target script URL substring for stack filtering. persistent: Survive navigation (default True). mode: "proxy" (full coverage, detectable) or "transparent" (replaces getters only). track_calls, track_props, track_reflect: Only for mode="proxy". proxy_objects: Objects to proxy (default: navigator, screen, etc.). max_entries: Log buffer cap (default 10000).

Returns: dict with status, mode, world, read_with and install details.

compare_envA

Collect the browser environment for comparison with Node.js/jsdom.

Values are read in the isolated world, i.e. what the browser provides without page-script patches.

Without output_path it returns a summary: navigator and screen basics, canvas (toDataURL hash, measureText), WebGL (vendor/renderer, extension count), audio (OfflineAudioContext fingerprint, sample rate), timing and misc, plus properties evaluated as expressions.

With output_path it writes an environment bundle (JSON) and returns its path, size and a short summary: every Navigator/Screen getter with plugins and mimeTypes, window metrics and global names, getComputedStyle names and values, CSS declaration prototype names with enumerable flags and the for-in count, the full canvas toDataURL, WebGL parameters/extensions/ shader precisions, audio, storage keys with value lengths (never values, never cookie values), a hidden about:blank iframe compared with the top window (added and removed again; a MutationObserver sees it), timing and Intl. Apply it in Node/jsdom with the skill's env-bundle template.

Args: properties: Extra expressions to evaluate, e.g. ["navigator.oscpu"]. output_path: File for the full bundle; omit for the summary. sections: Limit the bundle to these sections (default all): navigator, screen, window, css, canvas, webgl, audio, storage, iframe, timing.

Returns: dict with categorized environment data, or the bundle's path/summary.

instrumentationA

JSVMP source-level instrumentation (v0.9.0 unified).

Replaces instrument_jsvmp_source / get_instrumentation_log /
stop_instrumentation / reload_with_hooks.

Args:
    action:
      "install" — register route + AST/regex rewrite on matched scripts.
                  Requires url_pattern. (was: instrument_jsvmp_source)
      "log"     — fetch accumulated tap events from instrumented code.
                  (was: get_instrumentation_log)
      "stop"    — unregister instrumentation route.
                  (was: stop_instrumentation)
      "reload"  — reload page so persistent hooks fire before page JS.
                  (was: reload_with_hooks)
      "status"  — show active instrumentations, their options and the
                  files passed through unchanged, with reasons.
                  (was: get_instrumentation_status)
      "rewrite_source" — apply the same rewrite to local JS without a
                  browser: give `source` (text) or `source_path`, and
                  `output_path` for anything larger than ~100KB. The
                  output runs in Node/vm/jsdom too; events collect in
                  globalThis.__mcp_vmp_log. No size limit applies.
    url_pattern: For "install"/"stop" — glob pattern matching VMP script URLs.
    mode: For "install"/"rewrite_source" — "ast" (esprima then local
        bundled Acorn) or "regex" (conservative whole-program subset;
        unsupported input skipped).
    tag: For "install"/"rewrite_source"/"log" — group identifier.
    rewrite_member_access: tap obj[key] reads (default True). Start here.
    rewrite_calls: tap fn(args) and obj.m(args) calls (default False since
        v1.10.0). Turn it on only when call events are needed: call taps
        add helper frames, so callee.caller reads null and the maximum
        recursion depth drops, which fingerprinting code can notice.
    tap_stage_calls: rewrite the flattened-VMP dispatcher shape
        `return fn.apply(this, [<int>].concat(Array.prototype.slice
        .call(arguments)))` into per-state `tap_stage` events (state id `p`,
        argc, first args previews, return preview), pushed when the state
        returns. Events recorded while a state runs carry it as `stage`.
        This is a literal match, so it also works when the rest of the
        file is not parseable (status then shows "(stage taps only)"), and
        it is independent of `mode`/`filter_*`.
    inject: source-level regex insertion, independent of `mode` and usable
        together with `tap_stage_calls`/`filter_*`. A list of
        `{"find": <regex>, "before": <js>, "after": <js>, "group": <name>}`:
        every match of `find` (re.MULTILINE) gets `before` inserted at the
        match start and/or `after` at the match end. `$1..$99`/`$0` in the
        snippets expand to capture groups, `$$` is a literal `$`.
        Four safety layers keep injected code from breaking syntax:
        (1) each snippet is wrapped into a complete statement (`;` guard on
        both ends, or `;

... ;when it contains newlines or//); (2) insertions landing inside string, template, comment or regex literals are skipped individually (skipped_insertions/ literal_skips); (3) a beforeinsert on aswitch case :/default: label is automatically shifted past that label's colon (label_shift), so it executes when jumping to that state and never lands before the first case; (4) when the original source parses (esprima or local bundled Acorn for modern ES2025/module syntax), the injected output is re-parsed and any group that would break syntax is rolled back individually (inject.skipped_groups, reason "would break syntax"). Note: single-line inserts add zero newlines (lines_added == 0), though mode="ast"prepends the instrumentation runtime header at the top of the file (onlymode="regex"with zero member rewrites keeps exact 1-based line numbers). Per-group inserted counts come back ininject.groups[].insertions (raw regex matches in.matches) and accumulate across newly rewritten scripts in status/logasinject_hits. The injected code runs in the page main world; read the globals it fills with evaluate_js(expression, world="main"). inject_validate: default True — run the parse validation and per-group fallback described above. False skips the AST re-parse check while keeping the ;statement wrapper, literal-region skip guard, and case/defaultlabel shift active. include_source_site: attach a stable site_id to tap events, plus an original-source range map in the log response. Default False. max_rewrites: hard cap on rewrites per file; status lists capped files. fallback_on_error: try conservative regex on AST failure only without property/object filters; otherwise pass through unchanged. ignore_csp: For "install" — skip CSP pre-flight check. clear_log: For "reload" — clear JSVMP logs before reload. wait_until: For "reload" — "load" / "domcontentloaded" / "networkidle". tag_filter: For "log" — filter by tag. type_filter: For "log" — "tap_get", "tap_call", "tap_method", "tap_call_err", "tap_stage", "tap_stage_break". key_filter: For "log" — substring match on property/method name. after_seq: For "log" — only events with seq > after_seq, oldest first; page with the returned next_after_seq. seq_window: For "log" — [start, end], events with start <= seq <= end. stage: For "log" — events recorded while dispatcher statestageran, plus that state's own tap_stage events. limit: For "log" — max entries: the most recent ones, or the first ones when after_seq/seq_window is set. clear: For "log" — clear log after retrieval in the selected main world. frame_url: For log; select a target frame by URL pattern. frame_name: For log; select a target frame by name. frame_index: For log; current frame snapshot index, not a persistent identity. Source scripts run in the main world; logs are always read there. Same-origin child frames log into the top frame's log with frame_url/frame_depth, so a removed iframe keeps its events. filter_property_names: For AST — only rewrite reads/methods of these property names (e.g. ['userAgent', 'platform', 'webdriver']). filter_object_names: For AST — only rewrite when the static base object path matches (e.g. ['navigator', 'this.bytecode']). Dynamic object identity is not inferred. Regex mode rejects nonempty filters. max_file_size: For "install" — files larger than this (bytes) trigger on_oversized behavior. Default 2,000,000. on_oversized: For "install" — "selective" (require filters), "skip", or "force" (full rewrite anyway). Default "selective". source: For "rewrite_source" — JS text to rewrite. source_path: For "rewrite_source" — local JS file to rewrite. output_path: For "rewrite_source" — where to write the rewritten JS (must differ from source_path); with include_source_site the site map goes to<output_path>.sites.json`.

Returns:
    dict with action-specific results. "log" also returns seq, dropped
    (events lost to the 20000-entry cap) and the options each install used.

IMPORTANT — timing for sync-loaded scripts (e.g. webmssdk):
    Route interception only catches requests made AFTER the route is
    registered. For scripts loaded via <script src> during page load,
    you MUST call instrumentation(action='install') BEFORE navigate().
    Pattern:
      1. launch_browser()
      2. instrumentation(action='install', url_pattern='**/webmssdk*')
      3. navigate("https://www.douyin.com/...")
    If called after navigate, use instrumentation(action='reload') to
    re-trigger page load with routes active.
check_environmentA

One-stop self-check of MCP environment, dependencies, and browser state.

v1.0.0: session-related checks removed (session mechanism removed). Checks MCP version, critical dependencies (esprima, playwright), browser state (residuals, captures).

Returns: dict with sections: mcp, deps, browser, overall_ok, recommendations.

verify_signer_offlineA

Verify a signer against explicit expected values without sending requests.

Args: signer_code: JS expression evaluating to a function receiving sample.input and returning an object. Async functions are supported. Only run code you intend to execute locally; Node vm is not a security boundary. samples: Non-empty list (up to 1000) of {id?, input: object, expected: object}. Each expected object must contain at least one comparison key. compare_params: Optional non-empty list of expected keys. Missing keys are invalid input; missing computed keys fail even if expected is null. runtime: "browser" preserves the current-page default. "node" runs an independent process without launching a browser, supports require of crypto/node:crypto, and needs Node.js on PATH. No runtime fallback. timeout_ms: Node process deadline (1..120000); also the maximum wait for the browser evaluation. A browser timeout does not undo/stop effects.

Returns: total_samples, passed, failed, pass_rate, first_divergence and details. Invalid input returns error before any signer code is executed.

trace_property_accessB

Control/query the current Gecko native PropertyTracer run.

action supports capture, start, stop, query, clear, and status. Results can use summary, timeline, sequence, or search views and optional object, kind, site, and keyword filters. collect_values is a safe post-trace snapshot, not an event-time value capture.

list_trace_filesC

List all trace files on disk (for post-hoc analysis).

Returns: dict with traces_dir, total file count, and file details.

query_trace_fileC

Query a specific historical trace file (post-hoc analysis).

Args: file_path: Path to the .jsonl trace file. mode: Same as trace_property_access (summary/timeline/sequence/search). filter_object: Filter by object name. search_query: Filter by search string. limit: Max events for sequence mode. bucket_ms: Bucket size for timeline mode.

stage_breakA

Per-state deep capture for instrumentation(tap_stage_calls=True).

A stage tap only previews the first arguments. When one state has to be inspected properly, arm a break for that state id: every hit then records a bounded deep snapshot of the arguments (and optionally the return value and a filtered call stack) as a tap_stage_break event.

Armed states stay armed for this MCP session until "clear": the live page is updated at once, and every instrumented script served afterwards carries the armed set, so states that run while a page loads are captured after a reload. The limit counts hits per page load. Snapshots read own data properties only and report getters as {"__t": "accessor"} without calling them; a Proxy argument still sees its ownKeys/getOwnPropertyDescriptor traps.

Args: action: "set" arm one state, "clear" disarm (all when p is omitted), "list" show armed states and their hit counters. p: Dispatcher state id (the integer from tap_stage events). capture: "args_only" | "args_ret" (default) | "args_ret_stack". limit: Maximum recorded hits, 0 means unlimited (default 0). depth: Snapshot depth for nested objects/arrays (1-5, default 2). max_items: Maximum keys/elements kept per object/array (1-500, default 50).

Returns: dict with the states armed for later loads (session_armed), the live page's armed set and hit counters, and whether the instrumentation runtime is present on the page.

trace_sessionA

Record a Playwright trace of the current browser context.

Firefox has no CDP, so there is no pause/step debugger here. A trace is the supported way to get a replayable record: DOM snapshots, network activity, console output and source locations, packaged as a .zip for trace.playwright.dev or playwright show-trace.

Args: action: "start" begin recording, "stop" write the archive, "status" report whether a recording is active. screenshots: Include screenshots in the trace (default True). snapshots: Include DOM snapshots (default True). sources: Include source files (default True). path: Destination .zip for action="stop"; defaults to a temp file.

Returns: dict with the recording state, and on stop the archive path and size.

rdp_debuggerA

Firefox 原生 RDP 调试器:断点、单步、调用栈、作用域、暂停中求值。

camoufox 是 Firefox,Playwright 走 Juggler 没有 CDP;这个工具直接开 RDP (-start-debugger-server)把调试能力补齐。启动的浏览器继承服务端配置 (指纹 / 代理 / headless / os / locale / browser_version),只额外加调试端口与 RDP pref。

安全:端口没有认证,开端口必须先打开 devtools.chrome.enabled,也就是连上端口 就能用当前系统用户身份在浏览器主进程执行任意代码;同机其他用户也能连 127.0.0.1。默认端口是随机的空闲端口,只监听 loopback。

action: launch 启动带调试端口的浏览器(随机端口;已有会话会先关掉;继承服务端配置) attach 连到已在运行的调试端口(需要 port 或 unix_socket) enable listTabs → getTarget → threadActor,attach 线程并 detach 旧 target sources 列出脚本(url_substr 过滤;含 sourceStartLine/sourceLength) source 取脚本全文(longString 分片按 UTF-16 码元推进;超长显式截断) breakable_lines 某个脚本的可断行号 breakable_positions 某脚本/某一行的可停位置(columns_0based / columns_1based) set_breakpoint 下断点(url_pattern + find 正则定位,或 source_url 走 sourceUrl、 source 走 sourceId;列号 1-based 自动吸附) remove_breakpoint 删行断点(按当初下发的 location 精确删除;remove_all 清空) wait_paused 等下一次命中(只接受 resume/step/interrupt 之后新到的 paused) frames 当前暂停的完整调用栈(出错时返回 {"error": ...}) scopes 某帧的递归作用域链与 bindings(需要 frame_actor) evaluate 求值:给了 frame_actor 就在该暂停帧内求值(能读局部变量) step 单步 over / into / out resume 继续运行 interrupt 不等断点直接暂停(on_next=true 暂停在下一个语句) reload 刷新并重建会话 + 重下此前全部断点(先 detach 旧 target; url_pattern+find 的断点会重新 sources() → 重算偏移 → 重下) xhr_breakpoint 在请求发出前暂停(path / method;remove=true 移除) status 会话状态 close 结束会话并关闭本次启动的浏览器

Args: action: 见上。 port: RDP 端口。0(默认)= launch 时随机选空闲端口;attach 必须给具体端口。 url: launch 时打开的页面。 executable: 自定义 Firefox/camoufox 路径;默认用 camoufox 激活版本(与 launch_browser 一致)。 wait_page: launch 后等页面开始加载的秒数上限;reload 时是新会话的最长等待。 url_substr: 选标签页 / 过滤脚本的 URL 子串。enable 时匹配不到会报错并列出可用标签页。 target_type: enable 的 watcher 兜底目标类型(frame/process/worker)。 line: 断点行号,1-based;坐标就是 breakable_lines/breakable_positions 报出来的那套。 column: 断点列号,1-based(Error.stack / DevTools 界面习惯),会吸附到最近可停列。 condition: 断点条件表达式,如 i === 3。 frame_actor: 栈帧 actor(scopes/evaluate/step/resume 用)。 expression: evaluate 的 JS 表达式。 direction: step 方向 over / into / out(写错会报错,不会 KeyError)。 timeout_ms: wait_paused / interrupt / evaluate 的超时毫秒。 path: xhr_breakpoint 的 URL 子串,空表示任意请求。 method: xhr_breakpoint 的 HTTP 方法,"ANY" 表示全部;"remove" 视为移除。 on_next: interrupt 是否暂停在下一个语句(发送字符串 "onNext")。 require_frame: wait_paused 是否要求带 frame(interrupt 空闲暂停时 frame 可能为 null)。 save_path: source 落盘路径。 max_chars: source/evaluate 最多取多少字符(UTF-16 码元计,超过会显式提示)。 max_items: sources / breakable_lines 返回条数上限。 source: source actor(set_breakpoint 用它走 sourceId,可断 eval / new Function)。 source_url: 精确 URL(set_breakpoint 用它走 sourceUrl,内联脚本/导航后都能挂上)。 url_pattern: URL glob(如 **/vm-bundle*.js*),替代 source / source_url。 适合 URL 带随机查询参数(每次请求都变)的目标;sources / source / breakable_* / set_breakpoint / remove_breakpoint 都接受它。 find: 正则,配合 url_pattern:在脚本里定位第 occurrence 个匹配,内部把字符偏移 换算成 line/column(单行 270KB 压缩脚本 = 1 行 + 一个大列号)。断点记录里 同时保存 url_pattern/find/occurrence,reload / 导航重建 thread 后自动 重新 sources() → 重算 → 重下;新脚本里正则不再命中时进 reapply_failed({"pattern":..., "reason": "regex not found"})。 occurrence: find 的第几个匹配,默认 1。 remove_all: remove_breakpoint / xhr_breakpoint 里清空所有已记录断点。 remove: xhr_breakpoint 用它移除(比 method="remove" 更明确)。 unix_socket: macOS/Linux 用 0700 临时目录里的 Unix socket 代替 TCP 端口。 socket_path: attach 时连已有的 Unix socket 路径(取自 launch 返回的 unix_socket)。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

B3.2/5.0

Scored across 43 tools

Disambiguation4/5

Most tools have clearly distinct roles, but the set contains several overlapping hooking/instrumentation tools: hook_function, inject_hook_preset, hook_jsvmp_interpreter, and instrumentation all manipulate page code in different ways, and an agent must read carefully to pick the right one. Trace-related tools (trace_property_access, trace_session, get_trace_data, query_trace_file) also share a name space but are differentiated by their descriptions. Overall mostly distinct with a few confusable clusters.

Naming Consistency3/5

All names are snake_case, but the convention mixes verb_noun names (get_network_request, search_code, take_screenshot) with bare noun or action-unified names (cookies, scripts, instrumentation, network_capture, trace_session). This is readable and intentional, but not a single predictable verb_noun pattern throughout.

Tool Count2/5

43 tools is heavy for a single MCP server, well above the 16–25 borderline range and into the 'too many' category. The domain is complex and each tool is specialized, but the surface is large enough to burden selection and discovery.

Completeness4/5

The server covers browser lifecycle, navigation, network capture/interception, script analysis, hooking, storage, state export/import, screenshots, tracing, and an RDP debugger, which is a deep lifecycle surface for reverse-engineering work. Minor UI interaction gaps (e.g. explicit key press, hover, select option) exist but do not block the core workflows.

Maintenance

ActivityMaintained
ResponsivenessUsually handled