wire-up-mcp
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWire up Real A11y MCP
连接Real A11y MCP
Gives an AI agent a real browser and the accessibility tree — audit, inspect,
checkpoint/diff, and act by role+name. Source of truth:
https://real-a11y.dev/packages/mcp
为AI Agent提供真实浏览器和可访问性树——支持审计、检查、checkpoint/diff(检查点/差异对比),以及按角色+名称执行操作。权威文档:https://real-a11y.dev/packages/mcp
Prerequisites
前置条件
- Node.js 20+
- A Chromium binary: (or
npx real-a11y install)npx playwright install chromium - An MCP-capable client
- Node.js 20+
- Chromium二进制文件:(或
npx real-a11y install)npx playwright install chromium - 支持MCP的客户端
Client config
客户端配置
Point the client at (no global install required).
npx -y @real-a11y-dev/mcpClaude Code
sh
claude mcp add real-a11y -- npx -y @real-a11y-dev/mcpVS Code
sh
code --add-mcp '{"name":"real-a11y","command":"npx","args":["-y","@real-a11y-dev/mcp"]}'Config file (Cursor or project ,
Claude Desktop , Windsurf, etc.):
~/.cursor/mcp.json.cursor/mcp.jsonclaude_desktop_config.jsonjson
{
"mcpServers": {
"real-a11y": {
"command": "npx",
"args": ["-y", "@real-a11y-dev/mcp"]
}
}
}Then once:
sh
npx real-a11y installTo pin a version, install locally ()
and point / at the local binary instead of .
npm i -D @real-a11y-dev/mcp@beta playwrightcommandargsnpx -y将客户端指向(无需全局安装)。
npx -y @real-a11y-dev/mcpClaude Code
sh
claude mcp add real-a11y -- npx -y @real-a11y-dev/mcpVS Code
sh
code --add-mcp '{"name":"real-a11y","command":"npx","args":["-y","@real-a11y-dev/mcp"]}'配置文件(Cursor的或项目目录下的、Claude Desktop的、Windsurf等):
~/.cursor/mcp.json.cursor/mcp.jsonclaude_desktop_config.jsonjson
{
"mcpServers": {
"real-a11y": {
"command": "npx",
"args": ["-y", "@real-a11y-dev/mcp"]
}
}
}然后执行一次:
sh
npx real-a11y install如需固定版本,可本地安装(),并将/指向本地二进制文件,而非。
npm i -D @real-a11y-dev/mcp@beta playwrightcommandargsnpx -yAuth (pages behind login)
身份验证(需登录的页面)
Never pass credentials as MCP tool arguments. Human logs in once; agent reuses
the session:
- (keep
npx real-a11y login <url> --save ./auth.jsonout of VCS)auth.json - Set env for the MCP server process:
- — absolute path to the storage-state file
REAL_A11Y_MCP_STORAGE_STATE - — comma-separated trusted origins (required with storage state)
REAL_A11Y_MCP_ALLOWED_ORIGINS
REAL_A11Y_MCP_CDPREAL_A11Y_MCP_ALLOWED_ORIGINSfile://切勿将凭证作为MCP工具参数传递。人工登录一次后,Agent可复用会话:
- (请勿将
npx real-a11y login <url> --save ./auth.json纳入版本控制系统)auth.json - 为MCP服务器进程设置环境变量:
- —— storage-state文件的绝对路径
REAL_A11Y_MCP_STORAGE_STATE - —— 逗号分隔的可信源(使用storage state时必填)
REAL_A11Y_MCP_ALLOWED_ORIGINS
REAL_A11Y_MCP_CDPREAL_A11Y_MCP_ALLOWED_ORIGINS默认阻止协议;仅当文档中的allow-file标志符合用户的威胁模型时,才启用该协议。
file://Smoke test
冒烟测试
- Confirm the client lists Real A11y tools.
- Ask: “Audit https://example.com for accessibility problems.”
- Expected tool sequence: →
open_page(oraudit_page) → explain findings →inspect_pagewhen done.close_browser
Discover tools from their descriptions — do not invent tool names or parameter
shapes. Full reference: https://real-a11y.dev/packages/mcp/tools
- 确认客户端已列出Real A11y工具。
- 发起请求:“检查https://example.com的可访问性问题。”
- 预期工具执行流程:→
open_page(或audit_page)→ 解释检测结果 → 完成后执行inspect_page。close_browser
请根据工具描述了解可用工具——请勿自行编造工具名称或参数格式。完整参考文档:https://real-a11y.dev/packages/mcp/tools
Next skills
后续技能
- First audit workflows →
audit-a-page - Interact then re-check →
a11y-act-loop
- 首次审计工作流 →
audit-a-page - 交互后重新检查 →
a11y-act-loop