mcp-accessibility-scanner 2.0.11 → 2.0.12
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/config.d.ts +172 -0
- package/index.d.ts +28 -0
- package/index.js +19 -0
- package/package.json +4 -1
package/config.d.ts
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Microsoft Corporation.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import type * as playwright from 'playwright';
|
|
18
|
+
|
|
19
|
+
export type ToolCapability =
|
|
20
|
+
| 'core'
|
|
21
|
+
| 'tabs'
|
|
22
|
+
| 'pdf'
|
|
23
|
+
| 'history'
|
|
24
|
+
| 'wait'
|
|
25
|
+
| 'files'
|
|
26
|
+
| 'install'
|
|
27
|
+
| 'testing'
|
|
28
|
+
| 'core-install'
|
|
29
|
+
| 'core-tabs'
|
|
30
|
+
| 'vision'
|
|
31
|
+
| 'verify';
|
|
32
|
+
|
|
33
|
+
export type Config = {
|
|
34
|
+
/**
|
|
35
|
+
* The browser to use.
|
|
36
|
+
*/
|
|
37
|
+
browser?: {
|
|
38
|
+
/**
|
|
39
|
+
* Use browser agent (experimental).
|
|
40
|
+
*/
|
|
41
|
+
browserAgent?: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The type of browser to use.
|
|
45
|
+
*/
|
|
46
|
+
browserName?: 'chromium' | 'firefox' | 'webkit';
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Keep the browser profile in memory, do not save it to disk.
|
|
50
|
+
*/
|
|
51
|
+
isolated?: boolean;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Path to a user data directory for browser profile persistence.
|
|
55
|
+
* Temporary directory is created by default.
|
|
56
|
+
*/
|
|
57
|
+
userDataDir?: string;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Launch options passed to
|
|
61
|
+
* @see https://playwright.dev/docs/api/class-browsertype#browser-type-launch-persistent-context
|
|
62
|
+
*
|
|
63
|
+
* This is useful for settings options like `channel`, `headless`, `executablePath`, etc.
|
|
64
|
+
*/
|
|
65
|
+
launchOptions?: playwright.LaunchOptions;
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Context options for the browser context.
|
|
69
|
+
*
|
|
70
|
+
* This is useful for settings options like `viewport`.
|
|
71
|
+
*/
|
|
72
|
+
contextOptions?: playwright.BrowserContextOptions;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Chrome DevTools Protocol endpoint to connect to an existing browser instance in case of Chromium family browsers.
|
|
76
|
+
*/
|
|
77
|
+
cdpEndpoint?: string;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Launch a Chromium-based desktop app with CDP enabled and attach to it.
|
|
81
|
+
*/
|
|
82
|
+
cdpLaunch?: {
|
|
83
|
+
command: string;
|
|
84
|
+
args?: string[];
|
|
85
|
+
cwd?: string;
|
|
86
|
+
env?: Record<string, string>;
|
|
87
|
+
port?: number;
|
|
88
|
+
startupTimeoutMs?: number;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Remote endpoint to connect to an existing Playwright server.
|
|
93
|
+
*/
|
|
94
|
+
remoteEndpoint?: string;
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
server?: {
|
|
98
|
+
/**
|
|
99
|
+
* The port to listen on for SSE or MCP transport.
|
|
100
|
+
*/
|
|
101
|
+
port?: number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* The host to bind the server to. Default is localhost. Use 0.0.0.0 to bind to all interfaces.
|
|
105
|
+
*/
|
|
106
|
+
host?: string;
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* List of enabled tool capabilities. Possible values:
|
|
111
|
+
* - 'core': Core browser automation features.
|
|
112
|
+
* - 'tabs': Tab management features.
|
|
113
|
+
* - 'pdf': PDF generation and manipulation.
|
|
114
|
+
* - 'history': Browser history access.
|
|
115
|
+
* - 'wait': Wait and timing utilities.
|
|
116
|
+
* - 'files': File upload/download support.
|
|
117
|
+
* - 'install': Browser installation utilities.
|
|
118
|
+
*/
|
|
119
|
+
capabilities?: ToolCapability[];
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Run server that uses screenshots (Aria snapshots are used by default).
|
|
123
|
+
*/
|
|
124
|
+
vision?: boolean;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Whether to save the Playwright trace of the session into the output directory.
|
|
128
|
+
*/
|
|
129
|
+
saveTrace?: boolean;
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Whether to persist session logs for the current run.
|
|
133
|
+
*/
|
|
134
|
+
saveSession?: boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The directory to save output files.
|
|
138
|
+
*/
|
|
139
|
+
outputDir?: string;
|
|
140
|
+
|
|
141
|
+
network?: {
|
|
142
|
+
/**
|
|
143
|
+
* List of origins to allow the browser to request. Default is to allow all. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
|
|
144
|
+
*/
|
|
145
|
+
allowedOrigins?: string[];
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* List of origins to block the browser to request. Origins matching both `allowedOrigins` and `blockedOrigins` will be blocked.
|
|
149
|
+
*/
|
|
150
|
+
blockedOrigins?: string[];
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Whether to send image responses to the client. Can be "allow", "omit", or "auto". Defaults to "auto", which sends images if the client can display them.
|
|
155
|
+
*/
|
|
156
|
+
imageResponses?: 'allow' | 'omit' | 'auto';
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Timeout settings for Playwright operations.
|
|
160
|
+
*/
|
|
161
|
+
timeouts?: {
|
|
162
|
+
/**
|
|
163
|
+
* Maximum time in milliseconds for page navigation. Defaults to 60000ms (60 seconds).
|
|
164
|
+
*/
|
|
165
|
+
navigationTimeout?: number;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Default timeout for all Playwright operations (clicks, fills, etc). Defaults to 5000ms (5 seconds).
|
|
169
|
+
*/
|
|
170
|
+
defaultTimeout?: number;
|
|
171
|
+
};
|
|
172
|
+
};
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import type { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
19
|
+
import type { Config } from './config.js';
|
|
20
|
+
import type { BrowserContext } from 'playwright';
|
|
21
|
+
|
|
22
|
+
export type Connection = {
|
|
23
|
+
server: Server;
|
|
24
|
+
close(): Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export declare function createConnection(config?: Config, contextGetter?: () => Promise<BrowserContext>): Promise<Connection>;
|
|
28
|
+
export {};
|
package/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Copyright (c) Microsoft Corporation.
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
14
|
+
* See the License for the specific language governing permissions and
|
|
15
|
+
* limitations under the License.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
import { createConnection } from './lib/index.js';
|
|
19
|
+
export { createConnection };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-accessibility-scanner",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.12",
|
|
4
4
|
"mcpName": "io.github.JustasMonkev/mcp-accessibility-scanner",
|
|
5
5
|
"description": "A Model Context Protocol (MCP) server for performing automated accessibility scans of web pages using Playwright and Axe-core",
|
|
6
6
|
"type": "module",
|
|
@@ -16,6 +16,9 @@
|
|
|
16
16
|
"mcp-server-playwright": "cli.js"
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
|
+
"index.js",
|
|
20
|
+
"index.d.ts",
|
|
21
|
+
"config.d.ts",
|
|
19
22
|
"lib/**/*",
|
|
20
23
|
"README.md",
|
|
21
24
|
"LICENSE",
|