Skip to main content
Glama
westsideori

Cursor A11y MCP

by westsideori

光标 A11y MCP

一个模型上下文协议 (MCP) 服务器,提供可访问性测试功能的 AI 代理。此工具可帮助使用 axe-core 和 Puppeteer 识别 Web 应用程序中的可访问性问题。

特征

  • 在任何 URL 或本地开发服务器上运行可访问性测试

  • 由 axe-core 提供支持,可进行全面的可访问性测试

  • 提供详细的违规报告,包括:

    • 影响程度

    • 问题描述

    • 帮助文本和文档链接

    • 受影响的 HTML 元素

    • 故障摘要

Related MCP server: Web Accessibility MCP Server

项目结构

  • src/ - MCP 服务器和可访问性测试工具的源代码

  • test-site/ - 一个用于测试的故意存在可访问性问题的 React 应用程序

  • build/ ——源代码的编译版本

安装

npm install

然后安装测试站点依赖项:

cd test-site
npm install
cd ..

用法

启动 MCP 服务器

npm run build
npm start

运行测试站点

npm run start:test-site

测试站点的网址为http://localhost:5000 。

运行可访问性测试

该工具接受两种类型的输入:

  1. 要测试的完整 URL

  2. 将附加到http://localhost:5000相对路径

依赖项

  • @modelcontextprotocol/sdk : ^1.4.1

  • puppeteer : ^24.1.1

  • zod :^3.24.1

测试站点依赖项

  • react :^18.2.0

  • react-dom :^18.2.0

  • react-scripts :5.0.1

发展

  1. 修改src/目录中的源代码

  2. 运行npm run build来编译更改

  3. 使用npm start启动服务器

在光标中配置

要将此可访问性测试工具添加到 Cursor 的 MCP 服务器设置:

  1. 打开光标设置(⌘ + ,)

  2. 导航至“功能”>“MCP 服务器”

  3. 添加一个新的 MCP 服务器,配置如下:

    • 姓名: a11y

    • 从下拉菜单中选择command

    • 命令: node path/to/cursor-a11y-mcp/index/file/in/build/folder (将path/to/cursor-a11y-mcp/index/file/in/build/folder替换为 build 文件夹中 index.js 文件的绝对路径。)

  4. 单击Add

  5. 可访问性测试工具现在可在 Cursor 的 Composer 中使用

在 Composer 中的使用

要使用 Cursor Composer 中的可访问性测试工具:

  1. 在你的终端中运行:

npm run start:test-site

这将在http://localhost:5000启动测试站点

  1. 在 Cursor 的 Composer 中,输入use a11y tool

  2. Composer 将提示您运行该工具

  3. 运行该工具后,您将看到响应中的可访问性违规,以及修复违规的代码操作

  4. Composer 可能会提示您再次使用该工具来确认违规行为是否已修复

执照

该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。

版本

当前版本:2.0.1

Available Tools

1 tool
a11yB

Run accessibility tests on a URL or a local path (relative URL appended to http://localhost:5000).

ParametersJSON Schema
NameRequiredDescriptionDefault
relativePathNoRelative path appended to http://localhost:5000
urlNoFull URL to test

TDQS

B3.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It mentions the local path behavior (appended to localhost:5000), which is useful, but doesn't disclose critical behavioral traits like what the tests actually do, whether they're destructive, what permissions are needed, rate limits, or output format. This leaves significant gaps for an agent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose and includes essential details without any wasted words. Every element serves a clear purpose in conveying the tool's functionality.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no annotations and no output schema, the description is incomplete for a testing tool. It doesn't explain what accessibility tests are run, what the results look like, error conditions, or behavioral constraints. This leaves the agent with insufficient context to use the tool effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents both parameters fully. The description adds marginal value by clarifying the local path behavior (appended to localhost:5000), but doesn't provide additional syntax, format details, or usage examples beyond what the schema states.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Run accessibility tests') and the target resources ('on a URL or a local path'), with no siblings to distinguish from. It uses precise verbs and identifies the exact scope of operation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage context by specifying the two input types (URL or local path), but doesn't provide explicit guidance on when to choose one over the other or mention any prerequisites. With no sibling tools, this is adequate but lacks detailed decision criteria.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 1 tool updatev1.0.0
    • First observeda11y

TDQS

B3.4/5.0

Scored across 1 tool

Disambiguation5/5

With only one tool, there is no possibility of ambiguity or overlap between tools. The tool 'a11y' has a clear and distinct purpose focused on accessibility testing.

Naming Consistency5/5

Since there is only one tool, naming consistency is inherently perfect. The tool name 'a11y' is concise and descriptive, and there are no other tools to compare it against for consistency.

Tool Count2/5

A single tool is too few for a server named 'Cursor A11y MCP', which suggests a broader accessibility domain. While the tool is functional, the set lacks coverage for other common accessibility tasks like reporting, fixing issues, or checking compliance, making it feel thin and incomplete.

Completeness2/5

The tool surface is severely incomplete for an accessibility domain. It only provides testing on URLs or local paths, missing essential operations such as generating reports, analyzing results, fixing issues, or supporting different accessibility standards, which will limit agent effectiveness.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers