accessibility-hub 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,755 +1,105 @@
1
1
  # AccesibilityHub
2
2
 
3
- MCP Server for orchestrating web accessibility tools (axe-core, Pa11y).
3
+ MCP Server for orchestrating web accessibility tools (axe-core, Pa11y). Analyze web pages, check color contrast, and get detailed WCAG compliance reports with enriched human context.
4
4
 
5
- ## 📑 Table of Contents
5
+ [![npm version](https://img.shields.io/npm/v/accessibilityhub)](https://www.npmjs.com/package/accessibility-hub)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
7
 
7
- - [📚 Documentation](#-documentation)
8
- - [Available Tools](#available-tools)
9
- - [analyze-with-axe](#analyze-with-axe)
10
- - [analyze-with-pa11y](#analyze-with-pa11y)
11
- - [analyze-contrast](#analyze-contrast)
12
- - [analyze-mixed ⭐](#analyze-mixed-)
13
- - [Available Prompts](#available-prompts)
14
- - [full-accessibility-audit](#full-accessibility-audit)
15
- - [quick-accessibility-check](#quick-accessibility-check)
16
- - [contrast-check](#contrast-check)
17
- - [pre-deploy-check](#pre-deploy-check)
18
- - [quick-wins-report](#quick-wins-report)
19
- - [explain-wcag-criterion](#explain-wcag-criterion)
20
- - [Available Resources](#available-resources)
21
- - [WCAG Resources](#wcag-resources)
22
- - [Contrast Resources](#contrast-resources)
23
- - [Enriched Human Context ✨](#enriched-human-context-)
24
- - [Project Structure](#project-structure)
25
- - [Scripts](#scripts)
26
- - [Installation](#installation)
27
- - [MCP Client Configuration](#mcp-client-configuration)
28
- - [Claude Desktop](#claude-desktop)
29
- - [Cursor](#cursor)
30
- - [Windsurf](#windsurf)
31
- - [Claude Code](#claude-code)
32
- - [Usage](#usage)
33
- - [Local Development](#local-development)
34
- - [Configuration](#configuration)
35
- - [Requirements](#requirements)
36
- - [Main Dependencies](#main-dependencies)
37
- - [Support Me](#support-me)
8
+ ## Quick Start
38
9
 
39
- [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/theraaskin)
40
- [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/raskreation)
41
-
42
- ## 📚 Documentation
43
-
44
- - **[USAGE.md](./USAGE.md)** - Complete usage guide, workflows and effective prompts
45
- - **[EXAMPLES.md](./EXAMPLES.md)** - Concrete input/output examples for each tool
46
-
47
-
48
-
49
- ## Available Tools
50
-
51
- ### `analyze-with-axe`
52
-
53
- Analyzes a web page or HTML content to detect accessibility issues using axe-core.
54
-
55
- **Parameters:**
56
-
57
- | Parameter | Type | Required | Description |
58
- |-----------|------|----------|-------------|
59
- | `url` | string | url or html | URL of the page to analyze |
60
- | `html` | string | url or html | Raw HTML content to analyze |
61
- | `options.wcagLevel` | "A" \| "AA" \| "AAA" | No | WCAG level to verify (default: AA) |
62
- | `options.rules` | string[] | No | Specific axe rule IDs to run |
63
- | `options.excludeRules` | string[] | No | Axe rule IDs to exclude |
64
- | `options.includeIncomplete` | boolean | No | Include "needs-review" results (default: false) |
65
- | `options.browser.waitForSelector` | string | No | CSS selector to wait for before analysis |
66
- | `options.browser.viewport` | object | No | Viewport dimensions |
67
-
68
- **Response example:**
69
-
70
- ```json
71
- {
72
- "success": true,
73
- "target": "https://example.com",
74
- "issueCount": 3,
75
- "issues": [
76
- {
77
- "id": "axe-0",
78
- "ruleId": "image-alt",
79
- "tool": "axe-core",
80
- "severity": "critical",
81
- "wcag": {
82
- "criterion": "1.1.1",
83
- "level": "A",
84
- "principle": "perceivable"
85
- },
86
- "location": {
87
- "selector": "img",
88
- "snippet": "<img src=\"logo.png\">"
89
- },
90
- "message": "Images must have alternate text",
91
- "affectedUsers": ["screen-reader"]
92
- }
93
- ],
94
- "summary": {
95
- "total": 3,
96
- "bySeverity": { "critical": 1, "serious": 2, "moderate": 0, "minor": 0 }
97
- },
98
- "duration": 1234
99
- }
100
- ```
101
-
102
- ### `analyze-with-pa11y`
103
-
104
- Analyzes a web page or HTML content using Pa11y.
105
-
106
- **Parameters similar to axe**, with `options.standard` to choose the WCAG standard (WCAG2AA, WCAG21AA, etc.).
107
-
108
- ### `analyze-contrast`
109
-
110
- Analyzes a web page or HTML content to detect color contrast issues according to WCAG 2.1. Supports the standard WCAG 2.1 algorithm and the new APCA (WCAG 3.0 draft).
111
-
112
- **Parameters:**
113
-
114
- | Parameter | Type | Required | Description |
115
- |-----------|------|----------|-------------|
116
- | `url` | string | url or html | URL of the page to analyze |
117
- | `html` | string | url or html | Raw HTML content to analyze |
118
- | `options.contrastAlgorithm` | "WCAG21" \| "APCA" | No | Contrast algorithm: WCAG21 (standard) or APCA (WCAG 3.0 draft - experimental). Default: WCAG21 |
119
- | `options.wcagLevel` | "AA" \| "AAA" | No | WCAG level: AA (4.5:1 normal, 3:1 large) or AAA (7:1 normal, 4.5:1 large). Default: AA |
120
- | `options.suggestFixes` | boolean | No | Suggest color fixes (default: true) |
121
- | `options.includePassingElements` | boolean | No | Include passing elements in results (default: false) |
122
- | `options.selector` | string | No | CSS selector to limit analysis to a specific element |
123
- | `options.browser.waitForSelector` | string | No | CSS selector to wait for before analysis |
124
- | `options.browser.viewport` | object | No | Viewport dimensions |
125
- | `options.browser.ignoreHTTPSErrors` | boolean | No | Ignore SSL certificate errors (default: false) |
126
-
127
- **Contrast algorithms:**
128
-
129
- | Algorithm | Description | Thresholds |
130
- |-----------|-------------|----------|
131
- | **WCAG21** | Current standard. Uses relative luminance ratios. | AA: 4.5:1 (normal), 3:1 (large). AAA: 7:1 (normal), 4.5:1 (large) |
132
- | **APCA** | WCAG 3.0 draft. Uses perceptual lightness (Lc). More accurate for text. | Body text: 75Lc, large text: 60Lc, non-text elements: 45Lc |
133
-
134
- **Response example (WCAG21):**
135
-
136
- ```json
137
- {
138
- "success": true,
139
- "target": "https://example.com",
140
- "wcagLevel": "AA",
141
- "issueCount": 2,
142
- "issues": [
143
- {
144
- "id": "contrast-0",
145
- "ruleId": "color-contrast",
146
- "tool": "contrast-analyzer",
147
- "severity": "serious",
148
- "wcag": {
149
- "criterion": "1.4.3",
150
- "level": "AA",
151
- "principle": "perceivable"
152
- },
153
- "location": {
154
- "selector": "p.subtitle",
155
- "snippet": "<p class=\"subtitle\">Sample text</p>"
156
- },
157
- "message": "Contrast ratio 3.2:1 does not meet AA requirements (4.5:1 required for normal text)",
158
- "contrastData": {
159
- "foreground": "rgb(150, 150, 150)",
160
- "background": "rgb(255, 255, 255)",
161
- "currentRatio": 3.2,
162
- "requiredRatio": 4.5,
163
- "isLargeText": false,
164
- "fontSize": 16,
165
- "fontWeight": 400,
166
- "suggestedFix": {
167
- "foreground": "#767676",
168
- "background": "#ffffff",
169
- "newRatio": 4.54
170
- }
171
- },
172
- "affectedUsers": ["low-vision", "color-blind"]
173
- }
174
- ],
175
- "summary": {
176
- "total": 15,
177
- "passing": 13,
178
- "failing": 2,
179
- "byTextSize": {
180
- "normalText": { "passing": 10, "failing": 2 },
181
- "largeText": { "passing": 3, "failing": 0 }
182
- }
183
- },
184
- "duration": 1543
185
- }
10
+ ```bash
11
+ npm install -g AccesibilityHub
186
12
  ```
187
13
 
188
- **Response example (APCA):**
14
+ Add to your MCP client configuration:
189
15
 
190
16
  ```json
191
17
  {
192
- "success": true,
193
- "target": "https://example.com",
194
- "wcagLevel": "AA",
195
- "issueCount": 1,
196
- "issues": [
197
- {
198
- "id": "contrast-0",
199
- "ruleId": "color-contrast",
200
- "tool": "contrast-analyzer",
201
- "severity": "serious",
202
- "wcag": {
203
- "criterion": "1.4.3",
204
- "level": "AA",
205
- "principle": "perceivable",
206
- "title": "Contrast (APCA - WCAG 3.0 Draft)"
207
- },
208
- "location": {
209
- "selector": "p.subtitle",
210
- "snippet": "<p class=\"subtitle\">Sample text</p>"
211
- },
212
- "message": "APCA lightness 45.2Lc does not meet requirements (75Lc required for body text)",
213
- "contrastData": {
214
- "foreground": "rgb(150, 150, 150)",
215
- "background": "rgb(255, 255, 255)",
216
- "currentRatio": 45.2,
217
- "requiredRatio": 75,
218
- "isLargeText": false,
219
- "fontSize": 16,
220
- "fontWeight": 400,
221
- "suggestedFix": {
222
- "foreground": "#5a5a5a",
223
- "background": "#ffffff",
224
- "newRatio": 75.1
225
- }
226
- },
227
- "affectedUsers": ["low-vision", "color-blind"]
18
+ "mcpServers": {
19
+ "AccesibilityHub": {
20
+ "command": "npx",
21
+ "args": ["-y", "AccesibilityHub"]
228
22
  }
229
- ],
230
- "summary": {
231
- "total": 15,
232
- "passing": 14,
233
- "failing": 1
234
- },
235
- "duration": 1234
23
+ }
236
24
  }
237
25
  ```
238
26
 
239
- **WCAG Criteria:**
240
- - 1.4.3 Contrast (Minimum) - Level AA
241
- - 1.4.6 Contrast (Enhanced) - Level AAA
242
-
243
- **APCA (Accessible Perceptual Contrast Algorithm):**
244
- - More accurate perceptual algorithm, part of the WCAG 3.0 draft
245
- - Measures "lightness contrast" (Lc) instead of ratios
246
- - Considers contrast direction (light text on dark vs dark text on light)
247
- - Experimental: not yet an official standard
248
-
249
- ### `analyze-mixed` ⭐
27
+ Then ask your AI assistant:
250
28
 
251
- **Synthesis tool for web analysis** that runs axe-core and Pa11y in parallel and combines the results.
29
+ > "Analyze the accessibility of https://example.com"
252
30
 
253
- **Parameters:**
254
- - `url` or `html`: Web target to analyze (required)
255
- - `tools`: Array of tools to run (default: `['axe-core', 'pa11y']`)
256
- - `options.deduplicateResults`: Remove duplicate issues (default: `true`)
257
- - `options.wcagLevel`: WCAG level (default: `'AA'`)
31
+ ## Available Tools
258
32
 
259
- **Response includes:**
260
- - `issues`: Combined and deduplicated issues
261
- - `issuesByWCAG`: Issues grouped by WCAG criterion
262
- - `summary.byTool`: Issue count by tool
263
- - `individualResults`: Complete results from each tool
264
- - `deduplicatedCount`: Number of duplicates removed
33
+ | Tool | Description | Docs |
34
+ |------|-------------|------|
35
+ | `analyze-with-axe` | Analyze accessibility using axe-core | [docs/tools/analyze-with-axe.md](docs/tools/analyze-with-axe.md) |
36
+ | `analyze-with-pa11y` | Analyze accessibility using Pa11y | [docs/tools/analyze-with-pa11y.md](docs/tools/analyze-with-pa11y.md) |
37
+ | `analyze-contrast` | Check color contrast (WCAG 2.1 / APCA) | [docs/tools/analyze-contrast.md](docs/tools/analyze-contrast.md) |
38
+ | `analyze-mixed` | Run multiple tools in parallel and combine results | [docs/tools/analyze-mixed.md](docs/tools/analyze-mixed.md) |
265
39
 
266
40
  ## Available Prompts
267
41
 
268
- MCP Prompts are user-controlled templates that generate structured messages for accessibility workflows. Unlike tools (which the LLM executes), prompts are invoked directly by users from clients like Claude Desktop or Cursor.
269
-
270
- ### `full-accessibility-audit`
271
-
272
- Comprehensive accessibility audit using axe-core and Pa11y with detailed remediation guidance.
273
-
274
- **Arguments:**
275
-
276
- | Parameter | Type | Required | Description |
277
- |-----------|------|----------|-------------|
278
- | `url` | string | Yes | URL of the page to analyze |
279
- | `wcagLevel` | "A" \| "AA" \| "AAA" | No | WCAG conformance level (default: AA) |
280
-
281
- **What it provides:**
282
- - Executive summary with issue breakdown by severity
283
- - Issues grouped by WCAG principle (Perceivable, Operable, Understandable, Robust)
284
- - Critical issues with real-world impact analysis
285
- - Prioritized remediation plan with code examples
286
-
287
- ---
288
-
289
- ### `quick-accessibility-check`
290
-
291
- Fast accessibility check using axe-core with summary of critical issues.
292
-
293
- **Arguments:**
294
-
295
- | Parameter | Type | Required | Description |
296
- |-----------|------|----------|-------------|
297
- | `url` | string | Yes | URL of the page to analyze |
298
-
299
- **What it provides:**
300
- - Quick summary of total issues by severity
301
- - Critical and serious issues with quick fix suggestions
302
- - Recommendations for next steps
303
-
304
- ---
305
-
306
- ### `contrast-check`
307
-
308
- Analyze color contrast accessibility issues using WCAG 2.1 or APCA algorithms with fix suggestions.
309
-
310
- **Arguments:**
311
-
312
- | Parameter | Type | Required | Description |
313
- |-----------|------|----------|-------------|
314
- | `url` | string | Yes | URL of the page to analyze |
315
- | `selector` | string | No | CSS selector to scope the analysis |
316
- | `algorithm` | "WCAG21" \| "APCA" | No | Contrast algorithm (default: WCAG21) |
317
- | `wcagLevel` | "AA" \| "AAA" | No | WCAG level for contrast requirements (default: AA) |
318
- | `language` | string | No | Language for the output report |
319
-
320
- **What it provides:**
321
- - Contrast analysis summary with pass/fail statistics
322
- - Detailed failing elements with current vs required ratios
323
- - Suggested color fixes with CSS code snippets
324
- - Implementation guide with best practices
325
-
326
- ---
327
-
328
- ### `pre-deploy-check`
329
-
330
- Verify accessibility compliance before deploying to production.
331
-
332
- **Arguments:**
333
-
334
- | Parameter | Type | Required | Description |
335
- |-----------|------|----------|-------------|
336
- | `url` | string | Yes | URL of the page to verify |
337
-
338
- **What it provides:**
339
- - Clear GO/NO-GO deployment decision
340
- - Blocking issues that must be fixed before deployment
341
- - Non-blocking issues for post-deployment
342
- - WCAG 2.1 Level AA compliance summary
343
- - Risk assessment and recommended actions
344
-
345
- ---
346
-
347
- ### `quick-wins-report`
348
-
349
- Identify high-impact accessibility issues that require minimal effort to fix.
350
-
351
- **Arguments:**
352
-
353
- | Parameter | Type | Required | Description |
354
- |-----------|------|----------|-------------|
355
- | `url` | string | Yes | URL of the page to analyze |
356
-
357
- **What it provides:**
358
- - Priority-ordered list of quick wins
359
- - Impact and effort estimates for each issue
360
- - Before/after code examples
361
- - Copyable implementation checklist
362
- - Estimated accessibility improvement after fixes
363
-
364
- ---
365
-
366
- ### `explain-wcag-criterion`
367
-
368
- Get detailed explanation of a WCAG criterion with examples and remediation guidance.
369
-
370
- **Arguments:**
371
-
372
- | Parameter | Type | Required | Description |
373
- |-----------|------|----------|-------------|
374
- | `criterion` | string | Yes | WCAG criterion ID (e.g., 1.1.1, 2.4.4, 1.4.3) |
375
-
376
- **What it provides:**
377
- - Deep dive into the criterion meaning and importance
378
- - Code examples (before/after)
379
- - Testing strategies (manual and automated)
380
- - Common mistakes and how to avoid them
381
- - Links to official WCAG documentation
382
-
383
- ---
42
+ | Prompt | Description | Docs |
43
+ |--------|-------------|------|
44
+ | `full-accessibility-audit` | Comprehensive audit with remediation guidance | [docs/prompts/full-accessibility-audit.md](docs/prompts/full-accessibility-audit.md) |
45
+ | `quick-accessibility-check` | Fast check with critical issues summary | [docs/prompts/quick-accessibility-check.md](docs/prompts/quick-accessibility-check.md) |
46
+ | `contrast-check` | Color contrast analysis with fix suggestions | [docs/prompts/contrast-check.md](docs/prompts/contrast-check.md) |
47
+ | `pre-deploy-check` | Verify compliance before deployment | [docs/prompts/pre-deploy-check.md](docs/prompts/pre-deploy-check.md) |
48
+ | `quick-wins-report` | High-impact, low-effort fixes | [docs/prompts/quick-wins-report.md](docs/prompts/quick-wins-report.md) |
49
+ | `explain-wcag-criterion` | Deep dive into any WCAG criterion | [docs/prompts/explain-wcag-criterion.md](docs/prompts/explain-wcag-criterion.md) |
384
50
 
385
51
  ## Available Resources
386
52
 
387
- MCP Resources provide read-only data that clients can query directly. These are ideal for static reference information like WCAG criteria and contrast thresholds.
388
-
389
- ### WCAG Resources
390
-
391
- | URI | Type | Description |
392
- |-----|------|-------------|
393
- | `wcag://criteria` | Static | List of all available WCAG 2.1 criteria |
394
- | `wcag://criteria/{id}` | Template | Specific criterion by ID (e.g., `1.4.3`) |
395
- | `wcag://criteria/level/{level}` | Template | Criteria by conformance level (A, AA, AAA) |
396
- | `wcag://criteria/principle/{principle}` | Template | Criteria by POUR principle (perceivable, operable, understandable, robust) |
397
-
398
- **Example response from `wcag://criteria/1.4.3`:**
399
-
400
- ```json
401
- {
402
- "id": "1.4.3",
403
- "title": "Contrast (Minimum)",
404
- "level": "AA",
405
- "principle": "perceivable",
406
- "guideline": "1.4",
407
- "description": "The visual presentation of text and images of text has a contrast ratio of at least 4.5:1",
408
- "affectedUsers": ["low-vision", "color-blind"],
409
- "suggestedActions": ["Ensure text has sufficient contrast against background"]
410
- }
411
- ```
412
-
413
- ### Contrast Resources
414
-
415
- | URI | Type | Description |
416
- |-----|------|-------------|
417
- | `contrast://thresholds/wcag21` | Static | WCAG 2.1 contrast ratio thresholds |
418
- | `contrast://thresholds/apca` | Static | APCA contrast thresholds (WCAG 3.0 draft) |
419
- | `contrast://algorithms` | Static | Supported contrast algorithms with descriptions |
420
-
421
- **Example response from `contrast://thresholds/wcag21`:**
422
-
423
- ```json
424
- {
425
- "AA_NORMAL": { "ratio": 4.5, "description": "Normal text (< 18pt or < 14pt bold)" },
426
- "AA_LARGE": { "ratio": 3.0, "description": "Large text (>= 18pt or >= 14pt bold)" },
427
- "AAA_NORMAL": { "ratio": 7.0, "description": "Enhanced contrast for normal text" },
428
- "AAA_LARGE": { "ratio": 4.5, "description": "Enhanced contrast for large text" },
429
- "NON_TEXT": { "ratio": 3.0, "description": "UI components and graphical objects" }
430
- }
431
- ```
432
-
433
- **Example response from `contrast://algorithms`:**
434
-
435
- ```json
436
- [
437
- {
438
- "id": "WCAG21",
439
- "name": "WCAG 2.1 Contrast Ratio",
440
- "description": "Standard contrast ratio algorithm defined in WCAG 2.1",
441
- "standard": "WCAG 2.1 Success Criterion 1.4.3 / 1.4.6",
442
- "thresholdUri": "contrast://thresholds/wcag21"
443
- },
444
- {
445
- "id": "APCA",
446
- "name": "Advanced Perceptual Contrast Algorithm",
447
- "description": "Advanced algorithm considering human visual perception more accurately",
448
- "standard": "WCAG 3.0 (Draft)",
449
- "thresholdUri": "contrast://thresholds/apca"
450
- }
451
- ]
452
- ```
453
-
454
- ---
53
+ | Resource | Description | Docs |
54
+ |----------|-------------|------|
55
+ | `wcag://criteria` | WCAG 2.1 criteria reference data | [docs/resources/wcag-criteria.md](docs/resources/wcag-criteria.md) |
56
+ | `contrast://thresholds/*` | Contrast thresholds (WCAG 2.1 / APCA) | [docs/resources/contrast-thresholds.md](docs/resources/contrast-thresholds.md) |
455
57
 
456
58
  ## Enriched Human Context ✨
457
59
 
458
- All issues automatically include:
60
+ All accessibility issues include enriched context to help you understand and fix them:
459
61
 
460
- - **Expanded description** of the violated WCAG criterion
461
- - **Impact on real users** with concrete examples
62
+ - **WCAG criterion explanation** with real-world impact
462
63
  - **Affected users** (screen-reader, keyboard-only, low-vision, etc.)
463
- - **Remediation priority** (critical, high, medium, low)
464
- - **Fix effort** (low, medium, high)
465
- - **Suggested solutions** step by step
64
+ - **Remediation priority** and **fix effort** estimates
65
+ - **Step-by-step suggested solutions**
466
66
 
467
- Enriched issue example:
468
67
  ```json
469
68
  {
470
69
  "ruleId": "image-alt",
471
70
  "severity": "serious",
472
- "humanContext": "**Non-text content (WCAG 1.1.1 - Level A)**\n\nScreen reader users...",
473
- "suggestedActions": ["Add descriptive alt attribute to images", ...],
71
+ "humanContext": "Non-text content (WCAG 1.1.1 - Level A)...",
474
72
  "affectedUsers": ["screen-reader", "low-vision"],
475
73
  "priority": "critical",
476
74
  "remediationEffort": "low"
477
75
  }
478
76
  ```
479
77
 
480
- WCAG data is maintained in `src/shared/data/wcag-criteria.json` and is easily updatable.
481
-
482
- ## Project Structure
483
-
484
- ```
485
- src/
486
- ├── server.ts # MCP entry point
487
- ├── prompts/ # MCP Prompts (user-controlled templates)
488
- │ ├── index.ts # Re-exports of all prompts
489
- │ ├── types/ # PromptDefinition, PromptResult
490
- │ ├── audit/ # Audit prompts
491
- │ │ ├── full-accessibility-audit.ts
492
- │ │ └── quick-accessibility-check.ts
493
- │ ├── contrast/ # Contrast prompts
494
- │ │ └── contrast-check.ts
495
- │ ├── workflows/ # Workflow prompts
496
- │ │ ├── pre-deploy-check.ts
497
- │ │ └── quick-wins-report.ts
498
- │ └── educational/ # Educational prompts
499
- │ └── explain-wcag-criterion.ts
500
- ├── resources/ # MCP Resources (read-only data)
501
- │ ├── index.ts # Re-exports of all resources
502
- │ ├── types/ # ResourceDefinition types
503
- │ ├── wcag/ # WCAG criteria resources
504
- │ │ ├── wcag.resources.ts # Resource registration
505
- │ │ └── wcag.data.ts # Data access functions
506
- │ └── contrast/ # Contrast threshold resources
507
- │ ├── contrast.resources.ts
508
- │ └── contrast.data.ts
509
- ├── shared/ # Shared resources between tools
510
- │ ├── adapters/ # Base adapter class
511
- │ ├── data/ # WCAG knowledge base
512
- │ │ └── wcag-criteria.json
513
- │ ├── types/ # Shared types (accessibility, analysis)
514
- │ └── utils/ # Common utilities
515
- │ ├── logger.ts # Structured logging
516
- │ └── wcag-context.ts
517
- └── tools/ # MCP Tools (modular structure)
518
- ├── index.ts # Re-exports of all tools
519
- ├── Base/ # Base utilities for tools
520
- │ ├── types/ # ToolDefinition, ToolResponse
521
- │ └── utils/ # createTextResponse, withToolContext
522
- ├── Axe/ # analyze-with-axe tool
523
- │ ├── adapters/ # AxeAdapter (puppeteer + axe-core)
524
- │ ├── types/ # Input/output schemas
525
- │ ├── utils/ # Specific utilities
526
- │ └── main.ts # Tool definition
527
- ├── Pa11y/ # analyze-with-pa11y tool
528
- │ ├── adapters/ # Pa11yAdapter
529
- │ ├── normalizers/ # Results transformation
530
- │ ├── types/
531
- │ └── main.ts
532
- ├── Contrast/ # analyze-contrast tool
533
- │ ├── adapters/ # ContrastAdapter
534
- │ ├── types/ # Color and contrast types
535
- │ ├── utils/ # Contrast calculation, parsers, converters
536
- │ └── main.ts
537
- └── AnalyzeMixed/ # analyze-mixed tool (multi-tool)
538
- ├── types/
539
- ├── utils/ # Deduplication, WCAG grouping
540
- └── main.ts
541
-
542
- tests/
543
- ├── fixtures/ # HTML with known accessibility issues
544
- ├── helpers/ # Test utilities (mock server, etc.)
545
- ├── setup.ts # Global test configuration
546
- ├── resources/ # Resource tests
547
- │ ├── wcag/
548
- │ │ └── wcag.resources.test.ts
549
- │ └── contrast/
550
- │ └── contrast.resources.test.ts
551
- └── tools/ # Tests organized by tool
552
- ├── Axe/
553
- │ ├── adapters.test.ts
554
- │ └── main.test.ts
555
- └── Contrast/
556
- ├── adapters.test.ts
557
- └── utils/ # Color utility tests
558
- ```
559
-
560
- ## Scripts
561
-
562
- ```bash
563
- pnpm build # Compile to dist/
564
- pnpm dev # Watch mode
565
- pnpm typecheck # Type checking
566
- pnpm start # Start server
567
- pnpm format # Format code with Prettier
568
- pnpm format:check # Check formatting
569
- pnpm test # Run tests
570
- pnpm test:watch # Tests in watch mode
571
- pnpm test:coverage # Tests with coverage report
572
- pnpm inspect # Launch MCP inspector for debugging MCP tools
573
- ```
574
-
575
- ## Installation
576
-
577
- ```bash
578
- npm install -g AccesibilityHub
579
- ```
580
-
581
- Or with pnpm:
582
-
583
- ```bash
584
- pnpm add -g AccesibilityHub
585
- ```
586
-
587
- ## MCP Client Configuration
588
-
589
- ### Claude Desktop
590
-
591
- 1. Open the configuration file:
592
- - **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
593
- - **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
594
- - **Linux**: `~/.config/Claude/claude_desktop_config.json`
595
-
596
- 2. Add the server configuration:
597
-
598
- ```json
599
- {
600
- "mcpServers": {
601
- "AccesibilityHub": {
602
- "command": "npx",
603
- "args": ["-y", "AccesibilityHub"],
604
- "env": {
605
- "LOG_LEVEL": "info"
606
- }
607
- }
608
- }
609
- }
610
- ```
611
-
612
- 3. Restart Claude Desktop
613
-
614
- ### Cursor
615
-
616
- #### One-click quick installation
617
-
618
- [<img src="https://cursor.com/deeplink/mcp-install-dark.svg" alt="Install in Cursor">](https://cursor.com/en/install-mcp?name=accessibility-hub&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImFjY2Vzc2liaWxpdHktaHViIl19)
619
-
620
- #### Manual installation
621
-
622
- 1. Create or edit the `.cursor/mcp.json` file in your working directory
623
-
624
- 2. Add the configuration:
625
-
626
- ```json
627
- {
628
- "mcpServers": {
629
- "AccesibilityHub": {
630
- "command": "npx",
631
- "args": ["-y", "AccesibilityHub"]
632
- }
633
- }
634
- }
635
- ```
636
-
637
- 3. Restart Cursor
638
-
639
- ### Windsurf
640
-
641
- 1. Open the configuration file:
642
- - **macOS**: `~/Library/Application Support/Windsurf/mcp_config.json`
643
- - **Windows**: `%APPDATA%\Windsurf\mcp_config.json`
644
- - **Linux**: `~/.config/Windsurf/mcp_config.json`
645
-
646
- 2. Add the server configuration:
647
-
648
- ```json
649
- {
650
- "mcpServers": {
651
- "AccesibilityHub": {
652
- "command": "npx",
653
- "args": ["-y", "AccesibilityHub"],
654
- "env": {
655
- "LOG_LEVEL": "info"
656
- }
657
- }
658
- }
659
- }
660
- ```
661
-
662
- 3. Restart Windsurf
663
-
664
- ### Claude Code
665
-
666
- 1. Open the configuration file:
667
- - **macOS**: `~/Library/Application Support/Code/User/globalStorage/anthropic.claude-code/settings/cline_mcp_settings.json`
668
- - **Windows**: `%APPDATA%\Code\User\globalStorage\anthropic.claude-code\settings\cline_mcp_settings.json`
669
- - **Linux**: `~/.config/Code/User/globalStorage/anthropic.claude-code/settings/cline_mcp_settings.json`
670
-
671
- 2. Add the server configuration:
672
-
673
- ```json
674
- {
675
- "mcpServers": {
676
- "AccesibilityHub": {
677
- "command": "npx",
678
- "args": ["-y", "AccesibilityHub"],
679
- "env": {
680
- "LOG_LEVEL": "info"
681
- }
682
- }
683
- }
684
- }
685
- ```
686
-
687
- 3. Restart VS Code or reload the window (Cmd/Ctrl + Shift + P → "Developer: Reload Window")
688
-
689
- ## Usage
690
-
691
- Once configured, you can use prompts like:
692
-
693
- - "Analyze the accessibility of https://example.com with axe-core and Pa11y"
694
- - "Check this HTML for accessibility issues: `<img src='photo.jpg'>`"
695
- - "Compare the results of axe-core and Pa11y on my landing page" (uses analyze-mixed)
696
- - "Check the color contrast of my web page" (uses analyze-contrast)
697
- - "Analyze if text colors comply with WCAG AAA" (uses analyze-contrast with wcagLevel: AAA)
698
- - "Analyze contrast using the APCA algorithm" (uses analyze-contrast with contrastAlgorithm: APCA)
699
-
700
- ### Local Development
78
+ ## Documentation
701
79
 
702
- If you're developing or contributing to the project, you can use local paths instead of npx:
703
-
704
- **Claude Desktop / Windsurf / Claude Code**:
705
- ```json
706
- {
707
- "mcpServers": {
708
- "AccesibilityHub": {
709
- "command": "node",
710
- "args": ["<PROJECT_PATH>/dist/server.js"],
711
- "env": {
712
- "LOG_LEVEL": "debug"
713
- }
714
- }
715
- }
716
- }
717
- ```
718
-
719
- **Cursor**:
720
- ```json
721
- {
722
- "mcpServers": {
723
- "AccesibilityHub": {
724
- "command": "node",
725
- "args": ["dist/server.js"],
726
- "cwd": "<PROJECT_PATH>"
727
- }
728
- }
729
- }
730
- ```
731
-
732
- > 💡 **Tip**: Remember to run `pnpm build` each time you make code changes for them to be reflected in the server.
733
-
734
- ## Configuration
735
-
736
- | Variable | Default | Description |
737
- |-------------|---------|----------------------------------|
738
- | `LOG_LEVEL` | `info` | `debug`, `info`, `warn`, `error` |
80
+ | Document | Description |
81
+ |----------|-------------|
82
+ | [Getting Started](docs/getting-started.md) | Installation and MCP client configuration |
83
+ | [Tools Reference](docs/tools/README.md) | Detailed tool documentation |
84
+ | [Prompts Reference](docs/prompts/README.md) | Prompt templates and usage |
85
+ | [Resources Reference](docs/resources/README.md) | Available WCAG and contrast data |
86
+ | [Workflows Guide](docs/guides/workflows.md) | Recommended workflows |
87
+ | [Effective Prompts](docs/guides/effective-prompts.md) | Tips for better accessibility prompts |
88
+ | [Interpreting Results](docs/guides/interpreting-results.md) | How to prioritize and fix issues |
89
+ | [Contributing](CONTRIBUTING.md) | Project structure, development, and contributions |
739
90
 
740
91
  ## Requirements
741
92
 
742
93
  - Node.js ≥ 20
743
- - pnpm
744
94
  - Chrome/Chromium (automatically downloaded by Puppeteer)
745
95
 
746
- ## Main Dependencies
96
+ ## Support Me
97
+
98
+ If this project helps you, consider supporting its development:
99
+
100
+ [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/theraaskin)
101
+ [![Buy Me A Coffee](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://buymeacoffee.com/raskreation)
102
+
103
+ ## License
747
104
 
748
- - `@modelcontextprotocol/sdk` - SDK for MCP servers
749
- - `puppeteer` - Headless browser control
750
- - `@axe-core/puppeteer` - axe-core integration with Puppeteer
751
- - `axe-core` - Accessibility analysis engine
752
- - `pa11y` - Accessibility testing tool
753
- - `colorjs.io` - Color library with WCAG 2.1 and APCA support
754
- - `zod` - Schema validation
755
- - `pino` - Structured logging
105
+ [MIT](LICENSE)