chrome-devtools-mcp 0.25.0 → 0.26.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 +1 -1
- package/build/src/ToolHandler.js +188 -0
- package/build/src/bin/chrome-devtools-cli-options.js +1 -1
- package/build/src/bin/chrome-devtools-mcp-main.js +4 -3
- package/build/src/bin/chrome-devtools.js +0 -2
- package/build/src/index.js +9 -164
- package/build/src/telemetry/ClearcutLogger.js +27 -0
- package/build/src/telemetry/errors.js +14 -0
- package/build/src/telemetry/types.js +0 -8
- package/build/src/third_party/THIRD_PARTY_NOTICES +9 -11
- package/build/src/third_party/bundled-packages.json +2 -2
- package/build/src/third_party/devtools-formatter-worker.js +31 -33
- package/build/src/third_party/devtools-heap-snapshot-worker.js +42 -44
- package/build/src/third_party/index.js +1560 -1074
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +4236 -4219
- package/build/src/tools/input.js +28 -7
- package/build/src/tools/lighthouse.js +7 -7
- package/build/src/version.js +1 -1
- package/package.json +6 -6
package/build/src/tools/input.js
CHANGED
|
@@ -220,10 +220,27 @@ async function fillFormElement(uid, value, context, page) {
|
|
|
220
220
|
await selectOption(handle, aXNode, value);
|
|
221
221
|
}
|
|
222
222
|
else {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
const isToggle = await handle.evaluate(el => {
|
|
224
|
+
if (el instanceof HTMLInputElement) {
|
|
225
|
+
return el.type === 'checkbox' || el.type === 'radio';
|
|
226
|
+
}
|
|
227
|
+
const role = el.getAttribute('role');
|
|
228
|
+
return role === 'checkbox' || role === 'radio' || role === 'switch';
|
|
229
|
+
});
|
|
230
|
+
if (isToggle) {
|
|
231
|
+
if (['true', 'false'].includes(value)) {
|
|
232
|
+
await handle.asLocator().fill(value === 'true');
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
throw new Error(`Checkboxes, radio boxes and toggles require "true" or "false" value, but ${value} was used`);
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
// Increase timeout for longer input values.
|
|
240
|
+
const timeoutPerChar = 10; // ms
|
|
241
|
+
const fillTimeout = page.pptrPage.getDefaultTimeout() + value.length * timeoutPerChar;
|
|
242
|
+
await handle.asLocator().setTimeout(fillTimeout).fill(value);
|
|
243
|
+
}
|
|
227
244
|
}
|
|
228
245
|
}
|
|
229
246
|
catch (error) {
|
|
@@ -244,7 +261,9 @@ export const fill = definePageTool({
|
|
|
244
261
|
uid: zod
|
|
245
262
|
.string()
|
|
246
263
|
.describe('The uid of an element on the page from the page content snapshot'),
|
|
247
|
-
value: zod
|
|
264
|
+
value: zod
|
|
265
|
+
.string()
|
|
266
|
+
.describe('The value to fill in. "true" or "false" for checkboxes and toggles, "true" for radio buttons.'),
|
|
248
267
|
includeSnapshot: includeSnapshotSchema,
|
|
249
268
|
},
|
|
250
269
|
blockedByDialog: true,
|
|
@@ -317,7 +336,7 @@ export const drag = definePageTool({
|
|
|
317
336
|
});
|
|
318
337
|
export const fillForm = definePageTool({
|
|
319
338
|
name: 'fill_form',
|
|
320
|
-
description: `Fill out multiple form elements at once
|
|
339
|
+
description: `Fill out multiple form elements (inputs, selects, checkboxes, radios) at once. ALWAYS prefer this tool over multiple individual 'fill' or 'click' calls when interacting with forms. It is significantly faster, more reliable, and reduces turn count. Example: Fill username, password, and check "Remember Me" in one call.`,
|
|
321
340
|
annotations: {
|
|
322
341
|
category: ToolCategory.INPUT,
|
|
323
342
|
readOnlyHint: false,
|
|
@@ -328,7 +347,9 @@ export const fillForm = definePageTool({
|
|
|
328
347
|
// eslint-disable-next-line @local/enforce-zod-schema
|
|
329
348
|
zod.object({
|
|
330
349
|
uid: zod.string().describe('The uid of the element to fill out'),
|
|
331
|
-
value: zod
|
|
350
|
+
value: zod
|
|
351
|
+
.string()
|
|
352
|
+
.describe('Value for the element. "true" or "false" for checkboxes and toggles, "true" for radio buttons.'),
|
|
332
353
|
}))
|
|
333
354
|
.describe('Elements from snapshot to fill out.'),
|
|
334
355
|
includeSnapshot: includeSnapshotSchema,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import path from 'node:path';
|
|
7
|
-
import { snapshot, navigation, generateReport, zod,
|
|
7
|
+
import { snapshot, navigation, generateReport, zod, } from '../third_party/index.js';
|
|
8
8
|
import { ToolCategory } from './categories.js';
|
|
9
9
|
import { startTrace } from './performance.js';
|
|
10
10
|
import { definePageTool } from './ToolDefinition.js';
|
|
@@ -67,17 +67,17 @@ export const lighthouseAudit = definePageTool({
|
|
|
67
67
|
disabled: false,
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
|
-
const options = {
|
|
71
|
-
flags,
|
|
72
|
-
config: agenticBrowsingConfig,
|
|
73
|
-
};
|
|
74
70
|
let result;
|
|
75
71
|
try {
|
|
76
72
|
if (mode === 'navigation') {
|
|
77
|
-
result = await navigation(page.pptrPage, page.pptrPage.url(),
|
|
73
|
+
result = await navigation(page.pptrPage, page.pptrPage.url(), {
|
|
74
|
+
flags,
|
|
75
|
+
});
|
|
78
76
|
}
|
|
79
77
|
else {
|
|
80
|
-
result = await snapshot(page.pptrPage,
|
|
78
|
+
result = await snapshot(page.pptrPage, {
|
|
79
|
+
flags,
|
|
80
|
+
});
|
|
81
81
|
}
|
|
82
82
|
if (!result) {
|
|
83
83
|
throw new Error('Lighthouse audit failed.');
|
package/build/src/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chrome-devtools-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "MCP server for Chrome DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"mcpName": "io.github.ChromeDevTools/chrome-devtools-mcp",
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@eslint/js": "^9.35.0",
|
|
51
|
-
"@google/genai": "^
|
|
51
|
+
"@google/genai": "^2.0.1",
|
|
52
52
|
"@modelcontextprotocol/sdk": "1.29.0",
|
|
53
53
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
54
54
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -62,21 +62,21 @@
|
|
|
62
62
|
"@types/yargs": "^17.0.33",
|
|
63
63
|
"@typescript-eslint/eslint-plugin": "^8.43.0",
|
|
64
64
|
"@typescript-eslint/parser": "^8.43.0",
|
|
65
|
-
"chrome-devtools-frontend": "1.0.
|
|
65
|
+
"chrome-devtools-frontend": "1.0.1626840",
|
|
66
66
|
"core-js": "3.49.0",
|
|
67
67
|
"debug": "4.4.3",
|
|
68
68
|
"eslint": "^9.35.0",
|
|
69
69
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
70
70
|
"eslint-plugin-import": "^2.32.0",
|
|
71
71
|
"globals": "^17.0.0",
|
|
72
|
-
"lighthouse": "13.
|
|
72
|
+
"lighthouse": "13.3.0",
|
|
73
73
|
"prettier": "^3.6.2",
|
|
74
74
|
"puppeteer": "24.43.0",
|
|
75
|
-
"rollup": "4.60.
|
|
75
|
+
"rollup": "4.60.3",
|
|
76
76
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
77
77
|
"rollup-plugin-license": "^3.6.0",
|
|
78
78
|
"semver": "^7.7.4",
|
|
79
|
-
"sinon": "^
|
|
79
|
+
"sinon": "^22.0.0",
|
|
80
80
|
"typescript": "^6.0.2",
|
|
81
81
|
"typescript-eslint": "^8.43.0",
|
|
82
82
|
"urlpattern-polyfill": "^10.1.0",
|