mcp-accessibility-scanner MCP Server
MCP server for automated web accessibility scanning with Playwright and Axe-core.
mcp-accessibility-scanner scores 42 (Fair), licensed MIT and written in TypeScript. It installs as a local process. It declares 26 tools. Filed under Browser automation. GitHub shows 59 stars. Package registries report about 3,473 downloads a week. Install configs are generated for 12 clients. Being listed in the registry is not the same as being vendor-official.
Fair trust
42 of 100 from six public signals. Nobody can buy a point.
- OSI-style license: mit.
License, quality and maintenance
Quality: Grade A
90/100 for listing completeness. Lost points: short summary, no docs link.
How quality is graded
Where the 42 comes from
0 + 6 + 12 + 10 + 7 + 7 = 42. Each factor is capped, so no single signal can carry a listing.
Active in the official MCP registry, plus a known vendor namespace.
Registry: 0 of 30 points.How recently the repository saw a commit or release.
Maintenance: 6 of 20 points.GitHub stars and weekly downloads, on a log scale.
Popularity: 12 of 20 points.A clear, OSI-style open-source license.
License: 10 of 10 points.Not archived, a secure install path, a pinned version.
Security: 7 of 10 points.A real summary, a README with depth, listed tools.
Docs: 7 of 10 points.Install
Pick your client, copy the config, paste it in.
Needs Cursor or VS Code installed on this device. The button opens the app and asks you to confirm before it adds the server.
{ "mcpServers": { "justasmonkev-mcp-accessibility-scanner": { "command": "npx", "args": [ "-y", "mcp-accessibility-scanner@1.1.1" ] } }}
Environment variables
This server does not declare environment variables.
Tools26Tool docs quality grade C
All capabilitiesRestrict files sent by browserfileupload and browserdrop to regular files inside these directories, including resolved symlink targets. Restricted uploads and drops use a checked file handle and accept up to 50 MiB total per call. Un
Browser to use (chromium, firefox, webkit)
Attach to an already-running Chromium-family app with CDP enabled
Map of HTTP headers to send with the CDP connect request, e.g. { "Authorization": "Bearer <token>" }, for endpoints that require header-based authentication
Launch a Chromium-family desktop app with CDP enabled, wait for the endpoint, and manage the child process lifecycle. startupTimeoutMs (default 30000) bounds the whole wait, attach attempts included; each attempt also stops at browser.
Maximum time in milliseconds to wait when connecting to the CDP endpoint (default: 30000)
With client certificates, a configured launch proxy is also applied to fresh contexts unless browser.contextOptions.proxy explicitly overrides it. With certificates, Playwright routes every request through its certificate interceptor, whi
Start a fresh context from a recorded Playwright storage state. Imports into existing CDP or VS Code contexts are rejected; use --isolated for CDP or sign in interactively. If the browser exposes no context, the server creates one with th
Browser channel (chrome, chrome-beta, msedge, etc.)
Defaults to false for downloaded Chromium builds on Linux because they lack the setuid sandbox helper, and true otherwise. Remote and VS Code endpoints choose on the remote host. An explicit config or PLAYWRIGHTMCPSANDBOX value wins
Run browser in headless mode (default: true on Linux without display, false otherwise)
Browser proxy (CLI: --proxy-server, --proxy-bypass; env: PLAYWRIGHTMCPPROXYSERVER, PLAYWRIGHTMCPPROXYBYPASS). Credentials in a CLI or environment proxy URL, such as http://user:password@myproxy:3128, are moved into proxy.us
About
MCP Accessibility Scanner 🔍
Accessibility checks inside your coding agent: axe scans, keyboard-focus checks and repeatable reports.

