Repository avatar
AI Tools
v5.40.0
active

a11y-toolkit

io.github.kinti/a11y-toolkit

The accessibility layer for AI coding agents: audit, fix, document and watch - WCAG 2.2.

Documentation

a11y-toolkit by a11y.es

WCAG 2.2 accessibility checks for coding agents, developers and CI.

An automated check finds some of the accessibility problems and stops there. a11y-toolkit keeps going: audit an HTML file or a live page, find out how to fix each issue, and check what changed before you ship. When a human needs to review the result, export a verifiable evidence pack with the findings and the checks that still need attention.

Free to run yourself under the MIT license. Built by Jesús Quintana Fernández, who has been auditing websites for accessibility since 2003, and used by a11y.es for hosted monitoring.

English · Español

Prefer auditing in the browser? The free Lince extension works in Chrome and Firefox:

Install Lince from the Chrome Web Store · Install Lince from Firefox Add-ons

CI PyPI npm Downloads License: MIT MCP Sponsor Socket score OpenSSF Scorecard OpenSSF Best Practices ACT Rules Releases Dependencies Python Versions GitHub Release

Human in the Loop

Python 3.9+ · Zero dependencies at the core · Zero telemetry · English and Spanish output

⚡ Quickstart

Try the CLI

Run a local contrast check with uvx. The expected ratio is 4.54:1. uv tool guide

uvx --from a11y-toolkit a11ytoolkit pair "#767676" "#ffffff"

Install the CLI with uv tool install a11y-toolkit or run python -m pip install a11y-toolkit in your project's Python environment. Then audit a public page or pass --file page.html to audit local HTML.

a11ytoolkit audit --url https://example.com

Each finding includes a WCAG criterion, severity and remediation. Check not_measured for the criteria that this audit did not measure. Run a11ytoolkit route --url https://example.com to see what to check next. The CLI writes UTF-8 on every platform, so a report sent to a file or a pipe (> report.json) is a valid file on Windows too.

Audit, contrast fix and re-audit (animated GIF)

An audit flags an image without alt text and a form field without a label. A contrast check suggests a darker text color, and the re-audit after the fixes shows the improvement.

Connect your coding agent

mcp-name: io.github.kinti/a11y-toolkit

Register a stdio MCP server with the command and arguments below. Use the configuration format supported by your client. Client setup guide

command: uvx
args: --from a11y-toolkit a11y-toolkit-mcp

For the npm launcher, use npx -y -p @kinti/a11y-toolkit a11y-toolkit-mcp. It bundles the engine and uses a local Python 3.9+ interpreter. Install options · Release workflow

Once connected, ask your agent to call a11y_contrast_pair for #767676 on #ffffff. The expected contrast ratio is 4.54:1.

Enable browser checks

Use the same Python environment for Playwright and the CLI or MCP server. Install Chromium for browser checks and Pillow for image decoding in pixel-based contrast checks.

python -m pip install a11y-toolkit playwright pillow
python -m playwright install chromium
a11ytoolkit dom https://example.com

The CLI has no browser option and uses the first engine it finds. Choose the engine with the browser argument of the MCP tools. If your MCP client uses an isolated uvx environment, launch it from the browser-enabled environment instead. Set its command to that environment's a11y-toolkit-mcp executable. Rendered checks also support installed Firefox, WebKit, Chrome and Edge.

Closed <details> content is not reported as unnamed or unfocusable. a11y_snapshot runs right after a browser audit in the same session, and a11y_contrast_dom returns a load timeout as an error object. When load exceeds the timeout but the DOM is complete, a11y_audit_dom audits the rendered page and lists it in page_errors; raise timeout for slow sites. Rendered findings carry count, the total number of instances (examples are capped at 6).

🔧 From a finding to a verified fix

Locate the issue and recheck it

Run these commands on the same local HTML file. The annotated copy marks the elements the report can locate in the original source, and marks.json lists the path of each marked element.

a11ytoolkit audit --file page.html > audit.json
a11ytoolkit annotate page.html --report audit.json -o annotated.html --marks marks.json

The demo email field is outlined and tagged m1. The marks.json panel shows two findings with the same tag.

In the demo, mark m1 locates both findings on the email field. The field uses only a placeholder as its label and has no autocomplete attribute.

Apply the remediation in page.html, then repeat the audit. For text contrast, a11ytoolkit pair "#767676" "#ffffff" measures the color pair and reports the thresholds. Use a rendered check for text over images and gradients.

