Purpose
krds-a11y-mcp is an MCP server for public website development that must satisfy both KRDS (범정부 UI/UX 디자인 시스템, the Korean government design system) and KWCAG 2.2 (the 33 check items of Korea's national web accessibility standard). Its approach is "supply compliant markup first, then use checks as a safety net": rather than checking after the fact and then fixing, it directly provides KRDS components and templates with KWCAG conditions built in, and checks are used only to find breakage that occurs during assembly and transformation.
Main capabilities
- Supply: provides KRDS parts and templates with accessibility conditions; if required inputs such as labels or alternative text are not filled in, it does not return markup.
- Check: checks rendered pages using axe and its own hands-on tests (luminance contrast, keyboard, elements not painted on screen), and reports by KWCAG number.
- Enforcement: through the hooks of Claude Code and Codex, it prevents the AI from ending work while violations remain.
- Failure and rejection responses (missing required items, unknown id/variant/mode, check execution failure) are marked with isError and include the method for re-invoking; for names suspected of typos, it suggests similar names.
- Detailed usage rules are automatically passed as server instructions when the MCP connects; the CLAUDE.md and AGENTS.md generated by init contain only a key-points summary written within marker sections.
Usage
Requires Node 22.23.5+ (22.x), 24.22.3+ (24.x), or 26.13.1 or later; the development and CI baseline version is 22.23.5 in .nvmrc, which can be aligned with nvm install && nvm use.
- Install and configure in the project root (git repository root):
npx -y krds-a11y-mcp init - Install the KRDS suite loaded by the pages provided by the tool:
npm i krds-uiux@1.1.0; for projects that serve by copying the suite to the document root (such as JSP), pass that path as the assetBase of get_page_scaffold. - To use re-checks (validate_page, inspect_page), install the browser check stack:
npm i -D playwright @axe-core/playwrightandnpx playwright install chromium; if not installed, the tool returns that guidance as-is. - Check the installation status:
npx -y krds-a11y-mcp doctor
init installs: the server and hooks are pinned to the installed version (krds-a11y-mcp@x.y.z), so even if a new version is released during a session, the judgment logic does not change, and the hooks do not query the registry every time; on Windows, the server is registered with cmd /c npx. init preserves existing files, appends only its own entries, and repeated execution does not create duplicates.
- Claude Code: open the project and approve the MCP server.
- Codex: trust the project and approve the two krds-a11y hooks in /hooks; after the hook contents change, re-approval is required.
- Upgrade: run again
npx -y krds-a11y-mcp@latest init, only update the pinned version to the new version, keeping other configuration unchanged. - Removal: delete the krds-a11y entry in .mcp.json, the two krds-a11y-mcp hooks in .claude/settings.json and .codex/hooks.json, the [mcp_servers.krds-a11y] table in .codex/config.toml, and the <!-- krds-a11y:begin --> ~ end range in CLAUDE.md and AGENTS.md.
Hook mechanism
- stop-hook: when the AI attempts to finish work, the gate is evaluated; if violations exist, public components are missing, or results are stale, it refuses to finish and passes correction instructions to the model; it loops until passing, and after exceeding the limit (default 5 times) it leaves "automatic correction failed, manual confirmation required" and allows passage. The count is per session, and sessions already allowed are no longer intercepted. For tasks that intentionally retain violations, the evaluation can be disabled with the environment variable KRDS_A11Y_GATE=off. Projects with no check records are not intercepted (to avoid false positives in work sessions with no pages).
- pretool-hook: before writing files, it blocks three types of behavior—generating temporary check scripts in the project folder (.axe-check.mjs and the like, replaced by validate_page and inspect_page); modifying the kit originals (node_modules/krds-uiux, which disappear on reinstall and undermine the basis of the guarantee); modifying the kit copied to the document root (such as webapp/krds-uiux, which would quietly diverge from the npm kit; corrections should use separate CSS). One-off scripts in the system temporary directory and normal configuration files such as .eslintrc.js are not blocked; modifications via Bash are out of scope (only file-writing tools are observed).
- Codex's .codex/hooks.json mounts the same two hooks, with PreToolUse targeting apply_patch|Edit|Write; it extracts all paths in the patch body, and if any is a prohibited object, the entire patch is blocked. Before project trust and /hooks approval, neither the configuration nor the hooks take effect; hooks do not execute in codex exec (non-interactive), so automated scenarios need to call the gate separately in CI.
Applicable scenarios and limitations
Suitable for public website development that requires KRDS and KWCAG 2.2 dual compliance and hopes to reduce the round-trip cost of "check then fix". The project explicitly states: automatic evaluation covers only 30 to 40 percent of accessibility issues; this tool is a pre-review self-check and evidence-generation tool, not a "guarantee of passing review"; the final basis for KWCAG determination is expert review and actual use evaluation with assistive technology (screen readers), which automated tools cannot replace.
Conditions for maintaining the template guarantee: keep the structure, classes, and attributes (including aria) so that the rendered DOM matches the template (React/Vue/JSP conversion is free, but wrapper elements must not be inserted); load the kit CSS and accompanying CSS as-is for styles, coexisting with rather than rewriting them with Tailwind and the like; content is free, but conditional items such as alt and labels must be filled in (the tool enforces this at the generation stage); design mockups are for layout and composition reference only, and colors and fonts use kit tokens; demo placeholders (href="#") must be replaced with real URLs.
Other materials: the mapping table covers 43 KRDS component types × 33 KWCAG items, classified as automatically satisfied, conditionally satisfied, and out of scope, based on the actual files of the official kit (KRDS-uiux) with sources (file, line) annotated item by item, and marked as undetermined when uncertain; the KWCAG↔WCAG↔axe translation table covers 1 fully, 19 partially, and 13 not translatable, and the 13 non-translatable items are output to the report as a manual checklist and confirmation manual; kit defects are recorded in docs/mapping/kit-bugs.md. Testing the check functionality requires Chromium (pnpm exec playwright install chromium).
License
KRDS source materials (the official pattern-corrected version of the template, the excerpted layout CSS and the pattern icons therein, and kit markup references) follow Public Nuri Type 1; see NOTICE for attribution.