mcp web a11y
Provides web accessibility analysis and color blindness simulation using axe-core and Puppeteer, enabling detailed accessibility checks and visual simulations based on WCAG guidelines.
Provides web accessibility analysis and color blindness simulation using axe-core and Puppeteer, enabling detailed accessibility checks and visual simulations based on WCAG guidelines.
An MCP (Model Context Protocol) server that provides web accessibility analysis capabilities using axe-core and Puppeteer.
To install Web Accessibility MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @bilhasry-deriv/mcp-web-a11y --client claude
Clone the repository:
git clone [repository-url]
cd mcp-web-a11y
Install dependencies:
npm install
Build the server:
npm run build
Add the server to your MCP settings file (typically located at ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
):
{
"mcpServers": {
"web-a11y": {
"command": "node",
"args": ["/path/to/mcp-web-a11y/build/index.js"],
"disabled": false,
"autoApprove": [],
"env": {
"MCP_OUTPUT_DIR": "/path/to/output/directory"
}
}
}
}
MCP_OUTPUT_DIR
: Directory where screenshot outputs will be savedsimulate_colorblind
toolThe server provides two tools: check_accessibility
for analyzing web accessibility and simulate_colorblind
for simulating color blindness.
Checks the accessibility of a given URL using axe-core.
url
(required): The URL to analyzewaitForSelector
(optional): CSS selector to wait for before analysisuserAgent
(optional): Custom user agent string for the request<use_mcp_tool>
<server_name>mcp-web-a11y</server_name>
<tool_name>check_accessibility</tool_name>
<arguments>
{
"url": "https://example.com",
"waitForSelector": ".main-content",
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
}
</arguments>
</use_mcp_tool>
Simulates how a webpage appears to users with different types of color blindness using color matrix transformations.
The tool supports three types of color blindness simulation:
Protanopia (red-blind) - Uses matrix:
0.567, 0.433, 0
0.558, 0.442, 0
0, 0.242, 0.758
Deuteranopia (green-blind) - Uses matrix:
0.625, 0.375, 0
0.7, 0.3, 0
0, 0.3, 0.7
Tritanopia (blue-blind) - Uses matrix:
0.95, 0.05, 0
0, 0.433, 0.567
0, 0.475, 0.525
url
(required): The URL to capturetype
(required): Type of color blindness to simulate ('protanopia', 'deuteranopia', or 'tritanopia')outputPath
(optional): Custom path for the screenshot outputuserAgent
(optional): Custom user agent string for the request<use_mcp_tool>
<server_name>mcp-web-a11y</server_name>
<tool_name>simulate_colorblind</tool_name>
<arguments>
{
"url": "https://example.com",
"type": "deuteranopia",
"outputPath": "colorblind_simulation.png"
}
</arguments>
</use_mcp_tool>
{
"url": "analyzed-url",
"timestamp": "ISO-timestamp",
"violations": [
{
"impact": "serious|critical|moderate|minor",
"description": "Description of the violation",
"help": "Help text explaining the issue",
"helpUrl": "URL to detailed documentation",
"nodes": [
{
"html": "HTML of the affected element",
"failureSummary": "Summary of what needs to be fixed"
}
]
}
],
"passes": 42,
"inapplicable": 45,
"incomplete": 3
}
{
"url": "analyzed-url",
"type": "colorblind-type",
"outputPath": "path/to/screenshot.png",
"timestamp": "ISO-timestamp",
"message": "Screenshot saved with [type] simulation"
}
The server includes comprehensive error handling for common scenarios:
Error responses will include detailed messages to help diagnose the issue.
mcp-web-a11y/
├── src/
│ └── index.ts # Main server implementation
├── build/ # Compiled JavaScript
├── output/ # Generated screenshots
├── package.json # Project dependencies and scripts
└── tsconfig.json # TypeScript configuration
npm run build
This will:
1. Compile TypeScript to JavaScript
2. Make the output file executable
3. Place the compiled files in the build
directory
The server includes detailed debug logging that can be observed in the console output. This includes: - Network requests and responses - Page loading status - Selector waiting status - Any console messages from the analyzed page - Color simulation progress
Verify the URL is accessible
DNS Resolution Errors
Try using the www subdomain
Selector Not Found
Check the page source for the correct selector
Color Simulation Issues
This project is licensed under the MIT License - see the LICENSE file for details.
[
{
"description": "Check web accessibility of a given URL using axe-core",
"inputSchema": {
"properties": {
"url": {
"description": "URL to analyze",
"type": "string"
},
"userAgent": {
"description": "Optional user agent string to use for the request",
"type": "string"
},
"waitForSelector": {
"description": "Optional CSS selector to wait for before analysis",
"type": "string"
}
},
"required": [
"url"
],
"type": "object"
},
"name": "check_accessibility"
},
{
"description": "Simulate how a webpage looks for colorblind users",
"inputSchema": {
"properties": {
"outputPath": {
"description": "Optional path to save the screenshot",
"type": "string"
},
"type": {
"description": "Type of color blindness to simulate",
"enum": [
"protanopia",
"deuteranopia",
"tritanopia"
],
"type": "string"
},
"url": {
"description": "URL to capture",
"type": "string"
},
"userAgent": {
"description": "Optional user agent string to use for the request",
"type": "string"
}
},
"required": [
"url",
"type"
],
"type": "object"
},
"name": "simulate_colorblind"
}
]