MCP WCAG Accessibility Tool
# MCP WCAG Accessibility Tool ๐ฆพ
A powerful Model Context Protocol (MCP) server for comprehensive WCAG accessibility analysis and code remediation.
## ๐ Features
- **10 Professional Tools** for accessibility analysis
- **WCAG 2.0, 2.1, 2.2** support
- **Multi-framework** support (HTML, React, Vue, Angular)
- **Live URL auditing** capability
- **ESLint configuration** generator
- **Automatic code refactoring**
- **GitHub WCAG repository** integration
- **10 languages** supported
## ๐ ๏ธ Available Tools
1. **analyze_accessibility** - Analyze code for WCAG violations
2. **refactor_for_wcag** - Automatically fix accessibility issues
3. **validate_compliance** - Check WCAG compliance levels (A, AA, AAA)
4. **get_documentation** - Get WCAG documentation for specific rules
5. **annotate_code** - Add inline comments with accessibility issues
6. **accessibility_score** - Calculate detailed accessibility score (0-100)
7. **generate_component** - Generate accessible component templates
8. **eslint_config** - Generate ESLint configuration with a11y rules
9. **live_url_audit** - Audit live websites for accessibility
10. **wcag_github_sync** - Sync with official WCAG GitHub repository
## ๐ Prerequisites
- Node.js 18+ (tested with v22.14.0)
- npm or yarn
- Claude Desktop app
## ๐ง Installation
### 1. Clone the repository
```bash
git clone https://github.com/YOUR_USERNAME/mcp-wcag.git
cd mcp-wcag
```
### 2. Install dependencies
```bash
npm install
```
### 3. Build the project
```bash
npm run build
```
### 4. Verify installation
```bash
npm run verify
```
## โ๏ธ Claude Desktop Configuration
### Windows
Add to `%APPDATA%\Claude\claude_desktop_config.json`:
```json
{
"mcpServers": {
"wcag-accessibility": {
"command": "node",
"args": ["C:\\path\\to\\mcp-wcag\\dist\\index.js"]
}
}
}
```
### Mac/Linux
Add to `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"wcag-accessibility": {
"command": "node",
"args": ["/path/to/mcp-wcag/dist/index.js"]
}
}
}
```
## ๐งช Testing
Run the test suite:
```bash
npm test
```
Test individual tools:
```bash
node test-tools.mjs
```
## ๐ Usage Examples
### Analyze HTML for accessibility
```
Analyze this HTML for WCAG AA compliance:
<html>
<img src="test.jpg">
<button></button>
</html>
```
### Generate ESLint configuration
```
Generate an ESLint configuration for React with TypeScript and accessibility rules
```
### Audit a live website
```
Analyze https://example.com for accessibility issues
```
### Generate accessible component
```
Generate an accessible modal component in React
```
## ๐๏ธ Project Structure
```
mcp-wcag/
โโโ src/
โ โโโ index.ts # Main server entry point
โ โโโ core/
โ โ โโโ WCAGAnalyzer.ts
โ โ โโโ CodeParser.ts
โ โ โโโ AccessibilityFixer.ts
โ โโโ rules/
โ โ โโโ wcagRules.ts
โ โโโ tools/
โ โโโ analyzeAccessibility.ts
โ โโโ refactorForWCAG.ts
โ โโโ validateCompliance.ts
โ โโโ ... (7 more tools)
โโโ dist/ # Compiled JavaScript
โโโ wcag-data/ # Local WCAG data cache
โโโ package.json
โโโ tsconfig.json
โโโ README.md
```
## ๐ Development
### Watch mode
```bash
npm run dev
```
### Lint code
```bash
npm run lint
```
### Format code
```bash
npm run format
```
## ๐ Troubleshooting
### Common Issues
**Issue**: `require is not defined`
- **Solution**: Project uses ES modules. All imports must use `import` syntax.
**Issue**: Server crashes on startup
- **Solution**: Run `npm run verify` to check installation
**Issue**: Tools not showing in Claude
- **Solution**: Restart Claude Desktop after configuration
## ๐ WCAG Coverage
- **Automated detection**: ~30-40% of WCAG criteria
- **Success criteria**: 225 total (2.0, 2.1, 2.2)
- **Techniques**: 850+ documented
- **Code examples**: 500+
- **Languages**: 10 (EN, ES, FR, DE, PT, IT, NL, JA, KO, ZH)
## ๐ค Contributing
1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request
## ๐ License
MIT License - see [LICENSE](LICENSE) file for details
## ๐ Acknowledgments
- W3C WAI for WCAG specifications
- Deque Systems for axe-core inspiration
- Claude/Anthropic for MCP framework
- WCAG community for guidelines
## ๐ง Contact
- GitHub: [@YOUR_USERNAME](https://github.com/YOUR_USERNAME)
- Project Link: [https://github.com/YOUR_USERNAME/mcp-wcag](https://github.com/YOUR_USERNAME/mcp-wcag)
## ๐ Version History
- **v3.0.1** - Bug fixes for ES modules and error handling
- **v3.0.0** - Added GitHub WCAG sync
- **v2.1.0** - Added ESLint config and live URL audit
- **v2.0.0** - Added scoring, annotation, and component generation
- **v1.0.0** - Initial release with 4 core tools
---
**Made with โค๏ธ for web accessibility**
TDQS
Scored across 10 tools
Most tools target distinct actions, but analyze_accessibility, validate_compliance, and accessibility_score all inspect code for WCAG-related findings and could be confused depending on whether the agent wants issues, pass/fail validation, or a score. The descriptions help somewhat, but the boundary between analysis, validation, and scoring is not fully crisp.
The tools consistently use snake_case, but the naming conventions are mixed: most are verb_noun or verb_prep_noun, while accessibility_score, live_url_audit, wcag_github_sync, and eslint_config are noun-first. The names remain readable, but the pattern is not predictable.
Ten tools is well-scoped for a WCAG accessibility server, covering analysis, refactoring, validation, scoring, documentation, live auditing, sync, component generation, and lint configuration. Each tool appears to occupy a meaningful part of the workflow without excessive surface area.
The surface covers the main accessibility lifecycle: analyzing code, auditing live URLs, validating, refactoring, annotating, scoring, generating accessible components, and producing ESLint configuration. Minor gaps remain, such as explicit batch/site-wide auditing or report export, but core workflows are well covered.