a11y-mcp

CalvHobbes/a11y-mcp

3.1

If you are the rightful owner of a11y-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

a11y-mcp is a server designed to perform comprehensive accessibility testing on web pages using the Model Context Protocol.

Tools
4
Resources
0
Prompts
0

a11y-mcp: Accessibility Testing MCP Server

a11y-mcp is a server built on the Model Context Protocol (MCP) designed to empower AI agents and other automated systems to perform comprehensive accessibility testing on web pages. It leverages powerful tools like Playwright for browser automation and Axe-core for in-depth accessibility analysis.

Key Features

The server exposes several MCP tools to facilitate accessibility testing:

  • checkAccessibility: Navigates to a specified URL and runs a full Axe-core accessibility scan on the live page. Returns detailed violation, pass, incomplete, and inapplicable results.
  • run-axe-for-html: Analyzes a provided HTML string for accessibility issues using Axe-core. Useful for testing static content or components in isolation.
  • navigate: Instructs the server to open a browser and navigate to a given URL. This can be a precursor to other actions like checkAccessibility or getSnapshot.
  • getSnapshot: Captures a comprehensive snapshot of the current page, including the full rendered HTML and a visual screenshot. This is valuable for understanding the page's state at the time of testing.

Getting Started

Prerequisites

  • Node.js and npm
  • Browsers compatible with Playwright (Chromium is used by default)

Installation

  1. Clone the repository:
    git clone <your-repo-url>
    cd a11y-mcp
    
  2. Install dependencies:
    npm install
    
  3. Build the project (compiles TypeScript to JavaScript):
    npm run build
    

Running the Server

The a11y-mcp server can be run in two modes:

  1. Local Development (Stdio Transport): This mode is suitable for local development and direct interaction, typically using standard input/output. The server will automatically restart on file changes.

    npm run dev
    

    The server communicates via stdio, and you can interact with it using tools like the MCP Inspector.

  2. Remote (HTTP Transport): This mode exposes the MCP server over HTTP, allowing remote clients to connect and use its tools.

    npm run remote
    

    By default, the server will be available at http://localhost:3000/mcp.

How it Works

The server utilizes:

  • Playwright: For robust, cross-browser automation to load and interact with web pages.
  • Axe-core: The industry-standard accessibility testing engine to identify violations against WCAG and other accessibility standards.
  • MCP SDK: To structure the server and its tools according to the Model Context Protocol, enabling seamless integration with MCP-compatible clients (e.g., AI agents).

Purpose

The primary goal of a11y-mcp is to provide a programmatic interface for accessibility testing, allowing for:

  • Integration into CI/CD pipelines for automated accessibility checks.
  • Empowering AI agents to understand and remediate accessibility issues.
  • Scalable and repeatable accessibility audits.