mcp-accessibility-scanner 3.0.1 → 3.2.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 +265 -12
- package/index.d.ts +1 -1
- package/lib/browserContextFactory.js +1161 -94
- package/lib/browserContextFactory.js.map +1 -1
- package/lib/browserServerBackend.js +199 -22
- package/lib/browserServerBackend.js.map +1 -1
- package/lib/browserSessions.js +172 -0
- package/lib/browserSessions.js.map +1 -0
- package/lib/config.js +48 -7
- package/lib/config.js.map +1 -1
- package/lib/context.js +321 -71
- package/lib/context.js.map +1 -1
- package/lib/extension/cdpRelay.js +5 -0
- package/lib/extension/cdpRelay.js.map +1 -1
- package/lib/extension/extensionContextFactory.js +12 -1
- package/lib/extension/extensionContextFactory.js.map +1 -1
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/mcp/http.js +194 -44
- package/lib/mcp/http.js.map +1 -1
- package/lib/mcp/inProcessTransport.js.map +1 -1
- package/lib/mcp/mdb.js +7 -9
- package/lib/mcp/mdb.js.map +1 -1
- package/lib/mcp/proxyBackend.js +76 -18
- package/lib/mcp/proxyBackend.js.map +1 -1
- package/lib/mcp/server.js +70 -41
- package/lib/mcp/server.js.map +1 -1
- package/lib/mcp/sharedClientSlot.js +134 -0
- package/lib/mcp/sharedClientSlot.js.map +1 -0
- package/lib/mcp/tool.js +3 -0
- package/lib/mcp/tool.js.map +1 -1
- package/lib/networkPolicy.js +73 -0
- package/lib/networkPolicy.js.map +1 -0
- package/lib/program.js +91 -12
- package/lib/program.js.map +1 -1
- package/lib/response.js +16 -3
- package/lib/response.js.map +1 -1
- package/lib/sessionLog.js +36 -6
- package/lib/sessionLog.js.map +1 -1
- package/lib/tab.js +149 -18
- package/lib/tab.js.map +1 -1
- package/lib/tools/auditKeyboard.js +204 -4
- package/lib/tools/auditKeyboard.js.map +1 -1
- package/lib/tools/auditScreenReader.js +823 -0
- package/lib/tools/auditScreenReader.js.map +1 -0
- package/lib/tools/auditSite.js +268 -90
- package/lib/tools/auditSite.js.map +1 -1
- package/lib/tools/axe.js +479 -21
- package/lib/tools/axe.js.map +1 -1
- package/lib/tools/dialogs.js +18 -4
- package/lib/tools/dialogs.js.map +1 -1
- package/lib/tools/evaluate.js +34 -5
- package/lib/tools/evaluate.js.map +1 -1
- package/lib/tools/network.js +136 -8
- package/lib/tools/network.js.map +1 -1
- package/lib/tools/pdf.js +5 -2
- package/lib/tools/pdf.js.map +1 -1
- package/lib/tools/scanPageMatrix.js +135 -47
- package/lib/tools/scanPageMatrix.js.map +1 -1
- package/lib/tools/screenshot.js +8 -4
- package/lib/tools/screenshot.js.map +1 -1
- package/lib/tools/session.js +53 -0
- package/lib/tools/session.js.map +1 -0
- package/lib/tools/snapshot.js +266 -8
- package/lib/tools/snapshot.js.map +1 -1
- package/lib/tools/tool.js.map +1 -1
- package/lib/tools/utils.js +62 -6
- package/lib/tools/utils.js.map +1 -1
- package/lib/tools.js +11 -2
- package/lib/tools.js.map +1 -1
- package/lib/utils/dataUrl.js +58 -35
- package/lib/utils/dataUrl.js.map +1 -1
- package/lib/utils/fileUtils.js +35 -0
- package/lib/utils/fileUtils.js.map +1 -1
- package/lib/utils/guid.js +8 -0
- package/lib/utils/guid.js.map +1 -1
- package/lib/utils/jsSource.js +187 -0
- package/lib/utils/jsSource.js.map +1 -0
- package/lib/vscode/browserContextFactory.js +87 -0
- package/lib/vscode/browserContextFactory.js.map +1 -0
- package/lib/vscode/host.js +189 -33
- package/lib/vscode/host.js.map +1 -1
- package/lib/vscode/main.js +3 -35
- package/lib/vscode/main.js.map +1 -1
- package/package.json +13 -9
package/lib/vscode/host.js
CHANGED
|
@@ -16,15 +16,18 @@
|
|
|
16
16
|
import { fileURLToPath } from 'node:url';
|
|
17
17
|
import path from 'node:path';
|
|
18
18
|
import { z } from 'zod';
|
|
19
|
-
import { Client } from '@modelcontextprotocol/
|
|
20
|
-
import {
|
|
21
|
-
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js';
|
|
19
|
+
import { Client } from '@modelcontextprotocol/client';
|
|
20
|
+
import { StdioClientTransport } from '@modelcontextprotocol/client/stdio';
|
|
22
21
|
import * as mcpServer from '../mcp/server.js';
|
|
22
|
+
import { SharedClientSlot } from '../mcp/sharedClientSlot.js';
|
|
23
23
|
import { notifyToolListChanged } from '../mcp/toolListChanged.js';
|
|
24
24
|
import { logUnhandledError } from '../utils/log.js';
|
|
25
25
|
import { packageJSON } from '../utils/package.js';
|
|
26
|
+
import { resolveOutputDir } from '../config.js';
|
|
26
27
|
import { BrowserServerBackend } from '../browserServerBackend.js';
|
|
27
|
-
import {
|
|
28
|
+
import { BrowserSessionRegistry } from '../browserSessions.js';
|
|
29
|
+
import { assertStorageStateDoesNotResetUserProfile, contextFactory } from '../browserContextFactory.js';
|
|
30
|
+
import { vscodeProfileConflictRemedy } from './browserContextFactory.js';
|
|
28
31
|
const contextSwitchOptions = z.object({
|
|
29
32
|
connectionString: z.string().optional().describe('The connection string to use to connect to the browser'),
|
|
30
33
|
lib: z.string().optional().describe('The library to use for the connection'),
|
|
@@ -32,24 +35,50 @@ const contextSwitchOptions = z.object({
|
|
|
32
35
|
export class VSCodeProxyBackend {
|
|
33
36
|
_config;
|
|
34
37
|
_defaultTransportFactory;
|
|
38
|
+
_sharedSlot;
|
|
35
39
|
name = 'Playwright MCP Client Switcher';
|
|
36
40
|
version = packageJSON.version;
|
|
37
41
|
_currentClient;
|
|
42
|
+
// False when _currentClient is adopted from the shared slot: response
|
|
43
|
+
// cleanup (serverClosed) must not tear down the process-scoped client (and
|
|
44
|
+
// the spawned VS Code child behind it) that later requests route through.
|
|
45
|
+
_ownsCurrentClient = true;
|
|
46
|
+
// True while _currentClient is the default provider (an in-process
|
|
47
|
+
// BrowserServerBackend sharing the host's session registry); false while a
|
|
48
|
+
// browser_connect switch routes to a spawned VS Code child. Session traffic
|
|
49
|
+
// must stay at the host either way — see _clientForTool.
|
|
50
|
+
_currentClientIsDefault = false;
|
|
51
|
+
// Lazily connected extra default-provider client that serves session
|
|
52
|
+
// traffic while _currentClient is a switched (non-default) provider.
|
|
53
|
+
// Always owned by this backend and closed in serverClosed.
|
|
54
|
+
_sessionClient;
|
|
38
55
|
_contextSwitchTool;
|
|
39
|
-
_roots = [];
|
|
40
56
|
_clientVersion;
|
|
41
57
|
_backendContext;
|
|
42
|
-
constructor(_config, _defaultTransportFactory) {
|
|
58
|
+
constructor(_config, _defaultTransportFactory, _sharedSlot) {
|
|
43
59
|
this._config = _config;
|
|
44
60
|
this._defaultTransportFactory = _defaultTransportFactory;
|
|
61
|
+
this._sharedSlot = _sharedSlot;
|
|
45
62
|
this._contextSwitchTool = this._defineContextSwitchTool();
|
|
46
63
|
}
|
|
47
|
-
async initialize(context, clientVersion
|
|
64
|
+
async initialize(context, clientVersion) {
|
|
48
65
|
this._backendContext = context;
|
|
49
66
|
this._clientVersion = clientVersion;
|
|
50
|
-
|
|
67
|
+
// A process-scoped browser_connect switch is in effect: adopt it instead
|
|
68
|
+
// of connecting the default provider, so the selection made in an earlier
|
|
69
|
+
// handshake-free request keeps governing this one. The adoption holds a
|
|
70
|
+
// lease on the shared client (released in serverClosed, or earlier when
|
|
71
|
+
// this request switches away), so a concurrent switch cannot close it —
|
|
72
|
+
// and kill the child behind it — under this request's in-flight calls.
|
|
73
|
+
const shared = this._sharedSlot?.acquire();
|
|
74
|
+
if (shared) {
|
|
75
|
+
this._currentClient = shared;
|
|
76
|
+
this._ownsCurrentClient = false;
|
|
77
|
+
this._currentClientIsDefault = false;
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
51
80
|
const transport = await this._defaultTransportFactory();
|
|
52
|
-
await this._setCurrentClient(transport, false);
|
|
81
|
+
await this._setCurrentClient(transport, false, true);
|
|
53
82
|
}
|
|
54
83
|
async listTools() {
|
|
55
84
|
const response = await this._currentClient.listTools();
|
|
@@ -61,36 +90,134 @@ export class VSCodeProxyBackend {
|
|
|
61
90
|
async callTool(name, args, requestContext) {
|
|
62
91
|
if (name === this._contextSwitchTool.name)
|
|
63
92
|
return this._callContextSwitchTool(args, requestContext);
|
|
64
|
-
|
|
93
|
+
const client = await this._clientForTool(name, args);
|
|
94
|
+
return await client.callTool({
|
|
65
95
|
name,
|
|
66
96
|
arguments: args,
|
|
67
97
|
_meta: requestContext?._meta,
|
|
68
98
|
});
|
|
69
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Browser-session handles live at the HOST: they are minted by the host's
|
|
102
|
+
* process-scoped registry against the default provider's factory and stay
|
|
103
|
+
* valid across browser_connect provider switches. The switched VS Code
|
|
104
|
+
* child is a separate server process that builds its own registry (and its
|
|
105
|
+
* factory vetoes sessions anyway), so forwarding handle-routed calls there
|
|
106
|
+
* answered "Unknown browserSessionId" while the session's context stayed
|
|
107
|
+
* alive in the host until its TTL. Session traffic — the session tools and
|
|
108
|
+
* any call carrying a browserSessionId — therefore always resolves against
|
|
109
|
+
* a default-provider client; only session-less traffic follows the switch.
|
|
110
|
+
*/
|
|
111
|
+
async _clientForTool(name, args) {
|
|
112
|
+
const sessionTraffic = name === 'browser_session_open' || name === 'browser_session_close' || typeof args?.browserSessionId === 'string';
|
|
113
|
+
if (!sessionTraffic || this._currentClientIsDefault)
|
|
114
|
+
return this._currentClient;
|
|
115
|
+
if (!this._sessionClient) {
|
|
116
|
+
const creation = (async () => this._connectClient(await this._defaultTransportFactory()))();
|
|
117
|
+
// Memoize success only — identity-guarded like the lazy session log in
|
|
118
|
+
// browserServerBackend.ts, so a transient connect failure is retried
|
|
119
|
+
// instead of replayed for the backend's lifetime.
|
|
120
|
+
creation.catch(() => {
|
|
121
|
+
if (this._sessionClient === creation)
|
|
122
|
+
this._sessionClient = undefined;
|
|
123
|
+
});
|
|
124
|
+
this._sessionClient = creation;
|
|
125
|
+
}
|
|
126
|
+
return await this._sessionClient;
|
|
127
|
+
}
|
|
70
128
|
serverClosed() {
|
|
71
|
-
|
|
129
|
+
if (this._ownsCurrentClient)
|
|
130
|
+
void this._currentClient?.close().catch(logUnhandledError);
|
|
131
|
+
else if (this._currentClient)
|
|
132
|
+
// Adopted from the shared slot: release the lease instead of closing —
|
|
133
|
+
// the slot closes the client once it is retired and fully drained.
|
|
134
|
+
void this._sharedSlot?.release(this._currentClient);
|
|
135
|
+
// The session-routing client is always owned here, never shared: its
|
|
136
|
+
// registry (and every open session) is process-scoped and survives it.
|
|
137
|
+
void this._sessionClient?.then(client => client.close()).catch(logUnhandledError);
|
|
72
138
|
}
|
|
73
139
|
async _callContextSwitchTool(params, _requestContext) {
|
|
74
140
|
if (!params.connectionString || !params.lib) {
|
|
75
|
-
|
|
76
|
-
|
|
141
|
+
if (this._sharedSlot)
|
|
142
|
+
await this._switchSharedClient(undefined);
|
|
143
|
+
else
|
|
144
|
+
await this._setCurrentClient(await this._defaultTransportFactory(), true, true);
|
|
77
145
|
return {
|
|
78
146
|
content: [{ type: 'text', text: '### Result\nSuccessfully disconnected.\n' }],
|
|
79
147
|
};
|
|
80
148
|
}
|
|
81
|
-
|
|
149
|
+
// The child's factory would only surface this on the first browser
|
|
150
|
+
// operation — after the working provider has already been torn down,
|
|
151
|
+
// leaving the session attached to a provider that can never create a
|
|
152
|
+
// context. Validated here instead, so a rejected switch keeps the
|
|
153
|
+
// session on the previous provider.
|
|
154
|
+
try {
|
|
155
|
+
assertStorageStateDoesNotResetUserProfile(this._config, vscodeProfileConflictRemedy);
|
|
156
|
+
}
|
|
157
|
+
catch (error) {
|
|
158
|
+
return {
|
|
159
|
+
content: [{ type: 'text', text: `### Result\n${error instanceof Error ? error.message : String(error)}\n` }],
|
|
160
|
+
isError: true,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
if (this._sharedSlot)
|
|
164
|
+
await this._switchSharedClient(() => this._createSwitchTransport(params.connectionString, params.lib));
|
|
165
|
+
else
|
|
166
|
+
await this._setCurrentClient(await this._createSwitchTransport(params.connectionString, params.lib), true, false);
|
|
167
|
+
return {
|
|
168
|
+
content: [{ type: 'text', text: '### Result\nSuccessfully connected.\n' }],
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
async _createSwitchTransport(connectionString, lib) {
|
|
172
|
+
return new StdioClientTransport({
|
|
82
173
|
command: process.execPath,
|
|
83
174
|
cwd: process.cwd(),
|
|
84
175
|
args: [
|
|
85
176
|
path.join(fileURLToPath(import.meta.url), '..', 'main.js'),
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
177
|
+
// The fallback output dir is memoized on the config OBJECT, and
|
|
178
|
+
// JSON round-tripping into the child mints a new object — without
|
|
179
|
+
// materializing the resolved dir here, the spawned provider would
|
|
180
|
+
// open a second temp root and scatter one run's artifacts across
|
|
181
|
+
// the provider switch.
|
|
182
|
+
JSON.stringify({ ...this._config, outputDir: resolveOutputDir(this._config) }),
|
|
183
|
+
connectionString,
|
|
184
|
+
lib,
|
|
89
185
|
],
|
|
90
|
-
})
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
// Stateless serving: publish the switch through the process-scoped slot so
|
|
189
|
+
// later per-request backends adopt it. The slot closes the previously
|
|
190
|
+
// shared client itself (exactly once, after the swap, once every adopting
|
|
191
|
+
// request has released it — the close terminates that client's spawned
|
|
192
|
+
// child); only a client this request owned — its per-request default — is
|
|
193
|
+
// closed here.
|
|
194
|
+
async _switchSharedClient(createTransport) {
|
|
195
|
+
const previousTools = await this._getExposedTools(this._currentClient).catch(() => undefined);
|
|
196
|
+
const previousOwned = this._ownsCurrentClient ? this._currentClient : undefined;
|
|
197
|
+
const previousShared = this._ownsCurrentClient ? undefined : this._currentClient;
|
|
198
|
+
// The transport is created inside the serialized replace(), so a queued
|
|
199
|
+
// concurrent switch never reuses an already-consumed transport.
|
|
200
|
+
const shared = await this._sharedSlot.replace(createTransport ? async () => this._connectClient(await createTransport()) : undefined);
|
|
201
|
+
if (shared) {
|
|
202
|
+
this._currentClient = shared;
|
|
203
|
+
this._ownsCurrentClient = false;
|
|
204
|
+
this._currentClientIsDefault = false;
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// Back to the default provider, which stateless serving runs
|
|
208
|
+
// per-request: finish this exchange on an owned per-request client.
|
|
209
|
+
this._currentClient = await this._connectClient(await this._defaultTransportFactory());
|
|
210
|
+
this._ownsCurrentClient = true;
|
|
211
|
+
this._currentClientIsDefault = true;
|
|
212
|
+
}
|
|
213
|
+
// This request no longer routes through the shared client it adopted;
|
|
214
|
+
// when it was the retiring client's last adopter, this runs the close
|
|
215
|
+
// the replace deferred. Only on success — a failed replace threw above,
|
|
216
|
+
// and the request keeps using its adopted client.
|
|
217
|
+
if (previousShared)
|
|
218
|
+
await this._sharedSlot.release(previousShared);
|
|
219
|
+
await previousOwned?.close().catch(logUnhandledError);
|
|
220
|
+
await notifyToolListChanged(this._backendContext, previousTools, await this._getExposedTools(this._currentClient));
|
|
94
221
|
}
|
|
95
222
|
_defineContextSwitchTool() {
|
|
96
223
|
return {
|
|
@@ -104,22 +231,23 @@ export class VSCodeProxyBackend {
|
|
|
104
231
|
},
|
|
105
232
|
};
|
|
106
233
|
}
|
|
107
|
-
async _setCurrentClient(transport, notifyOnChange) {
|
|
234
|
+
async _setCurrentClient(transport, notifyOnChange, isDefault = false) {
|
|
108
235
|
const previousTools = notifyOnChange ? await this._getExposedTools(this._currentClient).catch(() => undefined) : undefined;
|
|
109
236
|
await this._currentClient?.close();
|
|
110
237
|
this._currentClient = undefined;
|
|
111
|
-
|
|
112
|
-
client.
|
|
113
|
-
roots: {
|
|
114
|
-
listChanged: true,
|
|
115
|
-
},
|
|
116
|
-
});
|
|
117
|
-
client.setRequestHandler(ListRootsRequestSchema, () => ({ roots: this._roots }));
|
|
118
|
-
client.setRequestHandler(PingRequestSchema, () => ({}));
|
|
119
|
-
await client.connect(transport);
|
|
238
|
+
this._currentClientIsDefault = false;
|
|
239
|
+
const client = await this._connectClient(transport);
|
|
120
240
|
this._currentClient = client;
|
|
241
|
+
this._ownsCurrentClient = true;
|
|
242
|
+
this._currentClientIsDefault = isDefault;
|
|
121
243
|
await notifyToolListChanged(this._backendContext, previousTools, await this._getExposedTools(client));
|
|
122
244
|
}
|
|
245
|
+
async _connectClient(transport) {
|
|
246
|
+
const client = new Client(this._clientVersion);
|
|
247
|
+
client.setRequestHandler('ping', () => ({}));
|
|
248
|
+
await client.connect(transport);
|
|
249
|
+
return client;
|
|
250
|
+
}
|
|
123
251
|
async _getExposedTools(client) {
|
|
124
252
|
if (!client)
|
|
125
253
|
return [];
|
|
@@ -130,12 +258,40 @@ export class VSCodeProxyBackend {
|
|
|
130
258
|
];
|
|
131
259
|
}
|
|
132
260
|
}
|
|
133
|
-
export async function runVSCodeTools(config) {
|
|
261
|
+
export async function runVSCodeTools(config, registerExitCleanup) {
|
|
262
|
+
// Both process-scoped, mirroring the direct factories in program.ts: over
|
|
263
|
+
// stateless HTTP each handshake-free POST builds a fresh proxy whose
|
|
264
|
+
// default transport creates a fresh inner backend, and a browserSessionId
|
|
265
|
+
// minted in one request must resolve in the next instead of being disposed
|
|
266
|
+
// when the response closes. Hoisting the context factory also lets those
|
|
267
|
+
// inner backends share one launched browser instead of one per request.
|
|
268
|
+
const browserContextFactory = contextFactory(config);
|
|
269
|
+
const sessionRegistry = new BrowserSessionRegistry();
|
|
270
|
+
// Process-scoped as well: a browser_connect switch made in one
|
|
271
|
+
// handshake-free POST must keep governing the next one — stored only on
|
|
272
|
+
// the per-request proxy it would be closed with the response and silently
|
|
273
|
+
// revert to the default provider. The slot owns the switched client (and
|
|
274
|
+
// the VS Code child process behind it); per-request backends adopt it
|
|
275
|
+
// without owning it.
|
|
276
|
+
const sharedSlot = new SharedClientSlot();
|
|
277
|
+
// The switched child outlives every response, so process shutdown must
|
|
278
|
+
// close it explicitly instead of relying on stdio teardown alone.
|
|
279
|
+
// dispose(), not replace(undefined): shutdown must close the child even
|
|
280
|
+
// while in-flight requests still hold leases on its client — nothing
|
|
281
|
+
// outlives the process, and waiting for a drain could stall exit forever.
|
|
282
|
+
registerExitCleanup?.(async () => {
|
|
283
|
+
await sharedSlot.dispose();
|
|
284
|
+
});
|
|
285
|
+
// A stateless per-request proxy flags its inner default context ephemeral
|
|
286
|
+
// (disposable profile, see startMCPServer in program.ts); stateful proxies
|
|
287
|
+
// keep the stable profile.
|
|
288
|
+
const createBackend = (ephemeralDefaultContext, slot) => new VSCodeProxyBackend(config, () => mcpServer.wrapInProcess(new BrowserServerBackend(config, browserContextFactory, sessionRegistry, { ephemeralDefaultContext })), slot);
|
|
134
289
|
const serverBackendFactory = {
|
|
135
290
|
name: 'Playwright w/ vscode',
|
|
136
291
|
nameInConfig: 'playwright-vscode',
|
|
137
292
|
version: packageJSON.version,
|
|
138
|
-
create: () =>
|
|
293
|
+
create: () => createBackend(false),
|
|
294
|
+
createStateless: () => createBackend(true, sharedSlot),
|
|
139
295
|
};
|
|
140
296
|
await mcpServer.start(serverBackendFactory, config.server);
|
|
141
297
|
return;
|
package/lib/vscode/host.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/vscode/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"host.js","sourceRoot":"","sources":["../../src/vscode/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE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WAAW,CAAC,OAAO;QAC5B,MAAM,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC;QAClC,eAAe,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,UAAU,CAAC;KACvD,CAAC;IACF,MAAM,SAAS,CAAC,KAAK,CAAC,oBAAoB,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC3D,OAAO;AACT,CAAC"}
|
package/lib/vscode/main.js
CHANGED
|
@@ -13,42 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { StdioServerTransport } from '@modelcontextprotocol/
|
|
16
|
+
import { StdioServerTransport } from '@modelcontextprotocol/server/stdio';
|
|
17
17
|
import * as mcpServer from '../mcp/server.js';
|
|
18
18
|
import { BrowserServerBackend } from '../browserServerBackend.js';
|
|
19
|
-
|
|
20
|
-
_config;
|
|
21
|
-
_playwright;
|
|
22
|
-
_connectionString;
|
|
23
|
-
name = 'vscode';
|
|
24
|
-
description = 'Connect to a browser running in the Playwright VS Code extension';
|
|
25
|
-
constructor(_config, _playwright, _connectionString) {
|
|
26
|
-
this._config = _config;
|
|
27
|
-
this._playwright = _playwright;
|
|
28
|
-
this._connectionString = _connectionString;
|
|
29
|
-
}
|
|
30
|
-
async createContext(clientInfo, abortSignal) {
|
|
31
|
-
let launchOptions = this._config.browser.launchOptions;
|
|
32
|
-
if (this._config.browser.userDataDir) {
|
|
33
|
-
launchOptions = {
|
|
34
|
-
...launchOptions,
|
|
35
|
-
...this._config.browser.contextOptions,
|
|
36
|
-
userDataDir: this._config.browser.userDataDir,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
const connectionString = new URL(this._connectionString);
|
|
40
|
-
connectionString.searchParams.set('launch-options', JSON.stringify(launchOptions));
|
|
41
|
-
const browserType = this._playwright.chromium; // it could also be firefox or webkit, we just need some browser type to call `connect` on
|
|
42
|
-
const browser = await browserType.connect(connectionString.toString());
|
|
43
|
-
const context = browser.contexts()[0] ?? await browser.newContext(this._config.browser.contextOptions);
|
|
44
|
-
return {
|
|
45
|
-
browserContext: context,
|
|
46
|
-
close: async () => {
|
|
47
|
-
await browser.close();
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
}
|
|
19
|
+
import { VSCodeBrowserContextFactory } from './browserContextFactory.js';
|
|
52
20
|
async function main(config, connectionString, lib) {
|
|
53
21
|
const playwright = await import(lib).then(mod => mod.default ?? mod);
|
|
54
22
|
const factory = new VSCodeBrowserContextFactory(config, playwright, connectionString);
|
|
@@ -57,7 +25,7 @@ async function main(config, connectionString, lib) {
|
|
|
57
25
|
nameInConfig: 'playwright-vscode',
|
|
58
26
|
create: () => new BrowserServerBackend(config, factory),
|
|
59
27
|
version: 'unused'
|
|
60
|
-
}, new StdioServerTransport(),
|
|
28
|
+
}, new StdioServerTransport(), false);
|
|
61
29
|
}
|
|
62
30
|
await main(JSON.parse(process.argv[2]), process.argv[3], process.argv[4]);
|
|
63
31
|
//# sourceMappingURL=main.js.map
|
package/lib/vscode/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/vscode/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/vscode/main.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAGzE,KAAK,UAAU,IAAI,CAAC,MAAkB,EAAE,gBAAwB,EAAE,GAAW;IAC3E,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,CAAC,CAAC;IACrE,MAAM,OAAO,GAAG,IAAI,2BAA2B,CAAC,MAAM,EAAE,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACtF,MAAM,SAAS,CAAC,OAAO,CACnB;QACE,IAAI,EAAE,gBAAgB;QACtB,YAAY,EAAE,mBAAmB;QACjC,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,oBAAoB,CAAC,MAAM,EAAE,OAAO,CAAC;QACvD,OAAO,EAAE,QAAQ;KAClB,EACD,IAAI,oBAAoB,EAAE,EAC1B,KAAK,CACR,CAAC;AACJ,CAAC;AAED,MAAM,IAAI,CACN,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAC3B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-accessibility-scanner",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.2.0",
|
|
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",
|
|
@@ -37,22 +37,26 @@
|
|
|
37
37
|
"test:docker": "bash ./tests/docker-smoke.sh",
|
|
38
38
|
"test:mcp": "node .claude/run-mcp-direct-harness.mjs",
|
|
39
39
|
"test:mcp:install": "node .claude/run-mcp-direct-harness.mjs --include-install",
|
|
40
|
+
"bench": "node bench/mcp-bench.mjs",
|
|
41
|
+
"bench:compare": "node bench/mcp-bench.mjs --compare",
|
|
40
42
|
"test:watch": "vitest",
|
|
41
43
|
"test:ui": "vitest --ui",
|
|
42
44
|
"test:coverage": "vitest run --coverage"
|
|
43
45
|
},
|
|
44
46
|
"dependencies": {
|
|
45
|
-
"@axe-core/playwright": "^4.12.1",
|
|
46
47
|
"@cfworker/json-schema": "^4.1.1",
|
|
47
|
-
"@modelcontextprotocol/
|
|
48
|
+
"@modelcontextprotocol/client": "^2.0.0",
|
|
49
|
+
"@modelcontextprotocol/node": "^2.0.0",
|
|
50
|
+
"@modelcontextprotocol/server": "^2.0.0",
|
|
51
|
+
"axe-core": "4.12.1",
|
|
48
52
|
"commander": "^15.0.0",
|
|
49
53
|
"debug": "^4.4.3",
|
|
50
54
|
"dotenv": "^17.4.2",
|
|
51
55
|
"mime": "^4.1.0",
|
|
52
|
-
"playwright": "1.
|
|
53
|
-
"playwright-core": "1.
|
|
54
|
-
"re2": "^1.
|
|
55
|
-
"ws": "^8.21.
|
|
56
|
+
"playwright": "1.62.1",
|
|
57
|
+
"playwright-core": "1.62.1",
|
|
58
|
+
"re2": "^1.26.1",
|
|
59
|
+
"ws": "^8.21.3",
|
|
56
60
|
"zod": "^4.4.3"
|
|
57
61
|
},
|
|
58
62
|
"devDependencies": {
|
|
@@ -88,7 +92,7 @@
|
|
|
88
92
|
"url": "git+https://github.com/JustasMonkev/mcp-accessibility-scanner.git"
|
|
89
93
|
},
|
|
90
94
|
"engines": {
|
|
91
|
-
"node": "
|
|
95
|
+
"node": "^24.15.0 || >=26.0.0"
|
|
92
96
|
},
|
|
93
97
|
"publishConfig": {
|
|
94
98
|
"access": "public"
|
|
@@ -102,6 +106,6 @@
|
|
|
102
106
|
"allowScripts": {
|
|
103
107
|
"fsevents@2.3.2": true,
|
|
104
108
|
"fsevents@2.3.3": true,
|
|
105
|
-
"re2@1.
|
|
109
|
+
"re2@1.26.1": true
|
|
106
110
|
}
|
|
107
111
|
}
|