Check text contrast over a photo

Measure white text against the pixels in its headline box. worst_zone identifies the cell with the lowest share of pixels reaching the 4.5:1 threshold for normal text.

a11ytoolkit image docs/contrast-demo-photo.jpg --text "#ffffff" --region 40,108,720,126

White text crosses a dark cliff and bright sky. The top-right cell of the headline box is highlighted.

In this sample, 50.5% of the measured pixels reach 4.5:1. The highlighted cell reaches 0%. The lowest measured contrast in the box is 1.01:1.

Block regressions in CI

Start with an audit of the page you want to track. The budget records the findings you have already accepted. Commit the budget so CI can use it as a baseline.

a11ytoolkit budget --init --audit audit.json > budget.json

After the next change, audit the same file again and compare it with the saved budget.

a11ytoolkit audit --file page.html > next.json
a11ytoolkit budget --budget budget.json --audit next.json
ExitResult
0The measured changes are within budget.
1The capture failed or the reports could not be compared.
2At least one finding exceeded the budget.

Keep browser, color scheme and session type consistent when comparing live captures. To check changed HTML in a Git branch, use a11ytoolkit audit --changed --base origin/main. To compare focus order in a scripted journey, use trace. A script action may declare expect_announcement, the live region that must announce after it (4.1.3): trace exits 2 when the announcement does not reach that region and 1 when the step cannot be concluded. CI and keyboard recipes

a11ytoolkit trace https://mysite --script journey.json --capture-dialog-state -o after.json
a11ytoolkit trace diff before.json after.json --gate-dialog-state
a11ytoolkit trace https://mysite --script publish.json   # with expect_announcement: exit 2 = missed, 1 = review

--capture-dialog-state records, after each step, whether a dialog is open and whether focus is inside it. Capture both runs with the same script and test inputs. trace diff exits 1 when the recorded action sequences differ or a requested dialog check lacks evidence. In a valid comparison, a measured focus or dialog regression exits 2. The JSON keeps the focus details. Add --lang es for Spanish diagnostics.

Budgets match instances by stable_paths (id, data-testid, ARIA name) before positional paths. In a crawl, failed URLs do not spend the page quota; the crawl stops after failures reach twice the quota and the report says so with failed_pages_capped.

a11ytoolkit init also installs a write-time gate in .claude/settings.json. guard fails closed: a save the engine cannot audit (over 3 MB, unparseable) returns decision: "error" and exit 1 instead of allow; A11Y_GATE=off bypasses the hook and --lang es answers in Spanish.

Save blocked, fixes applied, save allowed (animated GIF)

The write-time gate blocks a save with two new findings, explains each fix and allows the corrected file to be saved.

fix returns error when its final audit fails. To re-verify a report, a11y_disprove checks each earlier finding on the live page. With fewer saved paths than instances, it confirms only that a signal is still on the same page, and it rejects only with complete proof.

Hand off the evidence

a11ytoolkit evidence next.json -o evidence-pack.json

An evidence pack includes the source reports, a 55-criterion matrix and the review still required on the sample. From a checkout of this repository, run python3 scripts/verify_pack.py /path/to/evidence-pack.json to check the SHA-256 seal and embedded reports. An auditor can review the pack and take responsibility for the conformance decision. Pack format and verifier

a11y_badge shows the date, score and screening scope. These badges come from audits of the CLI demo before any fixes, after adding the image's alt text, and after applying the rest of the demo fixes.

Before fixes, 64 out of 100, automated screening After adding alt text, 76 out of 100, automated screening After the demo fixes, 94 out of 100, automated screening

🙈 Test a real task blindfolded

Scanners check what a page is made of. This checks what a person can do with it. Your coding agent attempts a real task ("subscribe to the newsletter", "reset the password") perceiving only the accessibility tree, which is what a screen reader exposes, and acting only by accessible name and keyboard. Every point of friction it meets is logged against a WCAG criterion.

The Acme Weekly signup form beside its Chromium accessibility tree, with the arrow button highlighted in both.

Chromium exposes the signup button as button "→". The accessible name is just the arrow, so the button's purpose is unclear to the agent. The demo page is authored to fail. Watch the signup attempt and its recorded blocked verdict (animated GIF)

a11y_sr_transcript presents that same page's accessibility tree in reading order. In the demo, the heading and description lead to the email field Your email and the button →.

The reading order from a11y_sr_transcript ends with textbox Your email and button arrow.

Ask your agent to run the blindfold-task prompt with a URL and the task. When it finishes, it closes with a11y_journey_verdict, which turns the friction log into a deterministic verdict: pass, partial, fail or blocked, a score, and each finding with its criterion and remediation. To price a log by hand, run python3 -m a11y_toolkit.a11yjourney friction.json. The verdict is a report like the audits, so a11y_evidence accepts it and the friction list reaches the person who reviews.

A pass means one task was completable non-visually by an AI agent on one page. That is usability evidence. It is not a conformance claim and it does not replace testing with a human screen-reader user. The worked example shows the whole loop, on a failing fixture and on two live sites.

🧭 Choose the right check

If you need to…Start with…
Scan a page, local HTML or a small siteaudit --url, audit --file or audit --url … --pages 5
Check rendered contrast, focus or small targetsdom or contrast-dom
Walk a keyboard route or check a layout at 320 CSS pixelskbd, trace or reflow
Check interactive behavior such as errors, hover or infinite scrollforms, hover, scroll or patterns
Find out whether a task can be completed without seeing the pagePrompt blindfold-task, then a11y_journey_verdict
Inspect what a browser exposes to assistive technologyMCP tool a11y_sr_transcript or prompt blindfold-task
Screen documents or captionspdf, python -m a11y_toolkit.a11ydocx or vtt
Prepare a human review or an interoperability exportevidence, scope, sarif, earl, vpat or openacr

Form checks can submit test data. Run them against a test site or an environment where submissions are expected. Examples and command options

📊 Coverage and validation

48 of 55 A/AA criteria carry at least one automated signal (87%) in the supported WCAG 2.2 check modes. A signal covers a specific condition within a criterion. Any signal counts, even a partial one: a criterion appears in this count as soon as one of its conditions is checked, which says nothing about the others. The sample, the selected checks and the manual review determine what a reviewer can conclude about conformance. The evidence pack shows those distinctions criterion by criterion. Manual review checklist · Standards and mappings

EvidenceWhat it measures
ACT implementation report34 of the 37 W3C ACT rules approved today are implemented completely, by the W3C consistency algorithm: across 694 official test cases, no conforming case is flagged and 213 of 224 expected failures are detected. The other 3 rules are partial: they need to judge the content (a descriptive title, a descriptive image name, text inside an image), so the engine asks one question per element and a11y_oracle records the answer with its evidence. 6 of 42 proposed rules are complete. Regenerated on 2026-11-29 against w3c/wcag-act-rules 4ce3d61.
Assisted ACT reviewAn agent with vision reviewed the 23 pending cases. All 23 outcomes matched the references after the observations were sealed. The assisted run detected 224 of 224 expected failures and matched 520 of 694 outcomes exactly. The review was not blind: in the 11 images-of-text cases the page title names the expected outcome.
Frozen corpusThe toolkit detected all 18 injected faults and flagged none of the three controls. These cases come from the toolkit's own mutation bank. Other engines can submit results to the same scorer.
Live axe-core benchmarkFour public pages compared across static, rendered and axe passes. Differences identify cases for manual review. Raw results and the validation procedure are public.

The score is 100 minus 12, 6 or 2 points for each high, medium or low finding. It reflects what the automated checks saw; it is not a share of WCAG. Python callers can turn it into a level with compute_verdict(findings, score): one of serious_findings, clean, high_score or needs_improvement, where clean only means no automated findings. What requires judging the content comes out as a question; a11y_oracle records the answer with its evidence.

Review ACT questions

a11ytoolkit audit --url https://example.com > audit.json

Pass the static report to the MCP tool a11y_oracle with answers containing question_id, answer (yes or no) and an observation of the content. Image questions cover images with src, image buttons and URLs in inline CSS backgrounds. Visual inspection remains the reviewer's job.

scripts/act_report.py --answers imports sealed answers for the same URL, source hash and questions. Unanswered or omitted image questions keep a case at cantTell unless a reviewed image already fails. Failed captures are untested and the generator exits 1. MCP reference

For browser-based transcripts, the browser's accessibility tree is the source. Use a real screen reader for spoken-output verification. Screen-reader cross-check

🧰 MCP tools and prompts

The project ships 38 MCP tools, 5 prompts and a skill for repeatable audits and review. The CLI also includes regression and corpus commands. Agent skill · Agent documentation index

Browse the 38-tool catalog

The tools (38)

Full reference: descriptions, arguments, return shapes and behavior in docs/tools.md. All tools accept lang (en|es) unless noted; output is JSON unless noted. Generated from server.TOOLS by scripts/gen_readme.py.

ToolCategoryWhat it does
a11y_audit_urlAuditExpress WCAG audit
a11y_audit_domAuditRendered WCAG audit
a11y_audit_pdfAuditPDF accessibility screening
a11y_docx_screenAuditDOCX accessibility screening
a11y_locateLocateLocate element by accessible name
a11y_journey_verdictBlindfold testingBlindfold journey verdict
a11y_autofixFix & contrastDeterministic safe auto-fixes
a11y_patchesFix & contrastSealed patch-set (sha-keyed)
a11y_contrast_pairFix & contrastContrast ratio + verdicts
a11y_contrast_imageFix & contrastText-over-image contrast
a11y_contrast_domFix & contrastLive-element contrast sampling
a11y_suggest_colorFix & contrastNearest passing color
a11y_generate_declarationDocumentAccessibility statement (EAA/RD 1112)
a11y_generate_vpatDocumentVPAT 2.5 report (WCAG edition)
a11y_generate_openacrDocumentOpenACR YAML report (GSA)
a11y_badgeDocumentHonest SVG badge
a11y_snapshotWatch (regressions)A11y snapshot + tab order
a11y_diffWatch (regressions)Snapshot regression diff
a11y_diff_urlsWatch (regressions)Staging vs production diff
a11y_aria_live_snippetWatch (regressions)aria-live monitor snippet
a11y_criterionKnowledge & contextWCAG criterion explained
a11y_html_validateKnowledge & contextW3C Nu validation
a11y_keyboardInteractionsKeyboard-trap + skip-link landing detector
a11y_formsInteractionsForm error testing
a11y_hoverInteractionsHover dismissibility (1.4.13)
a11y_reflowInteractions320px reflow check
a11y_scrollInteractionsInfinite-scroll audit (passive by default; interactive=true clicks the exact control you name)
a11y_sr_transcriptInteractionsScreen reader transcript
a11y_reduced_motionInteractionsprefers-reduced-motion honored?
a11y_forced_colorsInteractionsforced-colors survival heuristic
a11y_vtt_checkInteractionsWebVTT caption quality
a11y_evidenceCoverage & evidenceEvidence pack (verifiable handoff)
a11y_disproveCoverage & evidenceDisprover: re-verify findings
a11y_ledgerCoverage & evidenceCoverage ledger (persistent)
a11y_wcag3_previewCoverage & evidenceWCAG 3 draft preview (no score)
a11y_scopeCoverage & evidenceApplicability scope (semi-automatic)
a11y_oracleCoverage & evidenceOracle record (engine asks, someone answers)
a11y_routeRoutingTool router (goal or page to steps)

The 5 prompts

PromptUse it to…
audit-pageAudit a page and plan keyboard, screen-reader and zoom checks.
fix-contrastFind and apply a passing text color for the measured background.
pre-deploy-checkAudit a URL and compare it with a saved accessibility snapshot.
declaration-eaaDraft an accessibility statement for human review.
blindfold-taskAttempt a task using accessible names and keyboard actions, then record the friction.

🔒 Data and security

The toolkit runs as your local user. Local file arguments can read or write files that user can access. URL and browser checks contact the pages you specify. The optional Nu HTML validation tool sends the selected URL or HTML to its configured validator. Keep authenticated browser session files local. Security policy and private reporting

🤝 Contribute

Run make test from the repository root. Install Playwright and Chromium to exercise the browser suites. The tool inventory and agent index derive from the MCP definitions, and CI checks that they stay in sync. Architecture · Changelog

Fix a bug, improve a recipe or add a locale. Locale packs can be validated with python3 tests/test_locales.py. Translation guide · Good first issues · Discussions

About

I have been auditing websites for accessibility since 2003. I built this toolkit so the person fixing an issue can find it and the person reviewing the fix can check the evidence. If a result surprises you, share the smallest page that reproduces it. Jesús Quintana Fernández · Report an issue

The toolkit is used by a11y.es for hosted accessibility monitoring. a11y.es

The code is MIT-licensed. Modified distributions use their own name and branding. License

PYPI
a11y-toolkit
Install Command
pip install a11y-toolkit
NPM
@kinti/a11y-toolkit
Install Command
npm install @kinti/a11y-toolkit