Supports CSS selectors for targeting specific elements during accessibility scans and interactive component testing.
Requires Node.js 18+ runtime environment to execute the MCP server for accessibility testing with Playwright and axe-core.
Uses npm for package management and installation of the accessibility testing server dependencies.
Implemented in TypeScript with comprehensive type definitions for scan results, configurations, and tool schemas.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Playwright Accessibility Testing MCP Servertest the checkout form on https://example.com for accessibility issues"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Playwright Accessibility Testing MCP Server
A production-ready Model Context Protocol (MCP) server for comprehensive accessibility testing using Playwright and axe-core. Test web applications for WCAG 2.0/2.1 compliance with ease.
Features
Comprehensive WCAG Testing: Tests WCAG 2.0/2.1 Level A/AA compliance plus best practices
Natural Language Testing: Find elements by visible text - no CSS selectors needed
Auto-Discovery: Automatically discover and test all interactive elements
Interactive Component Testing: Test across different states (dropdowns, modals, etc.)
Screenshot Capture: Visual documentation of tested areas
Predefined Prompts: Quick-start templates for common testing scenarios
Production-Ready: Modular architecture, TypeScript, comprehensive error handling
Installation
Configuration
Add to your MCP client configuration file:
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
Claude Code (.claude/config.json in your project):
Restart your MCP client after configuration.
Quick Start
Using the Predefined Prompt (Easiest!)
The fastest way to test is with the comprehensive-a11y-test prompt:
Parameters:
url(required): URL to testblock(optional): Section name (e.g., "Navigation", "User Profile")steps(optional): Comma-separated interaction steps
What it does:
Navigates to the URL
Runs full accessibility audit
Tests specified section with auto-discovery or custom steps
Generates human-readable report with:
Executive summary
Critical/serious/moderate/minor issues
Prioritized fix recommendations
Available Tools
1. a11y_scanUrl
Scan a URL for accessibility violations.
Parameters:
Example:
2. a11y_scanInteractiveByText
Test components using natural language - no CSS selectors needed!
Parameters:
Example: Auto-discover everything
Example: Custom interactions
Response Format
Scan Result
Interactive Scan Result
Project Structure
WCAG Compliance
This server tests for:
WCAG 2.0 Level A (
wcag2a)WCAG 2.0 Level AA (
wcag2aa)WCAG 2.1 Level A (
wcag21a)WCAG 2.1 Level AA (
wcag21aa)Best Practices (
best-practice)
Impact Levels
Violations are categorized by severity:
Critical: Blocks access completely - fix immediately
Serious: Creates significant barriers - fix before release
Moderate: Noticeable issues - fix soon
Minor: Small improvements - can be backlogged
Output Files
All screenshots are saved to: ./accessibility-screenshots/
scan-{timestamp}.png- Full page screenshots{name}-{timestamp}.png- Named screenshots
Usage Examples
Test a simple page
Test specific section by name
Test with custom interactions
Development
Adding New Tools
Create tool file in
server/tools/Define schema and execution function
Register in
server/server.ts
Adding New Utilities
Create utility file in
server/utils/Export functions
Import where needed
Best Practices
Always test with screenshots during initial development:
{"captureScreenshot": true}Wait for dynamic content on SPAs:
{"waitForSelector": ".content-loaded"}Test interactive components in different states:
Initial state
After user interaction
Error states
Success states
Use natural language testing when you don't know selectors:
{"containerText": "User Menu", "autoDiscover": true}
Troubleshooting
Server not starting
Element not found
Verify the text exists on the page
Try a shorter, more specific text
Check if content is loaded (use
waitForSelector)
Timeout errors
Requirements
Node.js 18+
Playwright (browsers installed automatically)
License
ISC
Contributing
Follow the modular architecture
Add TypeScript types for new features
Document new tools in README
Update constants instead of hardcoding values
Built for production use with modular, maintainable architecture.