mcp-accessibility-scanner 1.0.5 → 1.0.7

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
@@ -17,6 +17,25 @@ Using npm:
17
17
  npm install -g mcp-accessibility-scanner
18
18
  ```
19
19
 
20
+ ### Docker Installation
21
+
22
+ The project includes a Dockerfile that sets up all necessary dependencies including Node.js v22 and Python 3.13.
23
+
24
+ 1. Build the Docker image:
25
+ ```bash
26
+ docker build -t mcp-server .
27
+ ```
28
+
29
+ 2. Run the container:
30
+ ```bash
31
+ docker run -it -e MCP_PROXY_DEBUG=true mcp-server
32
+ ```
33
+
34
+ You can also run it in the background:
35
+ ```bash
36
+ docker run -d -p 3000:3000 mcp-server
37
+ ```
38
+
20
39
  ### Installation in VS Code
21
40
 
22
41
  Install the Accessibility Scanner in VS Code using the VS Code CLI:
@@ -86,6 +105,20 @@ Test the MCP server locally:
86
105
  npm run inspector
87
106
  ```
88
107
 
108
+ ### Docker Development
109
+
110
+ For development using Docker:
111
+
112
+ 1. Build the development image:
113
+ ```bash
114
+ docker build -t mcp-server-dev .
115
+ ```
116
+
117
+ 2. Run with volume mounting for live code changes:
118
+ ```bash
119
+ docker run -it -v $(pwd):/app -p 3000:3000 -e MCP_PROXY_DEBUG=true mcp-server-dev
120
+ ```
121
+
89
122
  ## Project Structure
90
123
 
91
124
  ```
@@ -93,6 +126,7 @@ npm run inspector
93
126
  │ ├── index.ts # MCP server setup and tool definitions
94
127
  │ └── scanner.ts # Core scanning functionality
95
128
  ├── build/ # Compiled JavaScript output
129
+ ├── Dockerfile # Docker configuration for containerized setup
96
130
  ├── package.json # Project configuration and dependencies
97
131
  └── tsconfig.json # TypeScript configuration
98
132
  ```
@@ -1,37 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -49,9 +16,9 @@ exports.scanViolations = scanViolations;
49
16
  const playwright_1 = require("playwright");
50
17
  const playwright_2 = require("@axe-core/playwright");
51
18
  const node_path_1 = __importDefault(require("node:path"));
52
- const os = __importStar(require("node:os"));
19
+ const node_os_1 = __importDefault(require("node:os"));
53
20
  function scanViolations(url_1, violationsTag_1) {
54
- return __awaiter(this, arguments, void 0, function* (url, violationsTag, viewport = { width: 1920, height: 1080 }, shouldRunInHeadless = true, downloadsDir = node_path_1.default.join(os.homedir(), 'Downloads')) {
21
+ return __awaiter(this, arguments, void 0, function* (url, violationsTag, viewport = { width: 1920, height: 1080 }, shouldRunInHeadless = true) {
55
22
  var _a;
56
23
  const browser = yield playwright_1.chromium.launch({
57
24
  headless: shouldRunInHeadless,
@@ -170,7 +137,7 @@ function scanViolations(url_1, violationsTag_1) {
170
137
  });
171
138
  }
172
139
  }
173
- const filePath = node_path_1.default.join(downloadsDir, `a11y-report-${Date.now()}.png`);
140
+ const filePath = node_path_1.default.join(node_path_1.default.join(node_os_1.default.homedir(), 'Downloads'), `a11y-report-${Date.now()}.png`);
174
141
  const screenshot = yield page.screenshot({
175
142
  path: filePath,
176
143
  fullPage: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-accessibility-scanner",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
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",