MCP Accessibility Auditor
README.md
# MCP Accessibility Auditor π
[](https://www.npmjs.com/package/mcp-accessibility-auditor)
[](https://opensource.org/licenses/MIT)
[](https://nodejs.org)
## π― What is it?
**MCP Accessibility Auditor** is a powerful tool that brings professional web accessibility testing directly into your AI assistant (like Claude or Cursor). It scans websites and generates comprehensive reports showing accessibility issues based on WCAG 2.2 standards.
### The Problem It Solves
Web accessibility is crucial but often overlooked. Traditional accessibility testing requires:
- Multiple tools and browser extensions
- Manual checking and documentation
- Technical knowledge to interpret results
- Time-consuming report generation
**This tool solves all of that** by integrating accessibility auditing directly into your AI workflow.
### How It Works
**1. You ask your AI assistant** (in natural language):
```
"Scan https://mywebsite.com for accessibility issues"
```
**2. The tool automatically**:
- Opens the website in a headless browser
- Runs 50+ accessibility tests using industry-standard axe-core
- Analyzes against WCAG 2.2 Level AA standards
- Generates detailed reports (JSON + HTML)
**3. You get back**:
- β
Compliance score (0-100%)
- π Issues prioritized by severity (Critical β Minor)
- π― Exact elements that need fixing
- π‘ Step-by-step fix guidance with code examples
- π WCAG criteria references
- β±οΈ Estimated fix time
### Who Should Use This?
**π¨ Frontend Developers** - Test accessibility while developing, fix issues before production
**π§ͺ QA Engineers** - Automate accessibility testing, generate compliance reports
**βΏ Accessibility Specialists** - Quick audits, client reports, prioritize remediation
**π₯ Product Teams** - Ensure WCAG compliance, track accessibility metrics
## β¨ Features
β
**WCAG 2.2 Level AA Compliance Testing**
β
**Prioritized Issue Reporting** (Critical β Serious β Moderate β Minor)
β
**Fix-Ready Guidance** with code examples for common violations
β
**Dual Format Reports** (JSON + HTML)
β
**Compliance Score Calculation** (0-100%)
β
**Effort Estimation** for remediation
β
**Comprehensive Violation Details** with affected elements
β
**Beautiful HTML Reports** with embedded CSS
## π Quick Start
### Option 1: Install via npm (Recommended)
```bash
npm install -g @sureshdotariya/mcp-accessibility-auditor
```
### Option 2: Clone and Build
```bash
git clone https://github.com/sureshdotariya/mcp-accessibility-auditor.git
cd mcp-accessibility-auditor
npm install
npm run build
```
## π Prerequisites
- **Node.js 18+** (Required for modern JavaScript features)
- **npm** or **yarn**
- An MCP-compatible client (Claude Desktop, Cursor, etc.)
## βοΈ Configuration
### For Claude Desktop
Add to your Claude Desktop config file:
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": ["mcp-accessibility-auditor"]
}
}
}
```
**Or if installed locally:**
```json
{
"mcpServers": {
"accessibility-scanner": {
"command": "node",
"args": ["/absolute/path/to/mcp-accessibility-auditor/dist/index.js"]
}
}
}
```
### For Cursor IDE
Add to MCP Tools settings in Cursor:
```json
{
"mcpServers": {
"accessibility-scanner": {
"command": "npx",
"args": ["mcp-accessibility-auditor"]
}
}
}
```
**After configuration, restart your MCP client.**
## π¬ Usage Examples
### Example 1: Basic Scan
**Prompt:**
```
Scan https://google.com for accessibility issues
```
**Output:**
```
π Accessibility Scan Complete - WCAG 2.2 Level AA
π SCAN SUMMARY:
ββββββββββββββββββββββββββββββββββββββββ
URL: https://google.com
Timestamp: 10/9/2025, 12:40:35 PM
π RESULTS:
ββββββββββββββββββββββββββββββββββββββββ
β
Compliance Score: 90%
π΄ Total Issues: 3
β οΈ Critical/Serious: 2
β±οΈ Estimated Fix Time: 1 hours
π BREAKDOWN BY SEVERITY:
ββββββββββββββββββββββββββββββββββββββββ
π΄ Critical: 2
π Serious: 0
π‘ Moderate: 0
π’ Minor: 1
β Passed Tests: 26
β Incomplete Tests: 0
π§ TOP PRIORITY FIXES:
ββββββββββββββββββββββββββββββββββββββββ
1. Certain ARIA roles must contain particular children
WCAG: wcag2a, wcag131
Priority: P1
Quick Fix: Ensures elements with an ARIA role that require child roles contain them
2. ARIA attributes must conform to valid values
WCAG: wcag2a, wcag412
Priority: P1
Quick Fix: Ensures all ARIA attributes have valid values
3. id attribute value must be unique
WCAG: wcag2a, wcag411
Priority: P4
Quick Fix: Ensures every id attribute value is unique
π GENERATED REPORTS:
ββββββββββββββββββββββββββββββββββββββββ
β ./reports/accessibility-report-google-com-2025-10-09.json
β ./reports/accessibility-report-google-com-2025-10-09.html
```
### Example 2: Perfect Score Website
**Prompt:**
```
Check accessibility on https://company.com/login
```
**Output:**
```
π Accessibility Scan Complete - WCAG 2.2 Level AA
π RESULTS:
ββββββββββββββββββββββββββββββββββββββββ
β
Compliance Score: 96%
π΄ Total Issues: 1
β οΈ Critical/Serious: 1
β±οΈ Estimated Fix Time: 1 hours
β
No accessibility issues found! This page is WCAG 2.2 AA compliant.
```
### Example 3: Get Session Statistics
**Prompt:**
```
Show me accessibility scan statistics
```
**Output:**
```
π Scan Statistics
ββββββββββββββββββββββββββββββββββββββββ
Total Scans Performed: 5
Session Started: 10/9/2025, 2:30:00 PM
```
## π Available Tools
### `scan_accessibility`
Scan a URL for accessibility issues.
**Parameters:**
| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `url` | string | β
Yes | - | The URL to scan (must include protocol) |
| `wcagLevel` | string | No | `AA` | Compliance level: `A`, `AA`, or `AAA` |
| `outputFormat` | string | No | `both` | Report format: `json`, `html`, or `both` |
| `saveToDisk` | boolean | No | `true` | Save reports to ./reports directory |
**Natural Language Examples:**
- "Scan https://example.com for accessibility issues"
- "Check WCAG AAA compliance on https://mysite.com"
- "Audit https://app.example.com and give me JSON only"
### `get_scan_statistics`
Get statistics about scans performed in the current session.
**Natural Language Example:**
- "Show me scan statistics"
- "How many pages have I scanned?"
## π Output Formats
### Console Output
Real-time summary with:
- β
Compliance score (0-100%)
- π΄ Issue breakdown by severity
- π§ Top priority fixes with WCAG references
- β±οΈ Estimated fix time
- π Report file locations
### JSON Report
Structured data perfect for:
- CI/CD pipeline integration
- Custom reporting tools
- Automated tracking
- API integration
**Sample structure:**
```json
{
"result": {
"url": "https://example.com",
"timestamp": "2025-10-09T14:30:15.000Z",
"violations": [...],
"passes": 38,
"violationCount": 12,
"criticalCount": 2,
"complianceScore": 72
},
"fixGuidance": [...],
"summary": {
"totalIssues": 12,
"criticalIssues": 5,
"estimatedEffort": "2-5 days"
}
}
```
### HTML Report
Beautiful, self-contained report with:
- π Visual summary dashboard
- π¨ Color-coded severity levels
- π Expandable violation details
- π‘ Code examples for fixes
- π Direct links to WCAG documentation
- π± Responsive design
**Open HTML reports:**
```bash
# macOS/Linux
open reports/accessibility-report-*.html
# Windows
start reports/accessibility-report-*.html
```
## π What Gets Scanned
The scanner checks for **50+ common accessibility issues** including:
### π΄ Critical/Serious Issues
- Color contrast violations (WCAG 1.4.3)
- Missing form labels (WCAG 1.3.1, 3.3.2)
- Missing image alt text (WCAG 1.1.1)
- Buttons/links without accessible names (WCAG 4.1.2)
- Missing page language (WCAG 3.1.1)
- ARIA implementation errors (WCAG 4.1.2)
### π‘ Moderate Issues
- Heading structure problems (WCAG 1.3.1)
- Landmark navigation issues (WCAG 2.4.1)
- Focus management problems (WCAG 2.4.7)
- Keyboard accessibility (WCAG 2.1.1)
### π’ Minor Issues
- Semantic HTML improvements
- Best practice recommendations
- Duplicate IDs (WCAG 4.1.1)
## π‘ Fix Guidance
Each violation includes comprehensive guidance:
- **WCAG Criteria**: Direct mapping to WCAG 2.2 success criteria
- **Priority Level**: P1 (Critical) β P4 (Minor)
- **Common Causes**: Why the issue occurs
- **How to Fix**: Step-by-step remediation instructions
- **Code Examples**: Before/after code snippets
- **Learn More**: Links to detailed documentation
**Example Fix Guidance:**
```
Color Contrast Insufficient
ββββββββββββββββββββββββββββββββββββββββ
π‘ How to Fix:
β’ Ensure normal text has a contrast ratio of at least 4.5:1
β’ Ensure large text (18pt+) has a contrast ratio of at least 3:1
β’ Use tools like WebAIM Contrast Checker to verify colors
Code Example:
/* Before - Insufficient contrast */
.text { color: #999; background: #fff; }
/* After - Sufficient contrast */
.text { color: #595959; background: #fff; } /* 7:1 ratio */
```
## π― Use Cases
### Development Workflow
```
"Before I commit this PR, scan the feature preview at
https://preview-pr-123.staging.company.com"
```
### QA Testing
```
"Run accessibility scans on all main user flows:
1. /signup
2. /dashboard
3. /checkout"
```
### Compliance Audits
```
"Generate a comprehensive WCAG 2.2 AA audit report for
https://company.com"
```
### Competitor Analysis
```
"Compare accessibility between:
- Our site: https://oursite.com
- Competitor: https://competitor.com"
```
## ποΈ Architecture
```
src/
βββ index.ts # MCP server implementation
βββ scanner.ts # Accessibility scanning engine (Puppeteer + axe-core)
βββ reporter.ts # Report generation (JSON + HTML)
βββ guidance.ts # Fix guidance database
βββ types.ts # TypeScript type definitions
```
## π§ Technical Details
### Core Dependencies
- **@modelcontextprotocol/sdk**: MCP server implementation
- **puppeteer**: Headless browser automation
- **axe-core**: Industry-standard accessibility testing engine (Deque Systems)
- **axe-puppeteer**: Integration layer between Puppeteer and axe-core
### Performance
- β‘ Average scan time: 5-15 seconds per page
- π Handles dynamic content and SPAs
- π‘οΈ Automatic retries and error handling
- πΎ Memory-efficient with proper cleanup
### Compliance Standards
- β
**WCAG 2.2 Level AA** (default)
- β
**WCAG 2.1 Level AA** (backward compatible)
- β
**WCAG 2.0 Level AA** (backward compatible)
- βοΈ Configurable for Level A or AAA testing
## β οΈ Limitations
- Requires JavaScript execution (uses headless browser)
- Cannot scan password-protected pages without authentication setup
- Best for public websites and web applications
- Some manual testing may still be required for complete accessibility audits
- Cannot detect all accessibility issues (e.g., context-dependent problems)
## π οΈ Development
```bash
# Watch mode for development
npm run watch
# Build for production
npm run build
# Run the server directly
npm start
# Run with development build
npm run dev
```
## π¦ Publishing
See [NPM_PUBLISHING_GUIDE.md](./NPM_PUBLISHING_GUIDE.md) for detailed publishing instructions.
## πΊοΈ Roadmap
- [ ] Authentication support for protected pages
- [ ] Batch scanning multiple URLs
- [ ] Custom rule configuration
- [ ] CI/CD integration examples
- [ ] PDF report generation
- [ ] Historical scan comparison
- [ ] Screenshot capture of violations
- [ ] Integration with popular issue trackers
## π€ Contributing
Contributions are welcome! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
**Areas for improvement:**
- Additional fix guidance for more violation types
- Enhanced HTML report styling
- Support for more WCAG criteria
- Performance optimizations
- Additional language support
## π License
MIT License - see [LICENSE](./LICENSE) file for details.
## π Support & Resources
### Getting Help
- π [Quick Start Guide](./QUICK_START.md)
- π [Report Issues](https://github.com/sureshdotariya/mcp-accessibility-auditor/issues)
- π¬ [Discussions](https://github.com/sureshdotariya/mcp-accessibility-auditor/discussions)
### Accessibility Resources
- [WCAG 2.2 Guidelines](https://www.w3.org/WAI/WCAG22/quickref/)
- [axe-core Rules](https://github.com/dequelabs/axe-core/blob/develop/doc/rule-descriptions.md)
- [WebAIM Resources](https://webaim.org/resources/)
- [A11y Project Checklist](https://www.a11yproject.com/checklist/)
### MCP Resources
- [Model Context Protocol Docs](https://modelcontextprotocol.io/)
- [Claude Desktop](https://claude.ai/download)
- [MCP Servers Repository](https://github.com/modelcontextprotocol/servers)
## π Star History
If you find this tool helpful, please consider giving it a star on GitHub!
---
**Built with β€οΈ for accessible web experiences**
*Making the web accessible, one scan at a time.*
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues