WhiteNightShadow/camoufox-reverse-mcp
🔧 反检测浏览器 MCP Server | 39 个 JS 逆向工具 + C++ 引擎层 JSVMP 指纹追踪
858d29c63788camoufox-reverse-mcp1.12.0 in pyproject.tomlPaths from tool input into commands, SQL, files and URLs
How much power the tools give an agent over the machine
Hidden instructions and poisoning in text for the model
Known vulnerabilities in the packages the server uses
How the server reads credentials and where they can go
Whether the tools do only what their descriptions say
How far the analysis went
The scanner traces each tool from its input to the operations its code performs, and here it could not follow every path. Code Safety is shown as partly traced instead of a score: no finding there is not a clean result. The score of Capability Exposure counts only what it could follow.
- In 65 places a tool's input is handed to a function whose name matches several definitions in the code; the scanner could not tell which one runs, so it stopped there
- 4 source files could be read only in part
- Supply Chain: the dependency files state no exact versions the scanner could check, so it has no number
- 1 tool, prompt or resource registered only in the repository's tests is not counted on this page
Top risks in plain words
- HIGHTools
compare_env,export_network_capture,export_state,query_trace_fileand 3 more read or write any file path by design: an agent steered by prompt injection can use them that way.
How to use it safely
Practical steps from what we found in this server. They lower the risk; they do not replace a review of the code.
- Give it only the folder it needs
compare_env,export_network_capture,export_state,query_trace_fileand 3 more can read or write any file path. Mount a single project folder, read-only where you can. - Turn off the tools you do not use
Most MCP clients let you disable single tools. If you do not need
compare_env,export_network_capture,export_stateand 4 more, switch them off. - Keep confirmations on
Leave your MCP client's confirmation prompt on for tools that change files, run commands or send data.
What its tools can do on your machine
The server offers 43 tools. When an AI agent calls them, this is what their code can do on the machine where the server runs, as traced in the source. Tools that call code the scanner could not follow may do more.
check_environment, compare_env, export_network_capture, hook_jsvmp_interpreter, import_state, inject_hook_preset and 7 moreNo tool was seen to: start other programs on the machine; connect to the internet or other hosts; read passwords, tokens or keys; read environment variables; touch sensitive locations.
Where its requests and secrets go
Read from the names along each tool's calls, not from a run: what the code says, not every address it may reach at run time.
The literal addresses the tools' requests name.
- None: no request names a fixed host.
Constants or settings that start an address; the value comes from configuration.
- None seen.
Credential-like environment variables. Give the server a key with the least access it needs.
- None: no credential-like variable is read by the tools.
Text it brings in from outside
Text that reaches the model from outside: an instruction hidden in it can steer the agent (prompt injection). Treat what these tools return as data, not as orders.
- files13 tools · check_environment, compare_env, export_network_capture +10
Tool annotations
No tool declares MCP annotations (readOnlyHint, destructiveHint and the rest). Clients use them to decide what to confirm; directories such as Anthropic's and OpenAI's ask for them.
Tools, prompts and resources (43: 43 tools)
Open a row for its full description. Chips show what its code can reach, and which risky capability its own description declares.
compare_envtool Collect the browser environment for comparison with Node.js/jsdom.Filesoutside textReads/writes files
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.export_network_capturetool Export a versioned JSON snapshot of this manager's retained capture.Filesoutside textReads/writes files
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).export_statetool Export the complete browser state (cookies + storage) to a JSON file.Reads/writes files
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.query_trace_filetool Query a specific historical trace file (post-hoc analysis).Filesoutside textReads/writes files
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.save_response_bodytool Save captured response bytes (JS/WASM/JSON/binary) without refetch/replay.Filesoutside textReads/writes files
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.scriptstool Script inspection (v0.9.0 unified).Filesoutside textReads/writes files
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:<index>" for inline scripts)
"save" — save script source to local file (requires url + save_path)
url: Script URL or "inline:<index>" (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.trace_sessiontool Record a Playwright trace of the current browser context.Reads/writes files
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.analyze_cookie_sourcestool Attribute every observed cookie to its source (HTTP header vs JS).
Attribute every observed cookie to its source (HTTP header vs JS).
Combines:
- Captured network responses' Set-Cookie headers
(requires start_network_capture was active)
- document.cookie write log from cookie_hook
(requires cookie_hook.js was injected)
- Currently-present cookies via page.context.cookies()
Args:
name_filter: Only return cookies with this substring in name.
Returns:
dict mapping cookie_name -> {
sources: ["http_set_cookie" | "js_document_cookie"],
first_set_ts: ms timestamp of first observation,
http_response_urls: [urls that sent Set-Cookie for this name],
js_stacks: [JS stack traces that wrote this cookie],
current_value: present value in the cookie jar,
}check_environmenttool One-stop self-check of MCP environment, dependencies, and browser state.Filesoutside text
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.clicktool Click on a page element.
Click on a page element.
close_browsertool Close the browser after serializing any native trace transition.
Close the browser after serializing any native trace transition.
compare_network_requeststool Compare 2..10 captured requests without issuing requests or launching a browser.
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.cookiestool Cookie management (v0.9.0 unified).
Cookie management (v0.9.0 unified).
Replaces get_cookies / set_cookies / delete_cookies.
Args:
action:
"get" — return cookies (optionally filtered by domain)
"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/delete (boundary match, includes subdomains).
With name, both filters must match. No filters deletes all cookies.
cookies_list: List of cookie dicts for "set".
name: Cookie name filter for "delete".
Returns:
For "get": list of cookie dicts.
For "set"/"delete": dict with status and count.evaluate_jstool Execute an arbitrary JavaScript expression in the page context and return the result.
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.
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)
value_raw - raw string before cleaning (only when cleaning applied)
type - "primitive" | "json" | "handle_fallback" | "error"
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 Noneget_console_logstool Get console output collected from the page.
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.get_network_requesttool Get full details of a specific captured network request.
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.get_page_infotool Get page metadata plus a zero-based frame list for targeted tools.
Get page metadata plus a zero-based frame list for targeted tools.
get_request_initiatortool Get the JS call stack that initiated a network request.
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 <script>), 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.get_storagetool Get the contents of localStorage or sessionStorage.
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.get_trace_datatool Retrieve in-page traces and BrowserManager's cross-navigation cache.
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.hook_functiontool Hook or trace a function (v0.9.0 unified).
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.hook_jsvmp_interpretertool Install a JSVMP runtime probe in the page main world.Filesoutside text
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.import_statetool Import browser state from a JSON file by creating a new context.Filesoutside text
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.inject_hook_presettool Inject a pre-built hook into the page main world.Filesoutside text
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.<name> || []", 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.instrumentationtool JSVMP source-level instrumentation (v0.9.0 unified).Filesoutside text
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 `;\n...\n;` when it contains newlines or `//`);
(2) insertions landing inside string, template, comment or regex
literals are skipped individually (`skipped_insertions` /
`literal_skips`);
(3) a `before` insert on a `switch` `case <expr>:` / `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 (only `mode="regex"` with zero member rewrites
keeps exact 1-based line numbers).
Per-group inserted counts come back in `inject.groups[].insertions`
(raw regex matches in `.matches`) and accumulate across newly
rewritten scripts in `status`/`log` as `inject_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`/`default` label 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 state `stage` ran,
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.intercept_requesttool Intercept network requests matching a pattern.
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.launch_browsertool Launch the Camoufox anti-detection browser, or attach to a running one.
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:<port>/<guid>" 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.list_network_requeststool List captured network requests with optional filters.
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.list_trace_filestool List all trace files on disk (for post-hoc analysis).
List all trace files on disk (for post-hoc analysis).
Returns:
dict with traces_dir, total file count, and file details.navigatetool Navigate to a URL, with optional hook pre-injection and redirect tracing.Filesoutside text
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.network_capturetool Unified network capture control (v0.9.0).
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.rdp_debuggertool Firefox 原生 RDP 调试器:断点、单步、调用栈、作用域、暂停中求值。
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)。reloadtool Reload the current page, preserving any init scripts.
Reload the current page, preserving any init scripts.
remove_hookstool Remove installed hooks and restore original objects in-place.
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.reset_browser_statetool Reset browser residual state after serializing trace transitions.Filesoutside text
Reset browser residual state after serializing trace transitions.
search_codetool Search keyword in loaded scripts (v0.9.0 unified).
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:<index>" 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.stage_breaktool Per-state deep capture for `instrumentation(tap_stage_calls=True)`.
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.take_screenshottool Take a screenshot of the current page or a specific element.
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_snapshottool Get a bounded accessibility tree, or a labelled DOM fallback.
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.trace_property_accesstool Control/query the current Gecko native PropertyTracer run.Filesoutside text
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.type_texttool Type text into an input field with realistic keystroke delays.
Type text into an input field with realistic keystroke delays.
verify_signer_offlinetool Verify a signer against explicit expected values without sending requests.
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.wait_fortool Wait for an element to appear or a network request matching a URL pattern.
Wait for an element to appear or a network request matching a URL pattern.
Text the model reads (43)
Every tool, prompt and resource description as written in the code: the model sees all of it, the user usually does not.
analyze_cookie_sources tool
Attribute every observed cookie to its source (HTTP header vs JS).
Combines:
- Captured network responses' Set-Cookie headers
(requires start_network_capture was active)
- document.cookie write log from cookie_hook
(requires cookie_hook.js was injected)
- Currently-present cookies via page.context.cookies()
Args:
name_filter: Only return cookies with this substring in name.
Returns:
dict mapping cookie_name -> {
sources: ["http_set_cookie" | "js_document_cookie"],
first_set_ts: ms timestamp of first observation,
http_response_urls: [urls that sent Set-Cookie for this name],
js_stacks: [JS stack traces that wrote this cookie],
current_value: present value in the cookie jar,
}rdp_debugger tool
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)。evaluate_js tool
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.
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)
value_raw - raw string before cleaning (only when cleaning applied)
type - "primitive" | "json" | "handle_fallback" | "error"
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 Nonecheck_environment tool
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.hook_function tool
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_data tool
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_preset tool
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.<name> || []", 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_hooks tool
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_logs tool
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.instrumentation tool
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 `;\\n...\\n;` when it contains newlines or `//`);
(2) insertions landing inside string, template, comment or regex
literals are skipped individually (`skipped_insertions` /
`literal_skips`);
(3) a `before` insert on a `switch` `case <expr>:` / `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 (only `mode="regex"` with zero member rewrites
keeps exact 1-based line numbers).
Per-group inserted counts come back in `inject.groups[].insertions`
(raw regex matches in `.matches`) and accumulate across newly
rewritten scripts in `status`/`log` as `inject_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`/`default` label 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 state `stage` ran,
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.hook_jsvmp_interpreter tool
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_env tool
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.launch_browser tool
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:<port>/<guid>" 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_browser tool
Close the browser after serializing any native trace transition.
navigate tool
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.reload tool
Reload the current page, preserving any init scripts.
take_screenshot tool
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_snapshot tool
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.click tool
Click on a page element.
type_text tool
Type text into an input field with realistic keystroke delays.
wait_for tool
Wait for an element to appear or a network request matching a URL pattern.
get_page_info tool
Get page metadata plus a zero-based frame list for targeted tools.
reset_browser_state tool
Reset browser residual state after serializing trace transitions.
network_capture tool
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_requests tool
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.get_network_request tool
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.get_request_initiator tool
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 <script>), 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_request tool
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_capture tool
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_requests tool
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_body tool
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.scripts tool
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:<index>" for inline scripts)
"save" — save script source to local file (requires url + save_path)
url: Script URL or "inline:<index>" (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_code tool
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:<index>" 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.stage_break tool
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.cookies tool
Cookie management (v0.9.0 unified).
Replaces get_cookies / set_cookies / delete_cookies.
Args:
action:
"get" — return cookies (optionally filtered by domain)
"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/delete (boundary match, includes subdomains).
With name, both filters must match. No filters deletes all cookies.
cookies_list: List of cookie dicts for "set".
name: Cookie name filter for "delete".
Returns:
For "get": list of cookie dicts.
For "set"/"delete": dict with status and count.get_storage tool
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_state tool
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_state tool
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.trace_property_access tool
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_files tool
List all trace files on disk (for post-hoc analysis).
Returns:
dict with traces_dir, total file count, and file details.query_trace_file tool
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.trace_session tool
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.verify_signer_offline tool
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.What we checked
The same checks run on every server. Each line below has one of these marks:
- 8 checks: command injection, argument injection, path traversal, server-side request forgery, SQL injection, code execution, unsafe deserialization, template injectionChecked on every scan. Results in this category are published only after a person has verified them.
- Runs programs the caller choosesNo tool runs a command or program the caller supplies — 43 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Executes caller-supplied codeNo tool evaluates code the caller supplies — 43 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Reads or writes any file path HIGH9 findings in compare_env, export_state, query_trace_file, save_response_body and more; 2 more to review
- Requests any addressNo tool sends a request to an address the caller supplies — 43 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Runs caller-supplied SQLNo tool executes a query the caller supplies — 43 tool handlers traced. Not every path could be followed, so this is not a clean pass.
- Tools that start processesNot seen in the traced code of 43 capabilities; 43 more call code the scanner could not follow, where it may happen
- Tools that touch files13 of 43 capabilities touch files; 30 more call code the scanner could not follow, where it may happen
- Tools that call the networkNot seen in the traced code of 43 capabilities; 43 more call code the scanner could not follow, where it may happen
Where the code is: 43 handlers in 15 files at commit 858d29c63788
src/camoufox_reverse_mcp/tools/cookie_analysis.pyanalyze_cookie_sourcessrc/camoufox_reverse_mcp/tools/debugger_rdp.pyrdp_debuggersrc/camoufox_reverse_mcp/tools/debugging.pyevaluate_jssrc/camoufox_reverse_mcp/tools/environment.pycheck_environmentsrc/camoufox_reverse_mcp/tools/hooking.pyhook_function, get_trace_data, inject_hook_preset, remove_hooks, get_console_logssrc/camoufox_reverse_mcp/tools/instrumentation.pyinstrumentationsrc/camoufox_reverse_mcp/tools/jsvmp.pyhook_jsvmp_interpreter, compare_envsrc/camoufox_reverse_mcp/tools/navigation.pylaunch_browser, close_browser, navigate, reload, take_screenshot, take_snapshot, click, type_text, wait_for, get_page_info, reset_browser_statesrc/camoufox_reverse_mcp/tools/network.pynetwork_capture, list_network_requests, get_network_request, get_request_initiator, intercept_request, export_network_capture, compare_network_requests, save_response_bodysrc/camoufox_reverse_mcp/tools/script_analysis.pyscripts, search_codesrc/camoufox_reverse_mcp/tools/stage_break.pystage_breaksrc/camoufox_reverse_mcp/tools/storage.pycookies, get_storage, export_state, import_statesrc/camoufox_reverse_mcp/tools/trace.pytrace_property_access, list_trace_files, query_trace_filesrc/camoufox_reverse_mcp/tools/trace_session.pytrace_sessionsrc/camoufox_reverse_mcp/tools/verification.pyverify_signer_offline
- 5 checks: tool poisoning, instruction override, hidden content, exfiltration requests, metadata integrityChecked on every scan. Results in this category are published only after a person has verified them.
- Dependency manifests1 manifest: pyproject.toml
- Lockfiles checked against OSVNothing could be resolved to exact versions; 1 not resolved: pyproject.toml: dependency ranges declared here were not resolved against a lockfile and were not checked
- MCP SDK versionmcp >=1.29,<2
- 3 checks: credential harvesting, undeclared credential access, credentials sent over the networkChecked on every scan. Results in this category are published only after a person has verified them.
- Tools that read credentialsNot seen in the traced code of 43 capabilities; 43 more call code the scanner could not follow, where it may happen
- Authentication declaredNot checked: needs the live server's tools/list (a remote server declares how clients authenticate)
- 3 checks: undeclared network access, undeclared file access, undeclared process executionChecked on every scan. Results in this category are published only after a person has verified them.
- Tool descriptions presentEvery tool has a description the model and the user can read (1 only in code no tool reaches)
- Statically known namesEvery tool's name could be read from the code
- Input schemasNot checked: needs the live server's tools/list (every tool declares an input schema)
- Destructive tools annotatedNot checked: needs the live server's tools/list (tools that write, delete or run commands carry destructivehint)
Dependencies with known vulnerabilities (0 in production)
Dependency ranges were not resolved against a lockfile, so the score is capped at 7.
No known vulnerabilities in the production dependencies that could be checked.
Past security advisories
Vulnerabilities published for this server itself, from the GitHub Advisory Database.
No security advisories have been published for this server in the GitHub Advisory Database.
How it runs
| Where it runs | On your machine, started by your MCP client from this repository or its package |
|---|---|
| Transport | not stated in the code the scanner read; most local servers talk over stdio |
| Sign-in | not checked needs the live server |
| MCP SDK | mcp >=1.29,<2 |
The project's own security
| Security policy | none no SECURITY.md in the repository: report issues privately through GitHub if it is enabled |
|---|---|
| Past advisories | none in the GitHub Advisory Database |
| Last push | 2026-11-15 |
| Signed releases | not checked yet |
Where it is published
| Listed in | 3 catalogs (github_search, glama, mcp_toplist) |
|---|---|
| License | MIT |
| Created | 2026-04-01 |
Attack map
How the server is built and where its risky tools lead: servers, their tools, what the tools' code can do, and the traced route from a declared risky tool's argument to the operation it reaches. Click a node for details.