mcp-accessibility-scanner 1.0.10 → 1.0.11
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 +111 -15
- package/package.json +1 -1
package/Readme.md
CHANGED
|
@@ -2,13 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
# MCP Accessibility Scanner 🔍
|
|
4
4
|
|
|
5
|
-
A Model Context Protocol (MCP) server that provides automated web accessibility scanning using Playwright and Axe-core. This server enables LLMs to perform WCAG compliance checks,
|
|
5
|
+
A powerful Model Context Protocol (MCP) server that provides automated web accessibility scanning and browser automation using Playwright and Axe-core. This server enables LLMs to perform WCAG compliance checks, interact with web pages, manage persistent browser sessions, and generate detailed accessibility reports with visual annotations.
|
|
6
6
|
|
|
7
7
|
## Features
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Accessibility Scanning
|
|
10
|
+
✅ Full WCAG 2.0/2.1/2.2 compliance checking (A, AA, AAA levels)
|
|
10
11
|
🖼️ Automatic screenshot capture with violation highlighting
|
|
11
|
-
📄 Detailed JSON reports with remediation guidance
|
|
12
|
+
📄 Detailed JSON reports with remediation guidance
|
|
13
|
+
🎯 Support for specific violation categories (color contrast, ARIA, forms, keyboard navigation, etc.)
|
|
14
|
+
|
|
15
|
+
### Browser Automation
|
|
16
|
+
🖱️ Click elements by CSS selector or visible text
|
|
17
|
+
⌨️ Type text into inputs by selector or label
|
|
18
|
+
🔍 Analyze pages to discover all interactive elements
|
|
19
|
+
📸 Capture screenshots after each interaction
|
|
20
|
+
|
|
21
|
+
### Session Management
|
|
22
|
+
🔄 Create persistent browser sessions for multi-step workflows
|
|
23
|
+
⏱️ Automatic session cleanup after 3 minutes of inactivity
|
|
24
|
+
🌐 Navigate between pages while maintaining session state
|
|
25
|
+
📊 Run accessibility scans within active sessions
|
|
12
26
|
|
|
13
27
|
## Installation
|
|
14
28
|
|
|
@@ -67,29 +81,111 @@ Here's the Claude Desktop configuration:
|
|
|
67
81
|
}
|
|
68
82
|
```
|
|
69
83
|
|
|
70
|
-
##
|
|
84
|
+
## Available Tools
|
|
85
|
+
|
|
86
|
+
The MCP server exposes 18 tools for accessibility scanning and browser automation:
|
|
87
|
+
|
|
88
|
+
### Accessibility Scanning
|
|
71
89
|
|
|
72
|
-
|
|
90
|
+
#### `accessibility-scan`
|
|
91
|
+
Performs a comprehensive accessibility scan on a webpage.
|
|
73
92
|
|
|
93
|
+
**Parameters:**
|
|
74
94
|
- `url`: The webpage URL to scan (required)
|
|
75
|
-
- `violationsTag`: Array of
|
|
76
|
-
- `viewport`: Optional
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
95
|
+
- `violationsTag`: Array of WCAG/violation tags to check (required)
|
|
96
|
+
- `viewport`: Optional viewport size (default: 1920x1080)
|
|
97
|
+
- `shouldRunInHeadless`: Optional headless mode control (default: true)
|
|
98
|
+
|
|
99
|
+
**Supported Violation Tags:**
|
|
100
|
+
- WCAG levels: `wcag2a`, `wcag2aa`, `wcag2aaa`, `wcag21a`, `wcag21aa`, `wcag21aaa`, `wcag22a`, `wcag22aa`, `wcag22aaa`
|
|
101
|
+
- Section 508: `section508`
|
|
102
|
+
- Categories: `cat.color` (contrast), `cat.aria`, `cat.forms`, `cat.keyboard`, `cat.language`, `cat.structure`, etc.
|
|
103
|
+
|
|
104
|
+
### Browser Automation
|
|
105
|
+
|
|
106
|
+
#### `click-element`
|
|
107
|
+
Clicks an element by CSS selector.
|
|
108
|
+
- Parameters: `url`, `selector`, `viewport`, `shouldRunInHeadless`
|
|
109
|
+
|
|
110
|
+
#### `click-element-by-text`
|
|
111
|
+
Clicks elements by their visible text content.
|
|
112
|
+
- Parameters: `url`, `text`, `elementType` (optional), `viewport`, `shouldRunInHeadless`
|
|
113
|
+
|
|
114
|
+
#### `type-text`
|
|
115
|
+
Types text into an input field by CSS selector.
|
|
116
|
+
- Parameters: `url`, `selector`, `text`, `viewport`, `shouldRunInHeadless`
|
|
117
|
+
|
|
118
|
+
#### `type-text-by-label`
|
|
119
|
+
Types text into input fields by their label text.
|
|
120
|
+
- Parameters: `url`, `labelText`, `text`, `viewport`, `shouldRunInHeadless`
|
|
121
|
+
|
|
122
|
+
#### `analyze-page`
|
|
123
|
+
Analyzes page to identify all interactive elements.
|
|
124
|
+
- Parameters: `url`, `viewport`, `shouldRunInHeadless`
|
|
125
|
+
- Returns: Lists of all buttons, links, and inputs on the page
|
|
126
|
+
|
|
127
|
+
### Session Management
|
|
128
|
+
|
|
129
|
+
#### `create-session`
|
|
130
|
+
Creates a persistent browser session for multiple operations.
|
|
131
|
+
- Parameters: `sessionId`, `viewport`, `shouldRunInHeadless`
|
|
132
|
+
- Sessions auto-expire after 3 minutes of inactivity
|
|
133
|
+
|
|
134
|
+
#### `navigate-session`
|
|
135
|
+
Navigates to a URL in an existing session.
|
|
136
|
+
- Parameters: `sessionId`, `url`
|
|
137
|
+
|
|
138
|
+
#### `click-session` / `click-session-by-text`
|
|
139
|
+
Click elements within a session.
|
|
80
140
|
|
|
81
|
-
|
|
141
|
+
#### `type-session` / `type-session-by-label`
|
|
142
|
+
Type text within a session.
|
|
82
143
|
|
|
83
|
-
|
|
144
|
+
#### `scan-session`
|
|
145
|
+
Run accessibility scan on current page in session.
|
|
146
|
+
|
|
147
|
+
#### `analyze-session`
|
|
148
|
+
Analyze current page in session.
|
|
149
|
+
|
|
150
|
+
#### `close-session`
|
|
151
|
+
Close a browser session.
|
|
152
|
+
|
|
153
|
+
#### `list-sessions`
|
|
154
|
+
List all active browser sessions.
|
|
155
|
+
|
|
156
|
+
## Usage Examples
|
|
157
|
+
|
|
158
|
+
### Basic Accessibility Scan
|
|
159
|
+
```
|
|
160
|
+
Could you scan example.com for WCAG 2.1 AA compliance issues?
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Color Contrast Check
|
|
84
164
|
```
|
|
85
|
-
|
|
165
|
+
Please check example.com for color contrast accessibility issues (cat.color).
|
|
86
166
|
```
|
|
87
167
|
|
|
88
|
-
|
|
168
|
+
### Multi-step Workflow with Sessions
|
|
89
169
|
```
|
|
90
|
-
|
|
170
|
+
1. Create a session and navigate to example.com
|
|
171
|
+
2. Click the "Sign In" button
|
|
172
|
+
3. Type "user@example.com" into the email field
|
|
173
|
+
4. Run an accessibility scan on the login page
|
|
174
|
+
5. Close the session
|
|
91
175
|
```
|
|
92
176
|
|
|
177
|
+
### Page Analysis
|
|
178
|
+
```
|
|
179
|
+
Can you analyze example.com and tell me what interactive elements are available?
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Smart Element Interaction
|
|
183
|
+
```
|
|
184
|
+
Navigate to example.com and click the button that says "Get Started"
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
**Note:** All tools automatically save annotated screenshots to your downloads folder, with accessibility violations highlighted in red and numbered badges.
|
|
188
|
+
|
|
93
189
|
## Development
|
|
94
190
|
|
|
95
191
|
Clone and set up the project:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-accessibility-scanner",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.11",
|
|
4
4
|
"description": "A Model Context Protocol (MCP) server for performing automated accessibility scans of web pages using Playwright and Axe-core",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|