Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ PLAYWRIGHT_MCP_ISOLATED=true PLAYWRIGHT_MCP_STORAGE_STATE=./auth.json npx --allo

Note that `excludePathPatterns` replaces the default rather than extending it, so repeat `logout|signout` in your list.

If a session cookie disappears anyway, `audit_site` says so instead of reporting a confident, wrong audit: the result starts with a `WARNING: cookie(s) … disappeared while loading <url>` line, and both the JSON report and the structured content carry a `sessionLosses` list naming, for each lost cookie, the page that dropped it — the page reached after any redirect, and reported even when that page failed to finish loading. If one of the lost cookies was the session, every page scanned after that point was audited as a signed-out user — exclude the offending URL, sign in again, and re-run.
If a session cookie disappears anyway, `audit_site` says so instead of reporting a confident, wrong audit: the result starts with a `WARNING: cookie(s) … disappeared while loading <url>` line, and both the JSON report and the structured content carry a `sessionLosses` list naming, for each lost cookie, the page that dropped it — the page reached after any redirect, and reported even when that page failed to finish loading. When pages are audited concurrently, any page loading at the same time may have been the one, so those pages are listed in the entry's `concurrentUrls` and in the warning; re-run with `concurrency: 1` to pin the loss on one page. If one of the lost cookies was the session, every page scanned after that point was audited as a signed-out user — exclude the offending URL, sign in again, and re-run.

The check compares which cookies the crawled URLs carry, not their values, so a rotating CSRF token never reads as a lost session. A cookie the browser deleted at its own stated expiry is ignored for the same reason — Cloudflare's `__cf_bm` lives 30 minutes and would otherwise warn on any longer crawl. Beyond that no attempt is made to tell an authentication cookie from any other: nothing in a cookie marks it as one, so any cookie the crawl started with and later lost is reported. Monitoring does not stop at the first loss — each cookie is reported once, at the URL where it vanished, so an analytics cookie expiring early cannot mask the session cookie being dropped later. URLs discovered mid-crawl join the cookie tracking before they are visited, so a session cookie scoped to a path below the start URL (say `/app`) is watched too.

Expand Down Expand Up @@ -573,6 +573,7 @@ A frame you scoped out yourself is not reported: with `excludeSelectors: ["ifram
#### `audit_site`
Crawls and scans multiple internal pages, then aggregates violations across the site.
- Default strategy: link-based BFS from the current URL
- Audits up to `concurrency` pages at once (default `4`, max `8`), each in its own temporary tab, so page loads, settle waits and Axe runs overlap. This makes a crawl about 2-2.4x faster on a 4-core machine (6 and 12 benchmark pages). Links each page discovers are queued in the order pages were visited, not the order they finished, so the pages scanned, their order, depth and `discoveredFrom`, and the aggregated findings are the same as with `concurrency: 1`. Use `concurrency: 1` when pages depend on `sessionStorage` written by earlier crawled pages, since each tab has its own, or when you want a lost session cookie pinned on exactly one page.
- Supports `links`, `nav`, `sitemap`, and `provided` URL strategies. Trailing slashes are preserved; sitemap locations decode XML entities while preserving literal CDATA content.
- Sitemap URLs and every redirect must pass the server network policy and crawl scope. Fetches run on the MCP host, use HTTP(S) without browser cookies or auth headers, and have a 15-second total timeout, 20-redirect cap, and 10 MiB response limit. Browser proxy settings, `browser.remoteEndpoint`, `browser.cdpEndpoint` (including loopback endpoints, which may tunnel to remote browsers), and switched `browser_connect` providers are rejected for this strategy; use `provided` URLs in these modes. Sitemap TLS certificates must be valid even when browser HTTPS errors are ignored.
- Always writes a JSON report (default filename: `audit-site-{timestamp}-{token}.json`). Per-page `summary.totalNodes`, `byImpact`, and `byRuleId` count all deduplicated violation nodes; `maxNodesPerViolation` only limits the saved node details.
Expand Down
5 changes: 5 additions & 0 deletions bench/mcp-bench.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,11 @@ const scenarios = [
setup: () => call('browser_navigate', { url: `${origin}/page-0.html` }),
run: () => call('audit_site', { startUrl: `${origin}/page-0.html`, maxPages: 6, maxDepth: 2 }),
},
{
name: 'audit_site (12 pages)',
setup: () => call('browser_navigate', { url: `${origin}/page-0.html` }),
run: () => call('audit_site', { startUrl: `${origin}/page-0.html`, maxPages: 12, maxDepth: 5 }),
},
...screenReaderCases.map(fixture => ({
name: fixture.name,
setup: () => call('browser_navigate', { url: `${origin}${fixture.path}` }),
Expand Down
Loading
Loading