Architecture

WCAG-Guide is a Node.js application with four services orchestrated by Docker Compose.

Service diagram

┌─────────────────────────────────────────────────────────────────────┐ │ MCP Client (Claude Code, OpenCode, etc.) │ │ ── stdio ──► wguide mcp ── HTTP ──┐ │ └────────────────────────────────────┼───────────────────────────────┘ │ ┌────────────────────────────────────┼───────────────────────────────┐ │ Docker Compose ▼ │ │ ┌──────────────────────────────────────────┐ │ │ │ App Server (Node.js) :8080 │ │ │ │ ├─ REST API │ │ │ │ ├─ Dashboard (vanilla JS SPA) │ │ │ │ └─ Health check /healthz │ │ │ └──────────────────────┬───────────────────┘ │ │ │ SQL │ │ ┌──────────────────────▼───────────────────┐ │ │ │ PostgreSQL :5432 │ │ │ │ ├─ scan_targets, scan_runs │ │ │ │ ├─ findings, finding_instances │ │ │ │ └─ status_events, rule_metadata │ │ │ └──────────────────────▲───────────────────┘ │ │ │ SQL │ │ ┌──────────────────────┴───────────────────┐ │ │ │ Worker (Node.js) │ │ │ │ ├─ Polls for queued scan runs │ │ │ │ ├─ Playwright + axe-core scanner │ │ │ │ └─ Writes findings back to DB │ │ │ └──────────────────────────────────────────┘ │ │ │ │ ┌──────────────────────────────────────────┐ │ │ │ Demo Site (static) :8081 │ │ │ │ └─ Intentionally flawed HTML pages │ │ │ └──────────────────────────────────────────┘ │ └────────────────────────────────────────────────────────────────────┘

Data flow

  1. Scan target registration — A user or MCP agent creates a scan target via the REST API (site key + environment + branch + base URL).
  2. Scan run creation — A POST to /scan-runs queues a scan job. The job record includes scan options (max pages, depth, concurrency) and the compliance profile.
  3. Worker picks up job — The worker polls for queued runs, transitions them to running, and starts the Playwright browser.
  4. Crawl + scan — The worker crawls from the base URL, discovers internal links, and runs axe-core on each page. Findings are fingerprinted for deduplication.
  5. Results written — Finding instances are written to PostgreSQL. The worker computes diff states (new, persistent, resolved) by comparing with prior runs.
  6. Triage + remediation — Users or agents review findings in the dashboard or via MCP tools. Findings can be marked as in_progress, resolved, or ignored (with expiration).
  7. Rescan — Targeted rescans (page, path, or full) verify fixes without re-crawling the entire site.

Key design decisions

Directory structure

wcag-guide/
├── bin/                    CLI entry point
├── contracts/              OpenAPI spec, MCP tool schema
├── scripts/
│   ├── db/                 Database migrations
│   ├── dev/                Docker Compose helpers
│   ├── screenshots/        Screenshot capture script
│   └── mcp/                MCP demo workflow
├── site/                   GitHub Pages static site
├── src/
│   ├── app/                App server, REST API, dashboard
│   │   ├── public/         Dashboard HTML/CSS/JS
│   │   └── repositories/   PostgreSQL + InMemory repos
│   ├── cli/                CLI command parser
│   ├── mcp/                MCP server, adapter, catalog
│   └── worker/             Scan worker, crawler, scanners
├── test/                   Unit + integration tests
└── test-support/           Shared fixtures