Skip to main content
Glama
jbuchan

Accessibility MCP Server

by jbuchan

Accessibility MCP Server

A Model Context Protocol (MCP) server for automated accessibility testing using Playwright and axe-core against WCAG standards.

Overview

This server provides AI agents (LLMs) with the ability to perform comprehensive accessibility audits on websites. It leverages industry-standard tools to deliver detailed reports on WCAG compliance violations and recommendations.

Related MCP server: Playwright Accessibility Testing MCP Server

Features

šŸ” Comprehensive Accessibility Testing

  • Full WCAG 2.1/2.2 compliance checking (A, AA, AAA levels)

  • Cross-browser testing (Chromium, Firefox, WebKit)

  • Real browser automation with Playwright

  • axe-core accessibility engine integration

šŸ¤– MCP Integration

  • Three main tools exposed to AI agents:

    • test_accessibility: Run accessibility tests

    • get_test_results: Retrieve saved test results

    • list_test_results: List all available test files

šŸ“Š Rich Reporting

  • Human-readable text reports

  • Raw JSON data for programmatic access

  • Screenshot capture capability

  • Detailed violation summaries with remediation guidance

šŸ›”ļø Security & Validation

  • URL validation and sanitization

  • Configuration parameter validation

  • Graceful error handling

  • Safe browser isolation

Installation

# Clone and install dependencies
npm install

# Install Playwright browsers
npx playwright install

# Build the project
npm run build

Usage

Starting the MCP Server

# Development mode
npm run dev

# Production mode
npm run build && npm start

The server communicates via stdin/stdout following the MCP protocol specification.

Available Tools

test_accessibility

Run an accessibility test on a website.

Parameters:

  • url (required): Website URL to test

  • wcagLevel (optional): 'A', 'AA', or 'AAA' (default: 'AA')

  • wcagVersion (optional): '2.1' or '2.2' (default: '2.1')

  • browser (optional): 'chromium', 'firefox', or 'webkit' (default: 'chromium')

  • includeScreenshot (optional): boolean (default: false)

Example:

{
  "url": "https://example.com",
  "wcagLevel": "AA",
  "wcagVersion": "2.1",
  "browser": "chromium",
  "includeScreenshot": true
}

get_test_results

Retrieve saved accessibility test results.

Parameters:

  • fileName (required): Name of the test result file

list_test_results

List all available test result files.

No parameters required.

Architecture

src/
ā”œā”€ā”€ server/           # MCP server implementation
│   ā”œā”€ā”€ index.ts      # Main entry point
│   └── mcpServer.ts  # MCP protocol handlers
ā”œā”€ā”€ accessibility/    # Core testing engine
│   └── tester.ts     # Playwright + axe-core integration
ā”œā”€ā”€ types/           # TypeScript type definitions
│   └── index.ts     # Interface definitions
└── utils/           # Utility modules
    ā”œā”€ā”€ fileOutput.ts    # Result file management
    └── validation.ts    # Input validation and sanitization

Development

Project Structure

  • src/server/: MCP server implementation and entry points

  • src/accessibility/: Core accessibility testing logic

  • src/types/: TypeScript type definitions

  • src/utils/: Utility functions for validation and file I/O

  • outputs/: Generated test results and screenshots

  • tests/: Test suites (planned)

Configuration

The server accepts various configuration options:

  • WCAG Levels: A, AA, AAA

  • WCAG Versions: 2.1, 2.2

  • Browsers: Chromium, Firefox, WebKit

  • Timeouts: 1s to 5 minutes

  • Viewports: 320x200 to 4000x4000 pixels

Error Handling

The server implements comprehensive error handling:

  • URL validation and sanitization

  • Browser initialization failures

  • Network timeout handling

  • File I/O error recovery

  • Graceful MCP protocol error responses

Output Formats

Text Reports

Human-readable accessibility reports including:

  • Executive summary with violation counts

  • Detailed violation descriptions with remediation steps

  • Element-specific failure information

  • WCAG success criteria references

JSON Data

Machine-readable results containing:

  • Complete axe-core results

  • Test metadata and configuration

  • Structured violation data

  • Performance metrics

Security Considerations

  • URL validation prevents testing of local/private addresses

  • Browser sandboxing through Playwright

  • Input sanitization for all parameters

  • Safe file I/O operations

  • Process isolation

Cloud Deployment (Future)

This server is designed for eventual cloud deployment with:

  • Container support (Docker)

  • Environment-based configuration

  • Database integration for result storage

  • API rate limiting

  • Authentication and authorization

Dependencies

  • @modelcontextprotocol/sdk: MCP protocol implementation

  • playwright: Browser automation framework

  • @axe-core/playwright: Accessibility testing integration

  • axe-core: Accessibility rules engine

  • typescript: Type safety and development tooling

License

MIT License - see LICENSE file for details.

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests for new functionality

  5. Submit a pull request

Support

For issues and questions:

  1. Check the documentation

  2. Review existing GitHub issues

  3. Create a new issue with detailed information

Available Tools

3 tools
get_test_resultsC

Retrieve saved accessibility test results by filename

