The MCP Accessibility Scanner is a powerful tool that enables automated web accessibility testing through the Model Context Protocol. It combines Playwright for browser automation with Axe-core for WCAG compliance checks, allowing you to perform comprehensive accessibility assessments, capture annotated screenshots, and generate detailed reports.
Install the package globally using npm:
npm install -g mcp-accessibility-scanner
Add the Accessibility Scanner to VS Code using the VS Code CLI:
For standard VS Code:
code --add-mcp '{"name":"accessibility-scanner","command":"npx","args":["mcp-accessibility-scanner"]}'
For VS Code Insiders:
code-insiders --add-mcp '{"name":"accessibility-scanner","command":"npx","args":["mcp-accessibility-scanner"]}'
For Claude Desktop, add this to your configuration:
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": ["-y", "mcp-accessibility-scanner"]
}
}
}
For more control, you can use a configuration file:
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": ["-y", "mcp-accessibility-scanner", "--config", "/path/to/config.json"]
}
}
}
Create a config.json file with your preferred settings:
{
"browser": {
"browserName": "chromium",
"launchOptions": {
"headless": true,
"channel": "chrome"
}
},
"timeouts": {
"navigationTimeout": 60000,
"defaultTimeout": 5000
},
"network": {
"allowedOrigins": ["example.com", "trusted-site.com"],
"blockedOrigins": ["ads.example.com"]
}
}
Key configuration options include:
Performs comprehensive accessibility scans:
{
"violationsTag": ["wcag21aa", "cat.color"]
}
Supported violation tags include:
Navigate to a specific URL:
{
"url": "https://example.com"
}
Go back to the previous page (no parameters required).
Go forward to the next page (no parameters required).
Capture an accessibility snapshot of the current page (better than screenshots for analysis).
Click on a page element:
{
"element": "Sign In button",
"ref": "elementReference123",
"doubleClick": false
}
Enter text into form fields:
{
"element": "Email field",
"ref": "elementReference123",
"text": "[email protected]",
"submit": true
}
Hover over an element:
{
"element": "Dropdown menu",
"ref": "elementReference123"
}
Capture screenshots:
{
"filename": "login-page.png",
"element": "Login form",
"ref": "elementReference123"
}
Save page as PDF:
{
"filename": "report.pdf"
}
List all open browser tabs (no parameters required).
Open a new tab:
{
"url": "https://example.com"
}
Switch between tabs:
{
"index": 2
}
View console logs (no parameters required).
Monitor network activity (no parameters required).
1. Navigate to a website:
browser_navigate with url: "https://example.com"
2. Run accessibility scan:
scan_page with violationsTag: ["wcag21aa"]
1. Navigate to form page:
browser_navigate with url: "https://example.com/contact"
2. Capture accessibility snapshot:
browser_snapshot
3. Click on name field:
browser_click with element: "Name field", ref: "ref123"
4. Enter name:
browser_type with element: "Name field", ref: "ref123", text: "John Doe"
5. Check form accessibility:
scan_page with violationsTag: ["cat.forms"]
6. Take screenshot of results:
browser_take_screenshot
1. Open main site:
browser_navigate with url: "https://example.com"
2. Open new tab for comparison:
browser_tab_new with url: "https://competitor.com"
3. Switch to first tab:
browser_tab_select with index: 0
4. Run accessibility scan on first site:
scan_page with violationsTag: ["wcag21aa"]
5. Switch to second tab:
browser_tab_select with index: 1
6. Run accessibility scan on second site:
scan_page with violationsTag: ["wcag21aa"]
1. Navigate to site with dynamic content:
browser_navigate with url: "https://example.com/app"
2. Wait for content to load:
browser_wait_for with text: "Dashboard loaded"
3. Capture accessibility snapshot:
browser_snapshot
4. Run accessibility scan:
scan_page with violationsTag: ["wcag21aa"]
Remember to always capture a snapshot with browser_snapshot before attempting to interact with page elements, as most interaction tools require element references from these snapshots.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "accessibility-scanner" '{"command":"npx","args":["-y","mcp-accessibility-scanner"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": [
"-y",
"mcp-accessibility-scanner"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": [
"-y",
"mcp-accessibility-scanner"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect