DEV Community

vdalhambra
vdalhambra

Posted on

Automate WCAG accessibility audits with Claude: free AI-powered compliance checks

Accessibility isn't a nice-to-have anymore. The European Accessibility Act deadline passed June 2025. US ADA lawsuits targeting inaccessible websites are at an all-time high. And most of the fixes are surprisingly simple — you just need to know what's broken.

Here's how to run a WCAG accessibility audit in under 10 seconds, using Claude.

The tool

SiteAudit MCP is an MCP server that adds 11 audit tools to any AI agent. One of them is accessibility_audit — a WCAG 2.1 compliance checker.

What it checks (no browser rendering required)

Structural WCAG checks

  1. Language declaration (WCAG 3.1.1) — <html lang="en"> present?
  2. Heading hierarchy (WCAG 1.3.1, 2.4.6) — Exactly one H1? No skipped levels (H2 → H4)?
  3. Landmarks (WCAG 1.3.1) — Is there a <main> or role="main"?
  4. Skip links (WCAG 2.4.1) — "Skip to content" link present?

Content WCAG checks

  1. Image alt text (WCAG 1.1.1) — How many images lack alt attributes?
  2. Empty links (WCAG 2.4.4) — Links with no text or aria-label?
  3. Unnamed buttons (WCAG 4.1.2) — Buttons without accessible name?

Forms WCAG checks

  1. Input labels (WCAG 1.3.1, 3.3.2) — Every input has a <label for="id">, aria-label, or parent label?

What it can NOT check (requires rendering)

  • Color contrast ratios (needs computed styles) — use axe-core or Lighthouse for this
  • Focus indicators (needs visual check)
  • Keyboard navigation order
  • Live regions and dynamic content

For those, pair accessibility_audit with lighthouse_audit (which hits Google PageSpeed API) for full coverage.

Example output

Ask Claude: "Run an accessibility audit on gov.uk"

URL: https://www.gov.uk
Score: 94/100 (Grade: A)

Summary:
  Issues: 0 (no high-severity violations)
  Warnings: 2
  Passes: 6
  Images: 15 total, 15 with alt text
  Form inputs: 2 total, 2 with labels
  Headings: 12 total, 1 H1

Warnings:
  [medium] No <main> element or role='main' found
  [low] No skip navigation link detected (WCAG 2.4.1 Bypass Blocks)

Passes:
  ✓ lang_attribute: "en-GB"
  ✓ alt_coverage: All 15 images have alt text
  ✓ form_labels: All 2 inputs have labels
  ✓ single_h1: Exactly one H1 heading
  ✓ main_landmark: Implied via <article> wrapper

Note: Limited without browser rendering. For full audit 
(color contrast, focus, keyboard nav), use axe-core.
Enter fullscreen mode Exit fullscreen mode

Gov.uk is consistently one of the most accessible sites in the world — and even they have 2 low-severity warnings worth investigating.

Compare that to a problematic site

Ask: "Audit accessibility of [random e-commerce site]"

URL: https://example-shop.com
Score: 52/100 (Grade: D)

Summary:
  Issues: 4 (high severity)
  Warnings: 3
  Images: 75 total, 29 missing alt text
  Form inputs: 8 total, 3 unlabeled

Issues:
  [high] missing_lang: HTML element missing 'lang' attribute
    → WCAG 3.1.1 Language of Page

  [high] missing_alt: 46 of 75 images missing alt text
    → WCAG 1.1.1 Non-text Content
    → Coverage: 38.7%

  [high] unlabeled_inputs: 5 of 8 form inputs lack labels
    Examples: email, search-query, newsletter-email, postal-code, coupon
    → WCAG 1.3.1 Info and Relationships, 3.3.2 Labels or Instructions

  [high] unnamed_buttons: 3 buttons have no accessible name
    → WCAG 4.1.2 Name, Role, Value

Warnings:
  [medium] no_h1: No H1 heading found
  [medium] multiple_h1: (N/A since no H1)
  [low] no_skip_link: No skip navigation link detected
Enter fullscreen mode Exit fullscreen mode

Grade D. That's a lawsuit waiting to happen.

Installation

MCPize (easiest)

Go to mcpize.com/mcp/siteaudit-mcp, click "Install". Free tier includes 100 audits/month.

Or add to your MCP config:

{
  "mcpServers": {
    "siteaudit": {
      "url": "https://siteaudit-mcp.mcpize.run/mcp"
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Self-hosted

# Claude Code
claude mcp add siteaudit -- uvx --from siteaudit-mcp siteaudit

# Or in claude_desktop_config.json
{
  "mcpServers": {
    "siteaudit": {
      "command": "uvx",
      "args": ["--from", "siteaudit-mcp", "siteaudit"]
    }
  }
}
Enter fullscreen mode Exit fullscreen mode

Batch accessibility audits

For agencies or teams auditing multiple sites:

"Run accessibility audits on site1.com, site2.com, site3.com and rank by score"

Claude will call accessibility_audit on each and give you a ranked list with priority fixes.

Pair with competitor_gap_analysis

"Compare the accessibility of mycompany.com against 3 competitors: comp1.com, comp2.com, comp3.com"

This calls competitor_gap_analysis which audits all sites across SEO + security + performance + accessibility and returns:

  • Your score vs competitor average per category
  • Priority focus area (where you lag most)
  • Best-in-class competitor per category
  • Specific gaps with recommendations

What about Lighthouse?

Lighthouse (via lighthouse_audit tool) gives you Google's accessibility score, which includes color contrast ratio checks that my tool can't do without rendering. Use both together:

"Run full_audit and lighthouse_audit on mysite.com, then give me a combined accessibility report"

Claude will synthesize both outputs into one.

Real use cases

For agencies

  • Add accessibility audit to every site audit deliverable
  • Use compare_sites for competitive audits during sales pitches
  • competitor_gap_analysis for retention renewals

For developers

  • Check before every prod deploy: "audit accessibility of staging.mysite.com"
  • Add as CI step (the MCP server can be called from scripts)

For compliance teams

  • Quarterly compliance reports for all company properties
  • Evidence of good-faith compliance efforts (matters legally)

For marketers

  • Demo the audit to potential clients in 5 seconds during sales calls

The 11 tools in SiteAudit MCP

  1. full_audit — SEO + security + performance + accessibility in one call
  2. seo_audit — 20+ SEO checks
  3. security_audit — Headers, SSL, cookies
  4. performance_audit — Response time, size, compression
  5. lighthouse_audit — Google PageSpeed + Core Web Vitals
  6. compare_sites — Multi-site side-by-side
  7. check_links — Broken link crawler
  8. check_robots_txt — robots.txt parser
  9. accessibility_audit — WCAG checks (this article)
  10. schema_validator — Schema.org structured data
  11. competitor_gap_analysis — Competitive audit

Links

Complementary tools

For deeper accessibility work:

  • axe-core — Full browser-based testing (includes color contrast)
  • Pa11y — Command-line accessibility testing
  • WAVE — Visual accessibility evaluation

But for the 80% of WCAG issues that don't need rendering, the MCP tool is faster and free.

If this saves you billable hours, star the repo.

Top comments (0)