An intentionally flawed local demo page, checked with automated tools. These annotations were generated by scan_page with annotateScreenshot: true, not added by hand.
This MCP server lets your coding agent inspect a page, run axe checks, exercise keyboard focus and save findings for review. Automated checks don't certify WCAG compliance; manual accessibility testing is still needed. audit_screen_reader inspects the browser's accessibility tree, accessible names and element geometry. It does not test with an actual screen reader.
Quickstart: connect your coding agent
Install Google Chrome before the first audit. The configuration below uses system Chrome; installing the npm package does not install a browser. See browser configuration for alternatives.
Install the scanner:
npm install -g mcp-accessibility-scanner --allow-scripts=re2
The flag allows the native re2 dependency to install on npm 12. If a prebuilt binary is unavailable, its installer needs a native build toolchain; see re2's installation notes.
Add this stdio server to your coding agent's MCP configuration, then restart or reconnect the client:
{
"mcpServers": {
"accessibility-scanner": {
"command": "mcp-accessibility-scanner",
"args": ["--headless", "--isolated", "--output-dir", "./a11y-output"]
}
}
}
The client must be able to find the installed command on its PATH. --isolated uses a fresh browser profile, not your personal Chrome session. Output paths are relative to the server's working directory; use an absolute --output-dir if your client starts it elsewhere. Client-specific setup and other installation methods are in the reference below.
Your first audit
Start your app locally, then ask your connected coding agent to run these tools in order, replacing the URL with your app's address:
browser_navigate {"url":"http://localhost:3000"}
scan_page {"annotateScreenshot":true}
audit_keyboard {"maxTabs":30}
audit_screen_reader {}
audit_text_spacing {}
These are MCP tool calls, not shell subcommands. For terminal use, see interactive mode.
scan_page returns text findings with JSON node details and remediation links. With annotateScreenshot: true, it also saves a full-page annotated PNG and returns a file resource link. It does not save a JSON report. audit_keyboard, audit_keyboard_operation, audit_form_validation, audit_screen_reader and audit_text_spacing save JSON reports and return summaries and report links; audit_site and scan_page_matrix also save JSON reports. There is no generated HTML report dashboard. Review incomplete checks, coverage warnings and the page states you haven't tested.
To reproduce the screenshot, serve the demo from this repository with python3 -m http.server 8765 --bind 127.0.0.1 --directory docs/assets, navigate to http://127.0.0.1:8765/accessibility-demo.html, then run scan_page with annotateScreenshot: true. The screenshot used a 1000×720 viewport (--viewport-size 1000,720).
Badges
Star History
Features
Accessibility Scanning
✅ Automated checks for WCAG 2.0/2.1/2.2 criteria (A, AA, AAA levels)
📄 Saved JSON audit reports and scan findings with remediation guidance
🎯 Support for specific violation categories (color contrast, ARIA, forms, keyboard navigation, etc.)
Browser Automation
🖱️ Click, hover, and drag elements using accessibility snapshots
⌨️ Type text and handle keyboard inputs
🔍 Capture page snapshots to discover all interactive elements
📸 Take screenshots and save PDFs
🎯 Support for both element-based and coordinate-based interactions
Advanced Features
📑 Tab management for multi-page workflows
🌐 Monitor console messages and network requests
⏱️ Wait for dynamic content to load
📁 Handle file uploads and browser dialogs
🔄 Navigate through browser history
Installation
You can install the package using any of these methods:
Using npm:
npm install -g mcp-accessibility-scanner --allow-scripts=re2
npm 12 does not run dependency install scripts unless you allow them. The scanner depends on re2, a native module whose install script downloads or builds re2.node; without it the server fails to start with Cannot find module './build/Release/re2.node'. Pass --allow-scripts=re2 to npm install -g and npx (older npm versions accept and ignore the flag). For a project dependency on npm 12 or later, run npm install-scripts approve re2 followed by npm rebuild re2 (approving does not run the script that was already skipped). On npm 11 and earlier, install scripts run by default; use npm rebuild re2 to restore a missing binary, provided scripts have not been explicitly disabled. To allow it for every global install on npm 12, run npm config set allow-scripts=re2 --location=user.
Installation with Docker
A pre-built image is available on Docker Hub. The image includes Chromium and is pre-configured for containerized use — no extra flags needed.
Pull from Docker Hub:
docker pull justasmonkev/mcp-accessibility-scanner
Claude Code
claude mcp add mcp-accessibility-scanner -s user -- docker run -i --rm justasmonkev/mcp-accessibility-scanner
To persist screenshots and reports on your host, add a volume mount:
claude mcp add mcp-accessibility-scanner -s user \
-- docker run -i --rm -v /tmp/mcp-output:/app/output justasmonkev/mcp-accessibility-scanner
Without the -v mount, output files only exist inside the container and are lost when it exits.
Docker Compose
docker compose up -d
The Compose configuration publishes the unauthenticated MCP HTTP transport on 127.0.0.1:8931 only. Do not expose this port to untrusted networks.
The Compose service defines a Docker healthcheck that sends a JSON-RPC ping to /mcp and expects HTTP 200. The image itself declares no HEALTHCHECK, because its default stdio mode opens no HTTP listener; add the Compose healthcheck to your own HTTP deployments if you need one.
Build from source
docker build -t mcp-accessibility-scanner .
Images built from this Dockerfile include tini as an init process; Docker's --init flag is optional.
Docker smoke test
npm run test:docker
Installation in VS Code
Install the Accessibility Scanner in VS Code using the VS Code CLI:
For VS Code:
code --add-mcp '{"name":"accessibility-scanner","command":"npx","args":["--allow-scripts=re2","mcp-accessibility-scanner"]}'
For VS Code Insiders:
code-insiders --add-mcp '{"name":"accessibility-scanner","command":"npx","args":["--allow-scripts=re2","mcp-accessibility-scanner"]}'
CLI Modes
The scanner can run in two modes depending on how you use it.
MCP server (default, no subcommand)
When launched without a subcommand, the process starts an MCP server that communicates over stdio. This is the mode used by MCP clients such as Claude Desktop, VS Code, and Claude Code -- you should never need to run it by hand.
npx --allow-scripts=re2 mcp-accessibility-scanner # starts the MCP server (stdio)
All of the MCP client configuration examples in this README already use this default mode.
On POSIX systems, stdin closure, SIGINT, SIGTERM and SIGHUP trigger the same graceful server cleanup. Locally owned browser processes and temporary browser directories are released; caller-supplied persistent-profile directories are retained.
Interactive REPL (interactive subcommand)
For manual terminal use, the interactive subcommand starts a readline REPL where you can call any tool directly:
$ npx --allow-scripts=re2 mcp-accessibility-scanner interactive
Interactive mode. Type "<tool-name> <json>" to call a tool. Ctrl+D to exit.
> browser_navigate {"url": "https://example.com"}
> scan_page {"violationsTag": ["wcag21aa"]}
> audit_keyboard {"maxTabs": 30}
> audit_screen_reader {}
Each line is <tool-name> <json-arguments>. Omit the JSON to pass {}.
When input ends (Ctrl+D or the end of piped input), calls still running finish and are printed and saved before shutdown begins. Ctrl+C, SIGINT, SIGTERM and SIGHUP start shutdown right away without waiting for running calls. Either way, closing the browser and saving the session are bounded by a 15-second shutdown limit that starts only when shutdown begins.
Global browser connection flags still apply here, for example npx --allow-scripts=re2 mcp-accessibility-scanner --headless interactive.
Use --mobile or PLAYWRIGHT_MCP_MOBILE=1 to emulate a generic mobile device (Pixel 10 for Chromium, iPhone 17 for WebKit). It cannot be combined with --device, CDP attach/launch modes, remote browser endpoints, or --extension.
Device names supplied through --device or PLAYWRIGHT_MCP_DEVICE must match a Playwright device descriptor; unknown names fail at startup. An explicit --device overrides PLAYWRIGHT_MCP_DEVICE.
Browser extension mode
Use --extension to connect through the current Playwright Extension, which must support extension protocol v2.
npx --allow-scripts=re2 mcp-accessibility-scanner --extension
Controlled tabs are grouped by default. Pass --no-tab-group with --extension, set PLAYWRIGHT_MCP_NO_TAB_GROUP=1, or use "tabGroup": false in the config file to leave controlled tabs in their existing groups. This also applies when selecting the extension browser provider through --connect-tool; it has no effect on other browser providers. Connection approval and single-client tab ownership are unchanged. The environment accepts 1/true to disable grouping and 0/false to enable it, overriding the config file; --no-tab-group takes precedence over both.
This requires an extension build containing upstream change #43814 (commit deb7e86, October 31, 2026). As of November 1, the Chrome Web Store still lists version 0.4.0, updated September 1, which predates this change and ignores the setting. No supporting released version is confirmed yet; use a build containing that commit until one is available. The upstream manifest is also still 0.4.0, so the version number alone does not establish support.
Set PLAYWRIGHT_MCP_EXTENSION_TOKEN to the token shown by the extension to bypass the connection approval dialog. The relay's CDP WebSocket endpoint always requires a separate random token, generated per relay and appended automatically for the server's own connection. This CDP token is never passed in Chrome's launch arguments or extension URL; the extension approval token cannot authenticate a CDP client.
Token-bypass connections are not background-safe: Chrome focuses the connection tab and window, and client-created tabs remain open after disconnect (upstream limitation).
With a token, the extension must connect and finish setup within 30 seconds after the connection page opens. Failed attempts release the relay so the next tool call can retry. Without a token, manual approval waits until you approve or cancel the call.
When --user-data-dir contains multiple Chrome profiles, the profile with the extension installed is selected automatically, preferring Chrome's last-used profile. Pass --profile-dir-name (or set PLAYWRIGHT_MCP_PROFILE_DIR_NAME) to select a profile explicitly; it requires --user-data-dir and accepts a Chrome profile directory name such as Default or Profile 1 (see "Profile Path" at chrome://version). The PLAYWRIGHT_MCP_EXTENSION_TOKEN approval token is specific to the profile, so when selecting a profile explicitly, use the token shown in that profile.
Packed extensions require an enabled record in the profile's preferences; a leftover extension directory alone does not count as installed. Profiles whose preferences mark the extension disabled or uninstalled are excluded from automatic selection and rejected for explicit selection. Explicit selection with a custom executable skips local installation checks. A whitespace-only PLAYWRIGHT_MCP_PROFILE_DIR_NAME is treated as unset; other string environment variables retain their existing blank-value handling.
Discovering available tools (list-tools subcommand)
To print the built-in tool names and descriptions (page-registered WebMCP tools require a live MCP tools/list request):
npx --allow-scripts=re2 mcp-accessibility-scanner list-tools
Note: Tool names like
browser_navigateandscan_pageare MCP tool identifiers (and REPL commands in interactive mode). They are not shell subcommands -- you cannot runnpx mcp-accessibility-scanner browser_navigate.
Programmatic API
createConnection returns an MCP Server directly, not a wrapper with a server
property. Its type is the SDK's Server from @modelcontextprotocol/server. Connect it
with server.connect(transport) and release it with await server.close().
Passing a custom context getter transfers that context's lifecycle to the server:
browser_close or client disconnection closes the supplied context. Its parent
browser and sibling contexts remain open. Supply a dedicated context, not one
whose tabs or storage must survive the MCP connection. Multiple sessions cannot
use a custom getter to obtain independent contexts.
import { createConnection } from 'mcp-accessibility-scanner';
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
const server = await createConnection({ browser: { isolated: true } });
await server.connect(new StdioServerTransport());
Configuration
Here's the Claude Desktop configuration:
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": ["-y", "--allow-scripts=re2", "mcp-accessibility-scanner"]
}
}
}
Advanced Configuration
Set PLAYWRIGHT_MCP_CONFIG or pass --config <path> to load a JSON configuration file. If both are set, --config selects the file:
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": ["-y", "--allow-scripts=re2", "mcp-accessibility-scanner", "--config", "/path/to/config.json"]
}
}
}
Exact-name tool selection
npx --allow-scripts=re2 mcp-accessibility-scanner --allowed-tools browser_pdf_save --blocked-tools browser_evaluate,browser_file_upload
| CLI | Environment | JSON config |
|---|---|---|
--allowed-tools | PLAYWRIGHT_MCP_ALLOWED_TOOLS | allowedTools |
--blocked-tools | PLAYWRIGHT_MCP_BLOCKED_TOOLS | blockedTools |
CLI/environment values are comma-separated exact, case-sensitive names; JSON values are arrays of strings. allowedTools adds named tools to core and enabled capabilities; it is not a restrictive whitelist. For example, allowing browser_pdf_save does not disable navigation or accessibility audits, and allowing browser_install explicitly enables browser downloads without --caps install. Omitted lists preserve existing exposure defaults.
blockedTools wins over core tools, capabilities and allowedTools. Blocked tools are absent from tools/list and rejected on tools/call, even without prior listing and even when a request names a browser session. The server instructions sent at initialization stop recommending blocked tools, so clients are not directed to calls that would be rejected. If the blocked tool is the one that clears an open modal (browser_handle_dialog or browser_file_upload), the modal-state guidance names it and says it is blocked instead of offering it as the way forward; other tools keep refusing while the modal is open. The policy applies to standalone, CDP, extension, provider-switching and VS Code backends, over stdio and HTTP. browser_session_open, browser_session_close, accessibility tools and the proxy-owned browser_connect are not exempt. Allowing a tool does not bypass a provider's limitations or enable a connection mode; browser_connect still requires a mode that supplies it.
Precedence is CLI > environment > config file, independently for each list. A higher-precedence list replaces the lower one; lists are not merged. [] in JSON, --blocked-tools=, or an empty environment value explicitly clears that list (likewise for allowedTools). Empty lists add/block nothing; duplicates are harmless. Blank entries inside nonempty lists, non-array JSON values, unknown names (including generated webmcp_* page-tool names) and wildcards fail at startup.
Page-provided WebMCP tools remain discoverable by default and are outside this policy. Their generated webmcp_<name>_<identity> names hash an identity minted for each server run, document and registration, so a name copied from tools/list never matches after a restart or navigation. Instead of accepting a value that could never take effect, startup rejects webmcp_* names in both lists like any other unknown name. Page tools keep their existing scope and staleness checks; a persistent page-action policy would need a stable registration key and is not part of this feature.
This controls dispatch by tool name, not equivalent actions through other tools: for example, blocking browser_click does not prevent a page click through browser_evaluate. See the adoption decision.
Configuration Options
Relative filesystem paths in a JSON config file resolve from the directory containing that file, not the server's working directory. This applies only to these fields:
| Config field | Paths resolved from the config directory |
|---|---|
| Top level | outputDir |
browser | userDataDir, each allowedUploadDirs entry, cdpLaunch.cwd |
browser.launchOptions | executablePath, downloadsPath, tracesDir, artifactsDir |
browser.contextOptions | String storageState, recordHar.path, recordVideo.dir, each clientCertificates entry's certPath, keyPath, pfxPath |
For example, /project/config/scanner.json with "outputDir": "./reports" writes to /project/config/reports, regardless of where the server starts. Session logs and server-managed traces also use outputDir. Upload roots must still exist and are canonicalized after merging.
Absolute paths and storageState objects are unchanged. Commands such as browser.cdpLaunch.command, launch arguments, profile names, URLs and URL filters are not rewritten. Relative CLI and environment paths still use the server's working directory, as do programmatic Config paths. Precedence remains CLI > environment > config file, so an override is never rebased against the config directory. The --config filename itself is still relative to the server's working directory.
Migration: Earlier versions resolved file-configured relative paths from the server's working directory. If your config relied on that behavior, adjust those paths relative to the config file's directory or use absolute paths. CLI and environment values need no migration.
Create a config.json file with the following options:
{
"browser": {
"browserName": "chromium",
"launchOptions": {
"headless": true,
"channel": "chrome"
},
"cdpLaunch": {
"command": "open",
"args": ["-a", "Slack", "--args", "--remote-debugging-port={port}"],
"startupTimeoutMs": 30000
}
},
"timeouts": {
"navigationTimeout": 60000,
"defaultTimeout": 5000,
"settle": 500,
"idle": 0
},
"network": {
"allowedOrigins": ["example.com", "trusted-site.com"],
"blockedOrigins": ["ads.example.com"]
},
"snapshot": {
"boxes": true
}
}
Available Options:
-
browser.browserName: Browser to use (chromium,firefox,webkit)An open
<details>nested inside a closed<details>stays hidden frombrowser_snapshot,browser_find,browser_verify_element_visibleandbrowser_verify_text_visibleuntil the outer<details>is opened, in Chromium, Firefox and WebKit on the pinned Playwright 1.65.0. With WebKit on Playwright 1.63.0 its contents counted as visible (upstream fix);tests/details-visibility.integration.test.tschecks each engine. See the verification notes. -
browser.allowedUploadDirs: Restrict files sent bybrowser_file_uploadandbrowser_dropto regular files inside these directories, including resolved symlink targets. Restricted uploads and drops use a checked file handle and accept up to 50 MiB total per call. Unset allows any path;[]denies all file uploads and drops (text-only drops still work). Blank list entries are rejected. CLI:--allowed-upload-dirs(semicolon-separated;""denies all), env:PLAYWRIGHT_MCP_ALLOWED_UPLOAD_DIRS(empty string denies all).The list must be an array, not
null. Roots must exist at startup: their canonical paths are resolved once and retained for the server's lifetime, so retargeting a configured symlink does not grant access to a new tree. Non-empty upload allowlists require macOS or Linux with/proc/self/fdavailable. macOS blocks ancestor symlinks during the file open; Linux checks the opened descriptor's path. Other platforms reject restricted file uploads and drops rather than rely on race-prone pathname checks. Unrestricted uploads, deny-all lists, and text-only drops keep working on all platforms. -
browser.launchOptions.headless: Run browser in headless mode (default:trueon Linux without display,falseotherwise) -
browser.launchOptions.channel: Browser channel (chrome,chrome-beta,msedge, etc.) -
browser.contextOptions.clientCertificates: With client certificates, a configured launch proxy is also applied to fresh contexts unlessbrowser.contextOptions.proxyexplicitly overrides it. With certificates, Playwright routes every request through its certificate interceptor, which matchesproxy.bypassentries only as domain suffixes:example.comand.example.comboth bypassexample.comand its subdomains, and IP addresses match exactly. Entries using browser-specific syntax (wildcards such as*.example.com, ports, IP ranges,<local>) would be ignored there, so they are rejected before launch. Playwright 1.63.0 ignored every bypass entry in the interceptor;tests/client-certificate-proxy-probe.mjschecks bypassed and proxied routes on the pinned version. For a fresh context on a remote browser, configure its proxy explicitly; a proxy inherited only from that browser cannot be inspected. Existing attached contexts retain their current settings.Local persistent Firefox cannot combine client certificates with a configured proxy on Playwright 1.65.0: it sends requests without the configured certificate. This combination is rejected before launch. Explicitly use isolated Firefox or Chromium if suitable for your workflow; the server does not change browser, proxy or persistence mode automatically. Firefox without certificates or without a proxy remains supported.
-
browser.launchOptions.proxy: Browser proxy (CLI:--proxy-server,--proxy-bypass; env:PLAYWRIGHT_MCP_PROXY_SERVER,PLAYWRIGHT_MCP_PROXY_BYPASS). Credentials in a CLI or environment proxy URL, such ashttp://user:password@myproxy:3128, are moved intoproxy.usernameandproxy.passwordso the browser can answer407 Proxy Authentication Required; percent-encode reserved characters such as@,:or/in them. A proxy set in the config file keeps its explicitusernameandpasswordfields.Proxy credentials and website authentication: Playwright 1.65.0 sends proxy credentials only in answer to a proxy
407challenge, never to a website's401challenge (upstream fix); Playwright 1.63.0 leaked them, and the server's former startup warning was removed with the upgrade. Usebrowser.contextOptions.httpCredentialsfor website authentication. Without it, full Chromium fails a website's401withnet::ERR_INVALID_AUTH_CREDENTIALS, with or without a proxy, while Firefox and WebKit show the401page.tests/proxy-credentials.integration.test.tschecks the credentials reach only the proxy. -
browser.launchOptions.chromiumSandbox: Defaults tofalsefor downloaded Chromium builds on Linux because they lack the setuid sandbox helper, andtrueotherwise. Remote and VS Code endpoints choose on the remote host. An explicit config orPLAYWRIGHT_MCP_SANDBOXvalue wins;--no-sandboxalways disables it. -
browser.cdpEndpoint: Attach to an already-running Chromium-family app with CDP enabled -
browser.cdpHeaders: Map of HTTP headers to send with the CDP connect request, e.g.{ "Authorization": "Bearer <token>" }, for endpoints that require header-based authentication -
browser.cdpTimeout: Maximum time in milliseconds to wait when connecting to the CDP endpoint (default:30000) -
browser.cdpLaunch: Launch a Chromium-family desktop app with CDP enabled, wait for the endpoint, and manage the child process lifecycle.startupTimeoutMs(default30000) bounds the whole wait, attach attempts included; each attempt also stops atbrowser.cdpTimeout. If the command cannot be started (for example a missing application) or exits with a nonzero code or a signal before the endpoint answers, the tool call fails right away with that error and the server keeps running; a clean exit (code0, as withopen -a <App>) is treated as a hand-off and the wait continues. -
Numeric settings must be integers in range, whether they come from the CLI, the environment, or the config file:
cdpLaunch.startupTimeoutMsfrom 1 andcdpTimeout,timeouts.navigationTimeout,timeouts.defaultTimeoutandtimeouts.settlefrom 0 (cdpTimeout: 0still disables the connect timeout), all up to2147483647ms;cdpLaunch.portfrom 1 andserver.portfrom 0, up to65535. A mistyped value such asPLAYWRIGHT_MCP_CDP_LAUNCH_STARTUP_TIMEOUT=30sstops startup with an error instead of being ignored or disabling a timeout. A JSONnullis rejected the same way rather than treated as omitted; leave the key out to use its default. -
CDP attach modes preserve the target browser's existing default-context settings instead of applying Playwright's defaults.
-
browser.contextOptions.storageState: Start a fresh context from a recorded Playwright storage state. Imports into existing CDP or VS Code contexts are rejected; use--isolatedfor CDP or sign in interactively. If the browser exposes no context, the server creates one with the state. CDP sessions joining that same server-created context inherit its live state without resetting it. In the default persistent mode, pages the profile has open are replaced with blank tabs before the state lands and reopened afterwards; if new pages keep opening for 30 seconds, context creation fails with an error instead of waiting indefinitely. -
browser.profileDirName: Chrome profile directory name used in extension mode, for exampleDefaultorProfile 1(CLI:--profile-dir-name, env:PLAYWRIGHT_MCP_PROFILE_DIR_NAME). Requires--user-data-dirand extension mode (--extensionor--connect-tool); defaults to the last-used profile that has the extension installed. -
timeouts.navigationTimeout: Maximum time for page navigation in milliseconds (default:60000) -
timeouts.defaultTimeout: Default timeout for Playwright operations in milliseconds (default:5000) -
timeouts.settle: How long to wait after every action for triggered work to settle before responding (default:500). With a positive settle delay, an action that finishes quietly is first watched for up to 100ms (or the settle delay, whichever is shorter) so scheduled network work can still be awaited before the settle delay. -
timeouts.idle: Release the default browser context after this many idle milliseconds (default:0, disabled). Accepts integers from0to2147483647. -
network.allowedOrigins: List of host patterns to allow (blocks other HTTP(S) requests and page WebSockets when nonempty), for exampleexample.comor*.example.com. Include the port for nondefault ports. -
network.blockedOrigins: List of host patterns to block; blocklist matches take precedence over the allowlist. -
snapshot.boxes: Include each element's viewport-relative bounding box as[box=x,y,width,height]in snapshots (default:false; CLI:--snapshot-boxes, env:PLAYWRIGHT_MCP_SNAPSHOT_BOXES=1) -
imageResponses:allow(default) returns text and images;omitexcludes images;onlyomits text from successful responses containing images. Errors, browser lifecycle notices, and responses without images (including full-page screenshots) keep their text. Structured results and resource links are always preserved. Inonlymode, screenshot save-path text, generated code and any accompanying text-only findings are omitted; useallowif you need them. Interactive mode rejectsonlybecause its REPL prints text only; usealloworomitthere.autoremains a legacy alias forallow. CLI:--image-responses only; env:PLAYWRIGHT_MCP_IMAGE_RESPONSES=only. Precedence: CLI, then environment, then config file. -
server.authToken: When set, Streamable HTTP requests (--port) requireAuthorization: Bearer <token>or return401(env:PLAYWRIGHT_MCP_AUTH_TOKEN). Blank or malformed tokens fail at startup. The scheme is case-insensitive; the token is exact. Bearer auth does not encrypt traffic: authenticated listeners must bind to loopback, such as--host 127.0.0.1; use a TLS reverse proxy for remote access. The printed client config includes a header placeholder to replace locally, without logging the secret. Unset keeps unauthenticated access. -
filePaths: Optionalrelativeorabsoluterendering for output paths in screenshot/PDF results and generated code, report metadata, annotated/keyboard screenshots, and download summaries. Relative paths are based on the server working directory, not the client workspace or output directory. File writes, stored report contents, and absolutefile://resource URIs are unchanged. Omitted preserves legacy rendering: configured relative output directories produce relative paths, while default temp output paths are absolute (unlike upstream Playwright’s relative default). CLI:--file-paths absolute; env:PLAYWRIGHT_MCP_FILE_PATHS=absolute. Precedence: CLI, then environment, then config file. -
outputDir: Directory for output files — reports, screenshots, traces, and session logs (CLI:--output-dir, env:PLAYWRIGHT_MCP_OUTPUT_DIR). Defaults to a fresh directory under the system temp folder, resolved once per server run so all of a run's artifacts land together. The output location is always server configuration; the deprecated MCP roots capability (client workspace folders) is no longer consulted. -
redactUrlParams: Optional array of URL query/fragment parameter names whose nonempty values are rendered asREDACTED(CLI:--redact-url-params code,access_token; env:PLAYWRIGHT_MCP_REDACT_URL_PARAMS=code,access_token). Defaults to no URL-parameter redaction. Names match literally and case-insensitively, without decoding keys; repeated matches, relative links and hash-route query parameters are included. Empty values and unselected parameters are preserved. CLI overrides environment, which overrides the config file; lists replace rather than merge.[]in JSON or an empty CLI/environment value clears a lower-precedence list. Non-array config values, non-string entries and blank names fail before browser startup. See URL redaction coverage before sharing output or artifacts.
Origin restrictions require locally launched Chromium (isolated or persistent). Firefox/WebKit and CDP, remote, extension, VS Code or custom-context connections reject restrictions instead of silently applying a partial policy or affecting unrelated browser contexts. Without origin restrictions those modes are unchanged. Enforcement begins when the browser context is acquired and the policy is installed; it does not retroactively filter startup traffic or existing connections (for example, during persistent-profile restoration). HTTP(S) filtering then covers each redirect hop, including subresources, frames and popups, while preserving browser redirect URLs, methods and cookies. Page WebSockets are checked before connecting to a server. Worker-created WebSockets are not filtered by Playwright's page WebSocket routing. These options are not a complete network security sandbox; use external network isolation when worker sockets or other browser traffic must be restricted.
CDP launch settings combine across layers as follows: the application (command, args, cwd, and the config file's env) comes as a unit from the highest-precedence layer (CLI > environment > config file) that sets a command, because arguments written for one application are unsafe to pass to another. port and startupTimeoutMs merge field by field with the same precedence, so --cdp-launch-command app with PLAYWRIGHT_MCP_CDP_LAUNCH_STARTUP_TIMEOUT=45000 uses that timeout (and a mistyped one fails startup), and a config file may set only port or startupTimeoutMs. Setting args or cwd in a layer without a command while another layer sets the command fails startup instead of being ignored, as does any CDP launch setting (from the config file, the environment or the CLI, such as --cdp-launch-port alone) when no layer sets a command.
CLI equivalents are also available: --cdp-launch-command, --cdp-launch-args, --cdp-launch-cwd, --cdp-launch-port, --cdp-launch-startup-timeout, --cdp-endpoint, --cdp-header (repeat for multiple headers, e.g. --cdp-header "Authorization: Bearer <token>"), and --cdp-timeout. The CDP headers and timeout can also be set via the PLAYWRIGHT_MCP_CDP_HEADERS (one Name: Value entry per line) and PLAYWRIGHT_MCP_CDP_TIMEOUT environment variables.
If CDP attachment times out after the WebSocket connects, an existing tab may be blocking Playwright initialization (upstream report). The pinned Playwright 1.65.0 fixes the crashed-renderer attach hang and omits crashed tabs, as tests/cdp-attach.integration.test.ts verifies. A genuine native proactive-discarded tab is different: attachment completes and healthy tabs remain usable, but the discarded tab is still exposed. The strict headed gate in tests/cdp-discard.integration.test.ts records that unresolved omission requirement without reloading the tab or changing its native discard state.
For --cdp-endpoint, use an explicit positive --cdp-timeout to bound initialization; 0 disables it and attachment can wait forever. --cdp-launch-startup-timeout bounds the whole launched-application attempt, with each attachment also bounded by --cdp-timeout. On failure, launch mode stops only its own application. noDefaults and --isolated do not skip initialization of existing tabs. If a tab blocks attachment, reload or close it yourself, or attach to a separate disposable browser; the server does not close or reload browser-owned tabs to repair attachment. See the verification notes.
Playwright does not support back/forward-cache (BFCache) restoration: an attached browser with BFCache enabled can return unusable references and omit iframe contents after back navigation. This was reproduced with full Chromium, Chrome, and Edge on Playwright 1.63.0, and again with full Chromium 158 on the pinned Playwright 1.65.0 (MCP_TEST_ENABLE_BFCACHE=1). For a browser you launch yourself, include --disable-back-forward-cache before attaching, or use the server's normal browser launch mode, which retains Playwright's default flag. The server does not change an attached browser's flags or replace back navigation with a reload. See the upstream maintainer's explanation, Playwright's BFCache limitation, and the verification and reproduction command.
CDP attachment excludes unsupported shared_worker targets from Playwright's browser-level auto-attach. Chromium 158 can otherwise crash when another inspector retains a terminated shared worker. Application shared workers keep running; tests/cdp-worker.integration.test.ts checks live-worker messages, healthy-tab state and follow-up browsing in both bundled headless shell and full Chromium. A nonce-protected loopback relay retains Playwright's standard URL-based remote file-upload behavior. Channel lookup, HTTP discovery and the upstream WebSocket transport reuse exported internals from the pinned Playwright version, so dependency updates must revalidate these contracts.
HTTP listeners accept Host headers for loopback aliases, the bound non-wildcard address, and the configured hostname (--host, server.host, or PLAYWRIGHT_MCP_HOST). A named host must resolve to an address on the server to bind; other hostnames remain forbidden. Wildcard binds (--host 0.0.0.0 or --host ::) do not allow arbitrary hostnames or the wildcard address itself: use a loopback hostname or bind a specific hostname/address. Missing or invalid Host returns 400; disallowed hosts return 403. When present, Origin must use HTTP and exactly match the normalized Host hostname and port; HTTPS or a different authority returns 403. These checks also apply with bearer authentication, which still requires a loopback listener.
For remote HTTP access, configure the TLS reverse proxy explicitly. For example, with the MCP server bound using --host 127.0.0.1 --port 8931 and PLAYWRIGHT_MCP_AUTH_TOKEN set:
- Accept only your configured public hostname over HTTPS and forward
/mcptohttp://127.0.0.1:8931/mcp. - Set the upstream
Hostheader to127.0.0.1:8931, not the public hostname. Forward the client'sAuthorizationheader unchanged; do not inject a shared token for unauthenticated clients. - Before removing
Origin, reject any non-empty value outside your explicit trusted HTTPS origin list (for example,https://mcp.example.com). Allow absentOriginfor non-browser clients. Then removeOriginupstream, or rewrite it tohttp://127.0.0.1:8931. Never strip arbitrary origins without checking them first. - Disable response buffering for SSE streams. Browser clients on a different origin also need a narrowly scoped CORS policy at the proxy.
The server does not trust Forwarded or X-Forwarded-* to bypass its checks. Preserving the public Host or HTTPS Origin upstream returns 403, even with a valid bearer token.
Unexpected HTTP request setup failures, including stateful initialization, return a generic error with HTTP status 500. Parsed legacy JSON-RPC requests retain their IDs, batch errors omit notifications, and notification-only failures have an empty response body. Failed or rejected initialization disposes its unregistered backend. If the request body is still unread or the response has already started, the connection is closed instead of remaining available for reuse.
Caller-supplied screenshot, PDF, find-result, scan-page-matrix, and audit report filenames use a no-clobber policy: an existing file causes the tool call to fail instead of being overwritten. Windows-reserved basenames and names ending in a dot or space are rejected on every platform so configured names behave consistently across hosts.
Failed download saves are reported as tool errors in the current or next response, including after the tab closes; failed entries do not advertise a saved file or an ongoing download. The server retains up to 20 bounded error messages between responses and reports any omitted count. Full Chromium-family browsers on Playwright 1.63.0 had verified native crashes after persistent-profile relaunch. On the pinned Playwright 1.65.0, bundled Chromium 158 relaunched and saved downloads on Linux; Chrome for Testing 153.0.8010.12, a build already on that crash list, still crashed. Branded Chrome and Edge are checked by the Windows CI matrix. Error reporting does not fix a native crash. The explicit --isolated control passed, but does not preserve a profile between launches; use recorded storage state when needed for authentication. Existing profiles and browser defaults are preserved.
Use --timeout-settle or PLAYWRIGHT_MCP_TIMEOUT_SETTLE to override the post-action settle delay. CLI values take precedence over environment and file configuration, including 0. Empty or whitespace-only numeric timeout environment variables are ignored, preserving file configuration or defaults. The default remains 500 ms. Zero skips the settle delay and briefly allows pending browser events to arrive. The server still waits for observed requests and main-frame navigations, but can return before delayed page updates.
Use --timeout-idle 300000, timeouts.idle, or PLAYWRIGHT_MCP_TIMEOUT_IDLE to release the default browser after five idle minutes. Shared contexts stay open while any client is working; the idle window starts after the last tool call or download finishes. Explicit recordings prevent idle release until browser_stop_recording finishes; passive --save-session capture does not. Cleanup finalizes traces. The next browser tool call reopens the connection and includes a note to navigate again and refresh element references. Attached CDP, extension, and VS Code browsers are disconnected; their external pages remain open. Close and session-management tools and get_scan_findings do not relaunch an idle browser. Explicit browser_session_open handles keep their separate PLAYWRIGHT_MCP_BROWSER_SESSION_TTL_MS behavior. Zero disables this feature; blank environment values leave the existing configuration unchanged.
The VS Code browser_connect tool accepts only playwright or playwright-core libraries and loopback WebSocket URLs. connectionString and lib are optional strings: send both, non-blank, to switch providers, or omit both to disconnect. Supplying only one of them, a blank value, null, or only unrecognized fields is rejected and keeps the current provider. Set PLAYWRIGHT_MCP_VSCODE_ALLOW_REMOTE=1 to allow remote endpoints, which must use wss:. URL userinfo credentials are rejected.
HTTP Heartbeat
When the server runs with --port, it sends MCP heartbeat pings after a Streamable HTTP client opens the optional event stream. POST-only clients stay connected without heartbeat because server-initiated requests cannot reach them. Set PLAYWRIGHT_MCP_PING_TIMEOUT_MS to override the default 5000 ms timeout, or to 0 or any negative value to disable heartbeat pings. A client that answers ping with a JSON-RPC "method not found" error is treated as alive: the server stops heartbeating that session instead of closing it. Only an unanswered ping (timeout) or a transport failure closes the session. Independently of the heartbeat, an Mcp-Session-Id session with no request in flight and no open event stream expires after 30 idle minutes, so a client that disappears without sending DELETE does not hold its browser forever; every request restarts that window, and a client whose session expired gets 404 Session not found and must initialize again.
Clients without the initialize handshake
Clients on the MCP 2026-07-28 revision no longer send the initialize handshake. With --port, requests carrying the revision's per-request _meta envelope are served natively on the 2026-07-28 protocol: server/discover is answered (so clients negotiating with versionNegotiation: 'auto' or a 2026-07-28 pin connect directly), results carry resultType and the SEP-2549 cache fields — dynamic browser tool lists use the conservative ttlMs: 0 default instead of a one-hour cache — and the SEP-2243 standard headers (MCP-Protocol-Version, Mcp-Method, Mcp-Name) are validated against the request body. Older handshake-free clients (2025-era requests without the envelope) are served statelessly as before. In both cases requests receive no heartbeat pings, and in the modes where the server creates browser contexts itself each request runs against a fresh default browser session: with the default persistent profile the per-request default context runs in its own disposable profile (like an explicit browser session), so parallel handshake-free requests do not contend for the stable profile — and the stable profile's sign-in state is not visible to them — while --isolated, remote endpoints and isolated CDP modes mint a fresh context per request anyway. Modes that reuse one live browser context are the exception: --extension (and a browser_connect or VS Code session switched to a connected-browser provider) and CDP attach without --isolated serve every handshake-free request from the same shared context, so its tabs, cookies and storage persist across requests — the same sharing that makes these modes refuse browser_session_open (in --vscode serving the session tools are the exception: they are host-scoped and keep running against the default provider even while switched — see Browser Session Tools). With a pinned --cdp-launch-port, only one launched application can be served at a time, so a second handshake-free request arriving while another request's browser context is still live is rejected with a clear error instead of silently attaching to the first request's application. With --user-data-dir, each handshake-free request launches a browser in the one configured profile: the profile's state persists across requests, and parallel requests contend for its browser lock and can fail with "Browser is already in use". Elsewhere, browser state that must persist across handshake-free requests belongs in an explicit browser session — a browserSessionId handle minted by browser_session_open in one request resolves in later ones (see Browser Session Tools). Clients that do send initialize keep the classic Mcp-Session-Id session behavior unchanged. When several such stateful clients are connected at once in the default persistent-profile mode, the first client's default context holds the stable profile — concurrent clients' default contexts run in their own disposable profiles (without the stable profile's sign-in state) until it is freed, instead of failing with "Browser is already in use".
Auditing pages behind a login
Most real audits target pages that only exist for a signed-in user. There are two ways to get there.
Interactive route (no setup)
Keep every step in the same browser session. Within that session, audit_site crawls in a temporary tab of the same browser context, so cookies and local storage created while you drive the browser are available to the crawl:
1. browser_navigate to the login page
2. browser_fill_form / browser_click to sign in
3. browser_navigate to the first page you want audited
4. audit_site — the crawl inherits the session you just created
The interactive CLI, stdio MCP and initialized stateful HTTP connections can use their default session for this sequence. Handshake-free HTTP clients must call browser_session_open first and pass the returned browserSessionId to every navigation, interaction and scan call when using a mode that creates contexts per request. Otherwise the next request starts a new default context and loses the login and page state. Shared-context modes such as --extension and non-isolated CDP attach reject browser_session_open; use their shared context or a stateful connection instead. See Browser Session Tools for mode-specific behavior.
With the default persistent profile, sign-in state also survives across server restarts, so you usually only sign in once. The default profile is keyed to the server's working directory, so each workspace's server keeps its own sign-in state — servers launched for different workspaces neither share cookies nor contend for the same profile.
When a login form does not advance
browser_fill_form stops when a field opens a native dialog or file chooser,
returns the modal-handling guidance, and reports how many later fields were not
attempted. After handling the modal, submit those remaining fields again; the
form does not resume filling them in the background.
- Take a fresh
browser_snapshotafter a rerender and use its current field references. Wait for an application-specific ready message withbrowser_wait_forbefore entering data. browser_fill_formand ordinarybrowser_typeuse Playwright'sfill. If the application requires individual key events, clear the field withbrowser_typeandtext: "", then usebrowser_typewithslowly: true. Slow typing appends characters; it does not clear an existing value.- Verify an authenticated page or account-specific element before scanning. A filled field or successful click is not proof of a successful login. Inspect
browser_console_messagesandbrowser_network_requestsif submission fails; avoid sharing passwords, tokens or private response bodies in bug reports. - In Docker, the browser runs inside the container:
localhostnames the container, not your host's development server. Use a host address reachable from that container and configure the development server to accept that specific address. Check its bind address, allowed hosts and authentication origin/redirect settings; do not disable host checks or widen CORS as a blanket fix.
Direct DOM value assignments can bypass application event handlers, and synthetic setters are not a general fix for controlled inputs. Report the scanner version, browser mode, exact tool arguments (with secrets removed) and a minimal local reproduction if the standard interactions still fail.
Storage state route (repeatable, CI-friendly)
Record a session once with Playwright's codegen, then hand the file to the server:
npx playwright@1.65.1 codegen --save-storage=auth.json https://example.com/login
Sign in in the opened browser, then close it — auth.json now holds the cookies and local storage.
Pass it to the server with the CLI flag, the environment variable, or the config file:
npx --allow-scripts=re2 mcp-accessibility-scanner --isolated --storage-state ./auth.json
PLAYWRIGHT_MCP_ISOLATED=true PLAYWRIGHT_MCP_STORAGE_STATE=./auth.json npx --allow-scripts=re2 mcp-accessibility-scanner
{
"browser": {
"isolated": true,
"contextOptions": {
"storageState": "./auth.json"
}
}
}
Every supported mode handles the state — by applying it or refusing it.
Existing-context safety restriction: importing into an existing context is rejected before taking a rollback snapshot or resetting any storage. On Playwright 1.63.0, snapshot capture could execute service-worker-served scripts for a previously visited origin whose tab was no longer open (upstream fix). The restriction is kept on the pinned Playwright 1.65.0 until that path is revalidated. Use a fresh context, or omit
--storage-stateand sign in interactively. Service workers are not disabled. Lifting it also requires passing the recorder/shared-client checks in #218 and IndexedDB checks in #224.IndexedDB
MapandSetrecords: Playwright 1.63.0 lostMapandSetcontents instorageState({ indexedDB: true }), restoring them as empty plain objects (upstream fix). On the pinned Playwright 1.65.0, bothnewContext({ storageState })andsetStorageState()preservedMapandSettypes and entries with Chromium 158.0.8127.18, Firefox 159.0 and WebKit 27.2 on Linux. The real-browser regression intests/browser-failures.integration.test.tschecks that rejecting an import leaves the original Map/Set records intact and that isolated JSON IndexedDB imports still work.
- Fresh-context modes (
--isolated, the remote-endpoint mode, or either CDP mode combined with--isolated): the context is created with the storage state directly.- Default persistent-profile mode with
--storage-state: the session runs in a fresh, disposable profile — unique to that session and removed when it closes — built from the state, so the recorded state is provably the only session data (without--storage-statethe regular persistent profile is used and survives restarts, as before). Any page the launch opened (for example from a URL inbrowser.launchOptions.args) is parked on a blank replacement before the state lands, then the replacement is navigated to the same URL, so a still-running anonymous page cannot overwrite the recorded identity and a scan never reads its DOM. This also means--storage-statecannot be combined with--user-data-dir(a user-supplied profile carries its own session and will not be wiped; the server refuses the combination).- CDP modes without
--isolatedand the VS Code provider:--storage-stateis rejected when the browser already has a context. Add--isolatedin CDP mode to create a fresh context; otherwise omit the state and sign in interactively. If the browser exposes no context, the server creates one with the state. CDP sessions joining that same server-created context inherit its live state without resetting it.--extension(with or without--isolated) refuses storage imports entirely: it works through the browser you are already running, where wiping cookies to install a recorded state is not an acceptable side effect, so the server refuses to start rather than doing that silently. There, sign in interactively instead — the persistent profile also keeps the session across restarts.
Keep the crawl from destroying its own session
audit_site excludes logout|signout by default, which is not enough for most applications. Add anything else that ends or changes the session before you start the crawl:
{
"excludePathPatterns": ["logout|signout", "account/(close|delete)", "sessions/revoke", "/switch-(locale|account|org)"]
}
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. 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.
Available Tools
Page-registered WebMCP tools
When the current page exposes a supported WebMCP API, MCP tools/list includes its tools as webmcp_<name>_<identity> alongside built-in tools. In --extension mode without PLAYWRIGHT_MCP_EXTENSION_TOKEN, listing never starts the extension connection, since that waits for your approval: page tools are listed once a browser tool call has connected it, and stateless (handshake-free) requests need the token to list them at all. Use the exact returned name: names are scoped to the browser session, frame/document and registration, and stale names are rejected rather than redirected to another action. Because of that, --allowed-tools / --blocked-tools cannot select them. No browser flags or polyfills are installed automatically.
To discover or invoke tools in an explicit browser session, put its handle in request metadata (params._meta.browserSessionId) on both tools/list and tools/call. This is separate from params.arguments: page-defined browserSessionId and _meta arguments are preserved unchanged. Without routing metadata, discovery and invocation use the default session. Session handles are never enumerated by discovery. Listing holds its session against closure or expiry until discovery completes or the request is cancelled.
Names, descriptions, schemas, results and page errors are untrusted. Every page tool retains conservative action annotations even if the page claims it is read-only. Calls are bounded and cancellable, but a timed-out or cancelled page action may still be running; do not retry it blindly. Stateful connections receive deduplicated list-change notifications for their last listed scope; stateless clients should re-list rather than cache the result.
Native Chromium WebMCP invocation supports the JSON-string contract in Chromium 153 and the object-input contract verified in Chromium 156, including external CDP connections. The bridge selects the contract from the native method's signature before invocation; page-provided JavaScript shims keep JSON-string inputs. An invocation error never triggers an automatic retry.
Stateful proxies buffer catalog changes until pending tool listings return, including changes arriving just as a listing finishes, so refresh notifications follow the returned catalog.
See WebMCP usage, limits and tests for request examples, discovery limits and validation commands. Page descriptors must pass the MCP SDK’s tool-schema validation, and their input schemas must compile with the validator that later checks call arguments, before publication. Schemas that define pattern or patternProperties subschemas, or declare a root type other than object, are omitted; format keywords are advertised but left for the page to enforce, and argument validation is interrupted after 500 ms. An empty listing is not proof that the page has no tools: unsupported, invalid or timed-out registrations are omitted.
Built-in tools
The MCP server provides comprehensive browser automation and accessibility scanning tools:
Core Accessibility Tools
scan_page
Performs a comprehensive accessibility scan on the current page using Axe-core.
Parameters:
violationsTag: Array of WCAG/violation tags to checkincludeIncomplete(defaulttrue): also report Axe "incomplete" resultsretainFindings(defaultfalse): keep all deduplicated findings in memory; the inline sample stays capped. To retrieve those findings later,get_scan_findingsmust also be enabled for the clientmaxNodesPerViolation(1–50, default10): cap on node details reported per rule; occurrence totals use all deduplicated findings, not the capped sampleincludeSelectors/excludeSelectors: CSS selectors that scope the scanwithRules/disableRules: Axe rule ids that narrow which rules runannotateScreenshot(defaultfalse): capture an annotated screenshot of the violations
Annotated screenshots:
When annotateScreenshot is true, each violating element is outlined and labelled with the rule ids it failed, a full-page PNG is written to the MCP output directory (scan-page-annotated-{timestamp}-{token}.png) and returned as a resource link, and the markers are then removed so the page is left exactly as it was. The markers are drawn in an out-of-flow overlay clipped to each element's own box, so they never reflow the page. The overlay uses a fresh id per scan, is placed in the browser's top layer so it stays visible over an open dialog, popover or fullscreen element, and compensates for a CSS zoom or a scaled ancestor so markers line up with what is rendered.
An element that fails several rules gets one box listing every rule id, and elements inside open shadow roots are marked by walking the shadow path Axe reports.
Running animations are frozen at their current time before the elements are measured and resumed after the capture, so a moving target keeps its marker. The markers themselves live in a shadow root under an overlay whose own styles are !important, so page CSS cannot restyle or hide what the report counts, and each rule label sits outside the clipped box so it stays readable on an element smaller than its own label.
At most 50 elements are annotated per scan. The result text always reports how many nodes were marked out of the total, plus how many were left out because they exceeded the limit, were hidden, zero-size or off-canvas (a full-page screenshot is clipped to the document box), or were inside an iframe (cross-frame selectors cannot be resolved from the top document).
Supported Violation Tags:
- WCAG standards (in the default set):
wcag2a,wcag2aa,wcag2aaa,wcag21a,wcag21aa,wcag21aaa,wcag22a,wcag22aa,wcag22aaa - Section 508 (in the default set):
section508 - Categories (opt-in):
cat.aria,cat.color,cat.forms,cat.keyboard,cat.language,cat.name-role-value,cat.parsing,cat.semantics,cat.sensory-and-visual-cues,cat.structure,cat.tables,cat.text-alternatives,cat.time-and-media - Non-conformance tags (opt-in):
best-practice,experimental(see the caveat below -- a few experimental rules also carry a WCAG tag and run by default)
The default set is the WCAG and Section 508 tags only, so a default report means "this fails a conformance criterion". Category tags are opt-in for that reason: Axe matches requested tags with OR, so asking for cat.keyboard also pulls in best-practice rules such as region and skip-link that carry both tags. No live conformance rule is lost by leaving them out: the only rules reachable only through a cat.* tag are duplicate-id and duplicate-id-active, which Axe marks deprecated because WCAG removed SC 4.1.1. Add best-practice (landmark structure, heading order, tabindex hygiene) or a cat.* tag when you want that broader review.
The same OR semantics apply to experimental, with one deliberate exception: four experimental rules -- css-orientation-lock (SC 1.3.4), p-as-heading, table-fake-caption and td-has-header (SC 1.3.1) -- also carry a wcag* tag and so run in the default set. In Axe, experimental describes how settled the heuristic is, not whether the criterion is real, so these are kept rather than filtered out. Adding the experimental tag pulls in the remaining experimental rules, which have no conformance tag of their own. Axe 4.14 no longer marks label-content-name-mismatch (SC 2.5.3) as experimental; it still runs by default.
Scan scoping:
scan_page, audit_site, and scan_page_matrix accept includeSelectors and excludeSelectors to limit what Axe looks at. Use includeSelectors to audit one component (["#checkout-form"]) and excludeSelectors to drop third-party noise that pollutes every report (["#cookie-banner", "iframe.intercom-frame"]). Exclusions are applied after inclusions, so you can carve a widget out of an included subtree.
Selectors are resolved before the scan runs:
- Syntactically invalid CSS fails the scan, naming the selector.
- An
includeSelectorsentry that matches nothing fails the scan. Axe on its own would accept a partly-matching include set and quietly scan less than you asked for, so the scanner refuses rather than returning a clean-looking report with half the scope missing. - An
excludeSelectorsentry that matches nothing is a no-op, not an error -- a crawl legitimately visits pages that lack the excluded widget.
In audit_site, selectors apply to every crawled page, so an includeSelectors value that is absent from a given page marks that page as errored in the report while the crawl continues. Link discovery runs before the scan, so pages reachable only through an errored page are still crawled.
Rule-level control:
scan_page, audit_site, and scan_page_matrix accept withRules and disableRules to pick individual Axe rules instead of whole tag sets. Use withRules to re-check one rule after a fix (["color-contrast"]) and disableRules to mute a rule you have already triaged (["region"]). Rule ids are the ones Axe reports (image-alt, color-contrast, ...); see the Deque rule reference.
withRulesoverridesviolationsTag. Axe can run either a rule list or a tag list, never both, so whenwithRulesis set the tags are ignored entirely --withRules: ["image-alt"]runs exactly that one rule regardless ofviolationsTag. Rule ids are the more specific request, so they win.disableRulessubtracts from whatever is selected. It applies toviolationsTagandwithRulesalike. (Axe itself ignores disabled rules once you give it an explicit rule list; the scanner subtracts them up front so the two options mean the same thing together as apart.) Disabling every rule inwithRulesis an error rather than an empty scan.- An explicitly empty
withRulesis an error too.withRules: []selects no rules, and silently falling back to the tag set would run a different scan than the one requested — omit the option to scan by tags instead. Clients that build the list dynamically should drop the key when the list comes out empty. - Unknown rule ids fail the scan, naming the id. Both options are checked against Axe's rule catalogue before the browser is touched, so a typo is reported as
Unknown Axe rule id(s) in withRules: image-alttrather than surfacing later as anframe.evaluatefailure from inside the page. Rule ids apply to a whole run, soaudit_siteandscan_page_matrixcheck them once before they touch the page -- a bad id fails the call outright instead of crawling every URL, or reloading and re-emulating the page, before rejecting the argument.
audit_site and scan_page_matrix record both values in their JSON report metadata, so a stored report can be told apart from a full scan.
Incomplete ("needs review") results:
Axe returns incomplete for checks it cannot decide on its own -- contrast over a background image or gradient, ambiguous labels, elements it could not fully evaluate. scan_page, audit_site, and scan_page_matrix report these in a section separate from violations so you can resolve them by inspecting the page (screenshot, snapshot, browser_evaluate). Set includeIncomplete: false to suppress their detailed findings. In matrix scans, this does not disable the comparison-validity checks described below.
Frames that could not be scanned:
Axe is installed into every frame of the page before the scan runs. A frame that navigates mid-injection, or whose renderer does not answer within a second, is left out -- and its contents then contribute no findings. Rather than let that pass as a clean result, all three scan tools print a WARNING: Axe could not be installed in N frame(s) block listing the frame URLs, and audit_site and scan_page_matrix also record them per page and per variant in their JSON reports (unscannedFrames) and in structuredContent. A frame that was still loading usually succeeds on a re-run; one that fails consistently has to be audited on its own.
A nested frame is reported when any frame above it went unscanned, even if its own injection succeeded: Axe reaches a nested document only by relaying through the frames above it, so an outer frame without Axe takes everything below it out of the scan.
A frame you scoped out yourself is not reported: with excludeSelectors: ["iframe.intercom-frame"] that widget failing to load is the outcome you asked for, not a gap. Scope is resolved through the whole frame chain and across shadow boundaries, so an includeSelectors entry naming an ancestor still covers frames nested several levels below it or inside a shadow root, and excluding an outer frame or a shadow host silences everything inside it. Anything the check cannot resolve is reported rather than hidden.
get_scan_findings
Use this read-only tool to page through the evidence from one observation, even after navigating away. It reads memory, not the current page. Start with:
scan_page {"withRules":["image-alt"],"maxNodesPerViolation":2,"retainFindings":true}
get_scan_findings {"scanId":"<returned scanId>","ruleId":"image-alt","outcome":"violation","offset":0,"limit":25}
An opted-in scan returns an opaque scanId in text and in MCP structuredContent, alongside a structured rules index of {ruleId, outcome, count}. Counts are deduplicated nodes before the inline cap. Outcomes are violation and incomplete; with includeIncomplete: false, incomplete entries are neither indexed nor retained. Passes and inapplicable rules have no retained nodes.
Lookup returns the original Axe target, html, and failureSummary for each node in scan order, subject to configured URL-parameter redaction. Use nextOffset for the next request; null means finished. The zero-based offset defaults to 0 and must not exceed total. The integer limit defaults to 10 and must be 1–50.
Only the latest successfully retained scan in the same browser session is available. A new retained scan replaces it; navigation, ordinary scans, and failed or cancelled scans do not. Closing or expiring the session, or restarting the server, loses the evidence. Pass the same browserSessionId if one was used for the scan; stateless HTTP requires an explicit session. Unknown, replaced and foreign scan IDs all return the same unavailable error. No scan report file is written. As with other tools, --save-session logs the returned text when enabled, but replaces scan IDs with redacted labels. If the rule index and node records exceed 1 MiB of UTF-8 JSON, the scan still returns its inline results and counts, but scanId is null with a reason. No partial evidence is retained and any previous retained scan remains available.
Audit Tools
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
concurrencypages at once (default4, max8), 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 (benchmark crawl caps of 6 and 12 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 anddiscoveredFrom, and the aggregated findings are the same as withconcurrency: 1. Useconcurrency: 1when pages depend onsessionStoragewritten 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, andprovidedURL strategies. Trailing slashes are preserved; sitemap locations decode XML entities while preserving literal CDATA content. - The
sitemapstrategy accepts a flaturlsetor asitemapindex. It expands nested indexes breadth-first in listed order and fetches each distinct manifest URL once. Only page entries from the URL sets participate inmaxPagesandpageSelection; child manifests and extension locations (such as images) do not. Each selected page’sdiscoveredFromidentifies the first URL set that listed it, after manifest redirects. - The root sitemap, every child, and every redirect must pass the server network policy, crawl origin and path exclusions. Fetches run on the MCP host over HTTP(S) without browser cookies or auth headers. Expansion shares a 15-second timeout, 64 HTTP requests (including redirects), and 10 MiB of XML across all manifests, with at most 20 redirects per chain. An unreadable manifest or exceeded limit fails the audit before any page is scanned; no partial report is written. Browser proxy settings,
browser.remoteEndpoint,browser.cdpEndpoint(including loopback endpoints, which may tunnel to remote browsers),--extension, switchedbrowser_connectproviders, and custom contexts fromcreateConnection(config, contextGetter)are rejected for this strategy; useprovidedURLs 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-pagesummary.totalNodes,byImpact, andbyRuleIdcount all deduplicated violation nodes;maxNodesPerViolationonly limits the saved node details. pageSelectiondecides which listed URLs fillmaxPageswhen asitemaporprovidedlist is longer than the budget.discovery(default) takes them in listed order.representativebuilds a tree of the listed URLs by host, path segment, and then query parameter. Numeric, UUID, and long hex segments and values are masked, so/products/1and/products/2(or?id=1and?id=2) share a template, while?page=homeand?page=checkoutdo not. URLs that share a template are treated as interchangeable. Fragment routing and client-side state cannot be told apart.- Coverage rule: when the pages allotted to a group of URLs (a host, a path prefix, or a query level) are at least the number of its branches, every branch gets a page. With
maxPagesat least the number of top-level sections, every section is scanned. - k-median for the rest: remaining pages minimize the summed tree distance from every listed URL to its nearest scanned one, and the selection is solved exactly under both rules. Below the coverage threshold, k-median weighs groups by how many URLs they hold, so a populous section can take pages that a small one does not get. This optimizes URL coverage, not accessibility coverage: pages with the same template can still differ in content.
- The selected URLs are scanned in their listed order, and the rest count as
skippedUrls. The result says how many listed URLs the selection chose from, and the JSON report and structured content carryrepresentativeSelection: { candidates, selected, complete }(nullin discovery order). Selection work is bounded: when a very long or deeply nested list would exceed that budget, the firstmaxPagesURLs are queued in listed order instead,completeisfalse, and the result starts the selection line withWARNING:. It is rejected for thelinksandnavstrategies, which only learn their URLs while crawling.
- Coverage rule: when the pages allotted to a group of URLs (a host, a path prefix, or a query level) are at least the number of its branches, every branch gets a page. With
- Each aggregated violation also reports
similarPatterns: its unique occurrences grouped by near-identical markup. This is a markup heuristic, not a count of root causes: similar markup often means a shared template, but it does not prove one fix covers every node.- What counts as one pattern: two nodes can share a pattern only when their root element, its
type(inputs default totext), and itsrolematch. Embedded separators in attribute values or text cannot bypass the semantic or token comparisons. Within that, they share one when their HTML differs in under about 30% of its tokens (tag names, attribute names and values, text words). Only the first 48 tokens of each node are compared, so differences past them are not seen. - Order independence: similarity is not transitive, so each rule's unique occurrences are grouped in a canonical sort order. The count depends only on which occurrences were found, not on crawl order.
- Limits: at most 500 unique occurrences (the first in that order) and 50 patterns are grouped per rule. When either limit cuts in,
similarPatternsCappedistrue, the count covers only part of the occurrences, and the top-violations line readsN patterns (partial)instead ofN patterns. - Up to three
sampleNodesper rule show different patterns where there are several.
- What counts as one pattern: two nodes can share a pattern only when their root element, its
- After browser navigation settles, the reached URL is checked again against HTTP(S),
sameOriginOnly,includeSubdomains, andexcludePathPatterns. A destination outside that scope is recorded as a page error naming the requested and reached URLs; it is not scanned or used for link discovery, and the crawl continues. This is a post-navigation check, not a network-request blocker: redirect destinations may already have been contac
Frequently asked questions
What is mcp-accessibility-scanner MCP Server?
MCP server for automated web accessibility scanning with Playwright and Axe-core.
How do I install mcp-accessibility-scanner MCP Server in Claude Desktop, Cursor, or VS Code?
Pick your client in the Install section on this page and copy the generated config into the client's config file. Step-by-step guides: Claude Desktop, Cursor, and VS Code. mcp-accessibility-scanner MCP Server runs locally from the npm package mcp-accessibility-scanner with the command npx -y mcp-accessibility-scanner@1.1.1.
Is mcp-accessibility-scanner MCP Server free and open source?
Yes. mcp-accessibility-scanner MCP Server is released under the MIT license, an OSI-approved open-source license, so you can use, modify, and self-host it under those terms.
Does mcp-accessibility-scanner MCP Server support remote (HTTP) connections?
No remote endpoint is listed for mcp-accessibility-scanner MCP Server. It runs locally on your machine over stdio, started by your MCP client.
What tools does mcp-accessibility-scanner MCP Server provide?
mcp-accessibility-scanner MCP Server provides 26 tools, including browser.allowedUploadDirs, browser.browserName, browser.cdpEndpoint, and browser.cdpHeaders. See the full tool list for descriptions and parameters.
How is mcp-accessibility-scanner MCP Server's trust score calculated?
mcp-accessibility-scanner MCP Server scores 42 out of 100 (Fair). The score adds six capped public signals: registry status, maintenance, popularity, license, documentation, and security. Nobody can pay for points. Read the methodology for the full formula.
Reviews
No reviews yet—Be the first to review
No published reviews yet. Used it? Tell the next person how it went.
Sign inA verified email is required to review this server.
Add badge to your README
Paste either snippet into the repository README. The image links to this listing.

