Skip to main content
Developer documentation

Run full WCAG 2.2 AA browser audits in your terminal, CI, or IDE.

Everything you need to run @wcagbench/cli, embed @wcagbench/engine, or connect the MCP server to Claude Code and Cursor. Free for personal and non-commercial use; commercial license required for commercial products or paid agency client work.

CLI

1. Quickstart with @wcagbench/cli

Scan any URL with real headless Chromium across desktop, mobile, 320px zoom, keyboard navigation, modals, hover tooltips, clickable divs, and form validation. Test it right now against our public WCAGBench 55/55 suite:

# Run a full WCAG 2.2 AA browser audit
npx @wcagbench/cli scan https://wcagbench.com/wcagbench/suite

# Fail CI (exit code 2) if any critical or serious barriers exist
npx @wcagbench/cli scan https://yoursite.com --fail-on serious

# Output structured JSON for custom pipelines
npx @wcagbench/cli scan https://yoursite.com --json > wcag-report.json
Library

2. Programmatic Engine API (@wcagbench/engine)

Import runWcagDiscovery in Node.js or Playwright test suites to get a typed score, layer counts, overlay widget detection, and element-level selectors.

import { runWcagDiscovery } from "@wcagbench/engine";

const report = await runWcagDiscovery("https://staging.yoursite.com", {
  timeoutMs: 25000,
  extraHttpHeaders: { Authorization: "Bearer staging-token" },
});

console.log({
  score: report.score,                 // 0..100 diminishing curve
  detectedOverlay: report.detectedOverlay, // e.g. "accessiBe" | null
  layerStats: report.layerStats,       // desktop, mobile, keyboard, reflow, flows
  issueCount: report.issues.length,
});
Coverage

3. Real-browser WCAG 2.2 AA checks beyond static HTML

Every scan combines standard WCAG 2.0/2.1/2.2 A & AA DOM rules with deterministic behavioral simulations that static linters skip:

sim-keyboard-trap2.1.2 (A)

Repeated real Tab presses detect focus trapped on a single DOM node.

sim-focus-not-visible2.4.7 (AA)

Inspects live computed outline and box-shadow on every focused control.

sim-focus-obscured2.4.11 (WCAG 2.2 AA)

Detects fixed or sticky overlays covering the active focused control.

sim-focus-order-jump2.4.3 (A)

Catches document-relative backwards focus jumps caused by CSS reordering or positive tabindex.

sim-reflow-horizontal-scroll1.4.10 (AA)

Resizes to 320px CSS width (400% zoom) to catch horizontal scroll overflow.

sim-text-spacing-clipped1.4.12 (AA)

Injects W3C line-height/letter/word spacing overrides to catch fixed-height text clipping.

sim-text-resize-clipped1.4.4 (AA)

Scales root typography to 200% to catch truncated containers.

sim-target-size-minimum2.5.8 (WCAG 2.2 AA)

Measures interactive touch hit boxes under 24x24 CSS pixels at 390px mobile.

sim-modal-focus-not-moved / escape2.1.1 & 2.4.3 (A)

Clicks dialog triggers to verify focus moves inside and Escape closes cleanly.

sim-hover-only-content1.4.13 (AA)

Hovers tooltip triggers and verifies keyboard focus can also reveal them.

sim-clickable-div-unreachable2.1.1 (A)

Flags cursor: pointer <div>/<span> controls unreachable by Tab.

sim-nontext-contrast1.4.11 (AA)

Checks form input borders and fills against the 3:1 UI component contrast minimum.

4. MCP Server for Claude Code & Cursor

Generate a workspace API key in Studio Settings, then drop this block into your MCP config so your coding agent can scan staging URLs and pull the agent-ready fix list for each scan:

{
  "mcpServers": {
    "wcagbench": {
      "command": "npx",
      "args": ["@wcagbench/mcp"],
      "env": {
        "WCAGBENCH_URL": "https://wcagbench.com",
        "WCAGBENCH_API_KEY": "fa_your_workspace_key"
      }
    }
  }
}

5. AI Agent Registration & CAPTCHA-Free Scan API

WCAGBench is intentionally built to be AI-agent friendly with zero CAPTCHA walls. Autonomous agents, coding assistants, and research bots can self-register once at POST /api/agents/register (or discover capabilities at /.well-known/wcagbench-agent.json) to receive an X-WCAGBench-Agent-Key token and higher shared-IP rate limits (20 scans/hour vs 6/hour unregistered).

User email requirement: Every public scan requires the end user's email address to prevent compute abuse (we never sell email data). If you are an AI agent acting for a human, ask your user for their email first, then submit { url, email }.

# 1. Self-register your AI agent once (CAPTCHA-free)
curl -X POST https://wcagbench.com/api/agents/register \
  -H "Content-Type: application/json" \
  -d '{"agentName":"claude-code","vendor":"Anthropic","purpose":"wcag-audit"}'

# 2. Ask your human user for their email, then run a full 55-criterion browser scan
curl -X POST https://wcagbench.com/api/public/scan \
  -H "Content-Type: application/json" \
  -H "X-WCAGBench-Agent-Key: wba_your_agent_key" \
  -d '{"url":"https://yoursite.com","email":"[email protected]","includeAaa":false}'

6. GitHub Actions CI & REST API

Block pull requests with critical accessibility regressions in GitHub Actions, or trigger hosted multi-page scans using your Bearer API key:

# .github/workflows/wcag.yml
name: WCAG 2.2 AA Gate
on: [pull_request]
jobs:
  a11y:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/setup-node@v4
        with: { node-version: 22 }
      - run: npx playwright install --with-deps chromium
      - run: npx @wcagbench/cli scan https://preview.yoursite.com --fail-on critical
# List monitored sites or trigger a hosted scan via REST API
curl -H "Authorization: Bearer fa_your_workspace_key" \
  https://wcagbench.com/api/v1/sites
Agent-ready export

7. Export for your AI agent

Core WCAG 2.2 AA browser checks never require an AI key, and WCAGBench does not run AI on your behalf. Instead, download the audit as a work order your own agent (Claude Code, Cursor, Codex, ChatGPT) or developer can follow. Open a scan in Studio and choose Export audit for your AI agent. You get a Markdown file with instructions at the top and every failing element grouped by rule and ordered by severity (WCAG criterion, page URL, viewport, selector, HTML snippet, failure summary, what a correct fix looks like, stack-specific guidance, and a checkbox), plus JSON and CSV versions.

Agents and scripts can pull the same export over REST with a workspace API key from Studio Settings, or call the MCP tool export_audit (arguments: scanId, format).

# format is md, json, or csv
curl -H "Authorization: Bearer $WCAGBENCH_API_KEY" \
  "https://wcagbench.com/api/v1/scans/{scanId}/export?format=md" \
  -o wcagbench-audit.md

Then give your agent one line, for example: "Work through wcagbench-audit.md top to bottom, fix each item in the source, tick its checkbox, then tell me to rescan." Rescan in WCAGBench to verify the fixes.

Dual License

8. License: Free personal use vs. commercial license

Free · Non-Commercial

Personal, research & non-profit

Inspect, modify, and run @wcagbench/engine, the CLI, and the MCP server free of charge on your own personal or non-commercial websites, academic studies, and WCAGBench reproductions.

Paid Commercial License

Commercialization & agency use

Commercializing, reselling, white-labeling, embedding the code or models in a commercial product or SaaS, or delivering paid client compliance audits requires an active WCAGBench Agency plan ($69/mo) or a standalone Commercial Source License.

Developer Docs: CLI, @wcagbench/engine, MCP & API | WCAGBench