Browser Intelligence · MCP guides · Browser DevTools
Browser DevTools observability
SiteLens combines browser automation, observability, diagnostics, visual regression, and evidence into one coherent workflow. Browser DevTools is the inspection capability under Browser Intelligence: structured, already-redacted console and network facts, deterministic diagnostics, labeled evidence, cross-run comparison, and unified timeline— not raw CDP dumps. Local MCP sessions are free and need no SiteLens account. Product page: /browser-devtools.
Structured SiteLens workflows (vs raw CDP dumps)
SiteLens session tools
Compact JSON with sessionId / localRunId, redacted headers and query strings,
policy-gated bodies, cursor pagination, and ranked diagnostic findings with evidence refs. Works after
the browser closes when artifacts were exported. Same evidence model as flows, Desktop, and hosted runs.
Raw CDP / ad-hoc dumps
Protocol-shaped payloads, secrets in headers, no built-in root-cause ranking, and no shared model with SiteLens flows, scenarios, Desktop panels, or hosted run history. Prefer CDP only for surfaces SiteLens does not model (arbitrary page JS, full protocol access).
Agents: when the task is console errors, failed APIs, response bodies, failed assertions, compare green vs red, timeline navigation, or “what broke on this step?”, start with SiteLens session / diagnostics / compare / timeline tools — not generic DevTools MCP.
Debugging workflow
sitelens_session_start with captureMode: "standard" (debug default).
sitelens_session_run_steps — same step vocabulary as project flows.
Filter messages, match exchanges, inspect payloads and query strings.
Pull response bodies, run diagnostics, explain step failures with evidence.
Screenshots, HAR, optional trace/video, then sitelens_session_close.
Console
Query captured console messages with level and text filters. Page errors are a separate stream
(sitelens_get_page_errors.
{
"sessionId": "sess_…",
"matcher": { "level": ["error", "warning"], "textSubstring": "Failed to" }
}
Tool: sitelens_get_console_messages. Wait live with sitelens_wait_for_browser_event (kind: "console").
Network, payloads & query strings
List exchanges with sitelens_get_network_requests — filter by urlPattern,
method, status range, host, GraphQL operation, and query key/value matchers.
Deep-dive one exchange with sitelens_inspect_network (headers, timing, body previews).
{
"sessionId": "sess_…",
"matcher": {
"urlPattern": "**/api/checkout/**",
"method": "POST",
"query": { "env": "staging" }
}
}
Sensitive query keys (token, api_key, session-like names, …) are always redacted in
stored events. See security & redaction below.
Response bodies
Bodies are captured into SiteLens records at response time — never by retaining live Playwright
Response objects. Defaults capture JSON under **/api/** (and failing responses in
standard mode). Use sitelens_get_response_body or
sitelens_save_response_body; check bodyAvailability and truncated flags
when a body is omitted or capped.
{ "sessionId": "sess_…", "requestId": "req_…" }
Diagnostics
Deterministic rules (no LLM): uncaught exceptions, console errors, failed/4xx/5xx requests, auth failures, CORS/CSP, GraphQL-200-with-errors, repeated requests, failed downloads, WebSocket errors. Findings include factual basis, causality links, and refs-only evidence bundles.
{ "sessionId": "sess_…", "severityAtLeast": "warning" }
Tools: sitelens_run_diagnostics, sitelens_explain_step_failure,
sitelens_get_diagnostic_evidence.
Screenshots, trace & video
-
Screenshots — labeled flow/session steps
{ "type": "screenshot", "label": "after-submit" }; paths inactionLog[].screenshotandsummary.screenshotPaths. PreferexportArtifacts: trueduring investigations. -
Trace / video — opt-in on flow documents via
"trace": "on" | "retain-on-failure"and"video": "on" | "retain-on-failure"(Playwright artifacts under the run dir). Not a substitute for structured events — use for timeline replay after events + diagnostics.
Assertions & waits
Live sessions support lookback waits and point-in-time assertions over console, page errors, network, failed requests, or diagnostics — so a fast network failure cannot race the wait.
// wait
{ "sessionId": "sess_…", "kind": "network", "matcher": { "statusMin": 400 }, "timeoutMs": 10000 }
// assert
{ "sessionId": "sess_…", "assertion": "exists", "target": "failedRequests" }
Tools: sitelens_wait_for_browser_event, sitelens_assert_browser_events. Flow steps
mirror this (waitForConsole, network assert steps, expectDownload, …).
Downloads & WebSockets
Opt-in only: captureMode: "verbose" or explicit
capturePolicy.categories.downloads / websockets. Binary WebSocket payloads are never
stored — metadata only.
HAR export
sitelens_export_har builds a minimal HAR 1.2 from already-redacted captured pairs — enough for
agents and HAR viewers, not a full Chrome DevTools export.
Cross-run compare
Compare two completed runs over redacted browser events and diagnostics (fingerprints — not pixel screenshot
diff). Hosted: POST /qa/runs/compare with
{ baselineRunId, candidateRunId, newOnly? }. Desktop: Run comparison panel. Distinct from
sitelens_compare_local_runs summary/pixel tools.
Unified timeline
Presentation model over events and findings — filters, context windows, and failed-step focus. Hosted:
GET /qa/runs/:runId/timeline, /timeline/context,
/timeline/failed-step. Desktop: Timeline panel with expandable rows and explicit inference /
redaction markers.
Desktop & hosted
-
SiteLens Desktop — post-run Diagnostics, Console, Network, Timeline, and Comparison
panels over local sidecar routes
GET /runs/:localRunId/events|diagnostics|network|timeline…,POST /runs/compare, and HAR export. -
Hosted API — authenticated retrieval under
/qa/runs/:runId/events,/network,/diagnostics,/har,/timeline, andPOST /qa/runs/compare(workspace auth; cross-tenant → 404).
Capture defaults
local / hosted QA → errors-only
debug session → standard (sitelens_session_start default)
exportArtifacts → standard
off → only when explicit
Capability matrix
Full matrix with notes: docs/sitelens-browser-devtools-capability-matrix.md.
Capability Local MCP/CLI Desktop panels Hosted API
────────────── ───────────── ────────────── ──────────
Console yes yes yes
Network yes yes yes
Response body yes via inspect yes
Diagnostics yes yes yes
HAR yes yes yes
Compare yes yes yes
Timeline yes yes yes
Downloads opt-in via events when persisted*
WebSockets opt-in via events when persisted*
Screenshots yes (steps) run artifacts yes (existing)
Trace / video flow opt-in run artifacts when persisted
Assertions live session post-run view N/A (run-time)
* Hosted download/WebSocket availability follows persisted capture policy.
Security & redaction
- Always-on redaction — Authorization, Cookie, Set-Cookie, common API-key headers, and sensitive query/JSON keys become
[redacted]before persistence. - Truncation indicators — bodies and text expose
truncated/bodyAvailabilitywhen omitted or capped. - Errors-only defaults — local and hosted QA capture stays lean unless you opt into a debug session or
exportArtifacts. - Authenticated artifact access — hosted screenshots and event/timeline/compare routes require a valid API key; local Desktop sidecar stays on loopback.
- No live Playwright retention — response bodies are copied into SiteLens records immediately; Playwright response objects are not kept for later reads.
- Compare / timeline — consume already-redacted events only; inferred correlations are labeled.
Details: docs/sitelens-browser-devtools-security.md.
Agent prompt examples
Investigate a failed login on http://localhost:3000/login with
sitelens_session_start → run steps → diagnostics → evidence chain.
Inspect the network request that returned 401: list exchanges,
inspect headers/timing, get the response body.
Explain the failed assertion on the last step with
sitelens_explain_step_failure and cite diagnostic evidence.
Compare a successful localRunId with a failing one using
sitelens_compare_browser_runs; open the timeline around the first
new finding with sitelens_get_timeline_context.
Diagnose a visual regression: pixel-compare screenshots, then
correlate with console/network findings from the candidate run.
Retrieve the full evidence chain for findingId X (diagnostics +
timeline context + report failures).
Full tool walkthrough: browser-devtools-workflow.md · preferred patterns: browser-devtools-preferred-workflows.md
Related documentation
- Browser Intelligence — platform umbrella
- Browser DevTools — product capability page
- Why SiteLens
- Capability matrix (local MCP / CLI / Desktop vs hosted)
- Security & redaction
- Full surface release notes (Core → Phase I–J)
- Intelligence release notes (Phases K–L)
- Engineering pointer
- Project flows & templates
- Scenario Runner