ParametersJSON Schema
NameRequiredDescriptionDefault
fileNameYesName of the test result file to retrieve

TDQS

C2.9/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 states retrieval but doesn't disclose behavioral traits like whether this is a read-only operation, if it requires specific permissions, what happens if the file doesn't exist (e.g., error handling), or if there are rate limits. The description is minimal and lacks operational context.

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 with zero waste. It's front-loaded with the core action and resource, making it easy to parse quickly.

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 tool that retrieves data. It doesn't explain what the returned test results contain (e.g., format, structure), error conditions, or dependencies on other tools. For a retrieval operation with zero structured context, this leaves significant gaps.

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%, with the single parameter 'fileName' well-documented in the schema. The description adds no additional parameter semantics beyond implying retrieval is filename-based, which the schema already covers. Baseline 3 is appropriate when schema does the heavy lifting.

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

Purpose4/5

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

The description clearly states the verb ('Retrieve') and resource ('saved accessibility test results'), and specifies retrieval is 'by filename'. However, it doesn't explicitly differentiate from sibling tools like 'list_test_results' (which might list all results) or 'test_accessibility' (which might run new tests).

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

Usage Guidelines2/5

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

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention prerequisites (e.g., needing a saved file first), exclusions, or comparisons to siblings like 'list_test_results' for browsing or 'test_accessibility' for creating new results.

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

list_test_resultsB

List all available accessibility test result files

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the action ('List all available') but does not explain key traits such as whether this is a read-only operation, if it requires authentication, how results are formatted (e.g., pagination), or any rate limits. This leaves significant gaps in understanding the tool's behavior.

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, clear sentence with no wasted words. It is front-loaded with the core action and resource, making it highly efficient and easy to parse for an AI agent.

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 the lack of annotations and output schema, the description is incomplete for a tool that likely returns a list of files. It does not specify the format of the results (e.g., file names, metadata), any filtering criteria, or error handling. For a list operation, more context on the output is needed to be fully helpful.

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

Parameters4/5

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

The tool has zero parameters, and the input schema has 100% description coverage (though empty). The description does not need to add parameter details, as there are none to document. It appropriately avoids redundancy, earning a high score for this dimension.

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

Purpose4/5

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

The description clearly states the verb ('List') and resource ('accessibility test result files'), making the purpose explicit. However, it does not differentiate from sibling tools like 'get_test_results' or 'test_accessibility', which might have overlapping or distinct functionalities, preventing a perfect score.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'get_test_results' or 'test_accessibility'. It lacks explicit instructions on context, prerequisites, or exclusions, leaving the agent with minimal usage direction.

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

test_accessibilityB

Run accessibility tests on a website using Playwright and axe-core against WCAG standards

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the website to test for accessibility
wcagLevelNoWCAG compliance level to test againstAA
wcagVersionNoWCAG version to test against2.1
browserNoBrowser engine to use for testingchromium
includeScreenshotNoWhether to capture a screenshot of the page

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions the testing framework and standards, it doesn't describe what the tool actually returns (e.g., report format, error handling), performance characteristics, authentication needs, or potential side effects like network usage or resource consumption.

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 without unnecessary elaboration. Every word contributes to understanding the tool's function, making it appropriately sized and well-structured.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description is insufficient. It doesn't explain what the tool returns (critical for a testing tool), error conditions, or behavioral details beyond the basic action. The context signals indicate significant gaps that the description doesn't address.

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 all 5 parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter documentation.

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'), target resource ('on a website'), and implementation details ('using Playwright and axe-core against WCAG standards'). It distinguishes itself from sibling tools like 'get_test_results' and 'list_test_results' by focusing on the testing action rather than retrieving results.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus its siblings ('get_test_results', 'list_test_results'), nor does it mention any prerequisites, constraints, or alternative scenarios. It simply states what the tool does without contextual usage information.

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

TDQS

B3.4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: get_test_results retrieves specific results, list_test_results lists available files, and test_accessibility runs new tests. There is no overlap or ambiguity between these three functions.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern (get_test_results, list_test_results, test_accessibility) with clear, descriptive names that align with their actions. There are no deviations in naming conventions.

Tool Count4/5

With 3 tools, the server is well-scoped for its accessibility testing domain, covering core operations: listing, retrieving, and running tests. It might benefit from additional tools like updating or deleting results, but the count is reasonable and not excessive.

Completeness4/5

The tools provide a solid foundation for accessibility testing, covering listing, retrieval, and execution. Minor gaps exist, such as the inability to update or delete test results, but agents can work around this, and the core workflow is adequately supported.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    A
    quality
    D
    maintenance
    Enables comprehensive WCAG 2.0/2.1 accessibility testing of web applications using Playwright and axe-core. Supports natural language element finding, auto-discovery of interactive components, and generates detailed compliance reports with screenshots.
    2
  • A
    license
    A
    quality
    C
    maintenance
    Enables AI coding agents to perform real-browser accessibility scanning of localhost pages using Playwright and axe-core, returning WCAG 2.1 violations with structured fix plans.
    3
    93
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jbuchan/accessibility-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server