@accesslint/mcp

中文文档
0.11.1发布于 2026/08/25MITTypeScriptES Module构建来源已验证近 30 天下载 6786

MCP server for accessible agentic coding — WCAG audit tools for AI coding agents

原始使用文档
文档目录6 节
  1. Setup
  2. Tools
  3. Prompts
  4. React Component Auditing
  5. Why use this instead of prompting alone?
  6. License

@accesslint/mcp

MCP server for accessible agentic coding — WCAG audit tools for AI coding agents. Built on @accesslint/core, @accesslint/cli, and @accesslint/chrome. From AccessLint.

This server is a thin adapter: it holds no Chrome, CDP, or audit engine of its own. Live-page audits shell out to the @accesslint/chrome and @accesslint/cli binaries (the same path the AccessLint skills use); HTML-string audits run the @accesslint/cli engine in-process. The server exposes those as MCP tools and formats the results for an agent.

This server drives a Chrome on your own machine, so it audits whatever that Chrome can reach — localhost, staging or production alike — plus HTML on disk. What it does not do is remember: each call audits and returns, and nothing is stored.

Reach for the hosted connector at https://mcp.accesslint.com/mcp instead — a separate MCP server you add in a chat client, which cannot reach localhost — when the work is a user journey across several pages, a site re-checked over time, findings that persist, or a report someone else will read. There those are flows, runs and violations. Both servers register under the name accesslint; this is the one with a way into your dev server.

Setup

Add to your MCP client configuration:

{
  "mcpServers": {
    "accesslint": {
      "command": "npx",
      "args": ["@accesslint/mcp"]
    }
  }
}

For live-page audits, audit_live ensures a debuggable Chrome via @accesslint/chrome: it attaches to one already serving the CDP discovery API, or launches a fresh headless one in the background — no manual --remote-debugging-port flag needed. A system Chrome/Chromium (found via CHROME_PATH or a platform search) is used when present; set ACCESSLINT_CHROME_DOWNLOAD=1 to fall back to a managed Chrome for Testing build when none is installed.

Tools

  • audit_live — Audit a live URL via CDP. Ensures a debuggable Chrome (auto-launching one headless if none is reachable — no manual setup needed), then runs @accesslint/core against the live DOM. CSP-bypassing. Optional selector scopes the audit to one element; wait_for gates the audit until a selector or text appears. Override the endpoint with port / host (or ACCESSLINT_CDP_PORT) to attach somewhere specific.
  • audit_html — Audit an HTML string for WCAG violations (in-process JSDOM). Auto-detects fragments vs full documents; pass component_mode to force fragment handling. Used by the audit-react-component prompt to audit JSX after the agent renders it to a string.
  • list_rules — List available WCAG rules with optional filters by category, level, fixability, or criterion.
  • explain_rule — Detailed metadata for a single rule (description, WCAG criteria, fixability, browser hint, guidance).

File-on-disk audits go through Read + audit_html. For static-site CI workflows, diffing against a baseline, and snapshot-based regression gates, use the @accesslint/cli package directly (accesslint scan <file-or-url>, --snapshot) or the AccessLint scan / diff skills.

All audit tools accept an optional min_impact parameter to filter by severity. Valid values, from most to least severe: critical, serious, moderate, minor — only violations at that level or above are shown. They also accept rules / wcag allow-lists (run only the listed rule IDs / WCAG criteria) and format: "compact" for one-line-per-violation output.

Each violation in the output includes the rule ID, CSS selector, failing HTML, impact level, and — where available — a fixability rating, browser hint, and remediation guidance. When multiple elements break the same rule, shared metadata is printed once to keep output compact. Live-DOM audits against React dev builds attach a Source: <file>:<line> (Symbol) pointer per violation via React DevTools fibers.

Prompts

React Component Auditing

To audit React components (.jsx/.tsx) without a running app, the agent uses the audit-react-component prompt, which guides it through:

  1. Reading the component source
  2. Mentally rendering it to static HTML (acting as renderToStaticMarkup)
  3. Passing the rendered HTML to audit_html

No extra runtime dependencies are required — the agent renders the component itself based on the source code, and audit_html auto-detects the fragment.

Why use this instead of prompting alone?

Without tools, the agent reasons about WCAG rules from memory. The MCP replaces that with structured output — specific rule IDs, CSS selectors, and fix suggestions — so the agent skips straight to applying fixes. This means fewer output tokens per run, which translates directly to faster and cheaper completions.

Benchmarked across 25 test cases, 67 fixable violations, 3 runs each (Claude Opus):

With @accesslint/mcpAgent alone
Violations fixed99.5% (200/201)93.5% (188/201)
Regressions1.7 / run2.0 / run
Cost$0.56 / run$0.62 / run
Duration270s / run377s / run
Timeouts0 / 63 tasks2 / 63 tasks

Measured against the v0.8.x in-process architecture. The structured-output advantage (fix rate, tokens) carries over to the current subprocess design; absolute timings will differ.

License

MIT

版本与发布记录

@accesslint/mcp 共发布 24 个版本,首次发布于 2025/11/06;过去 12 个月发布了 23 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.11.1latest2026/08/252 个月前
0.11.02026/08/232 个月前
0.10.02026/06/055 个月前
0.9.02026/06/045 个月前
0.8.12026/06/025 个月前
0.8.02026/05/036 个月前

关于 @accesslint/mcp 的常见问题

@accesslint/mcp 是什么?

MCP server for accessible agentic coding — WCAG audit tools for AI coding agents

如何安装 @accesslint/mcp?

在项目目录运行 npm install @accesslint/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 accesslint-mcp,可以用 npx accesslint-mcp 直接运行。

@accesslint/mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@accesslint/mcp 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@accesslint/mcp 可以商用吗?

@accesslint/mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@accesslint/mcp 的下载量有多少?

根据 npm 官方下载统计,@accesslint/mcp 在 2026/10/05 – 2026/11/03 这 30 天内被下载 6,786 次,日均约 226 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@accesslint/mcp 还在维护吗?

最新版本 0.11.1 发布于 2026/08/25(2 个月前);至今共发布 24 个版本,其中过去 12 个月发布了 23 个;首次发布于 2025/11/06。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。