chrome-devtools-mcp 0.23.0 → 0.25.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 +22 -5
- package/build/src/DevToolsConnectionAdapter.js +1 -0
- package/build/src/DevtoolsUtils.js +1 -0
- package/build/src/HeapSnapshotManager.js +16 -0
- package/build/src/McpContext.js +57 -4
- package/build/src/McpPage.js +10 -4
- package/build/src/McpResponse.js +55 -19
- package/build/src/Mutex.js +1 -0
- package/build/src/PageCollector.js +1 -0
- package/build/src/SlimMcpResponse.js +1 -0
- package/build/src/TextSnapshot.js +13 -7
- package/build/src/WaitForHelper.js +6 -0
- package/build/src/bin/check-latest-version.js +1 -0
- package/build/src/bin/chrome-devtools-cli-options.js +229 -46
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +10 -5
- package/build/src/bin/chrome-devtools-mcp-main.js +1 -5
- package/build/src/bin/chrome-devtools-mcp.js +1 -0
- package/build/src/bin/chrome-devtools.js +5 -13
- package/build/src/browser.js +1 -0
- package/build/src/daemon/client.js +4 -2
- package/build/src/daemon/daemon.js +1 -0
- package/build/src/daemon/types.js +1 -0
- package/build/src/daemon/utils.js +1 -0
- package/build/src/formatters/ConsoleFormatter.js +48 -1
- package/build/src/formatters/HeapSnapshotFormatter.js +18 -2
- package/build/src/formatters/IssueFormatter.js +1 -0
- package/build/src/formatters/NetworkFormatter.js +1 -0
- package/build/src/formatters/SnapshotFormatter.js +2 -1
- package/build/src/index.js +114 -51
- package/build/src/issue-descriptions.js +1 -0
- package/build/src/logger.js +1 -0
- package/build/src/polyfill.js +1 -0
- package/build/src/telemetry/ClearcutLogger.js +13 -1
- package/build/src/telemetry/WatchdogClient.js +1 -0
- package/build/src/telemetry/flagUtils.js +1 -0
- package/build/src/telemetry/metricUtils.js +1 -0
- package/build/src/telemetry/persistence.js +1 -0
- package/build/src/telemetry/toolMetricsUtils.js +2 -1
- package/build/src/telemetry/types.js +1 -0
- package/build/src/telemetry/watchdog/ClearcutSender.js +1 -0
- package/build/src/telemetry/watchdog/main.js +1 -0
- package/build/src/third_party/THIRD_PARTY_NOTICES +8 -8
- package/build/src/third_party/bundled-packages.json +3 -3
- package/build/src/third_party/devtools-formatter-worker.js +2469 -2933
- package/build/src/third_party/devtools-heap-snapshot-worker.js +50 -26
- package/build/src/third_party/index.js +1107 -407
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +21717 -20261
- package/build/src/tools/ToolDefinition.js +1 -0
- package/build/src/tools/categories.js +10 -3
- package/build/src/tools/console.js +3 -0
- package/build/src/tools/emulation.js +2 -0
- package/build/src/tools/extensions.js +6 -0
- package/build/src/tools/input.js +57 -2
- package/build/src/tools/lighthouse.js +17 -9
- package/build/src/tools/memory.js +34 -1
- package/build/src/tools/network.js +5 -0
- package/build/src/tools/pages.js +14 -5
- package/build/src/tools/performance.js +6 -0
- package/build/src/tools/screencast.js +6 -2
- package/build/src/tools/screenshot.js +3 -0
- package/build/src/tools/script.js +2 -0
- package/build/src/tools/slim/tools.js +4 -0
- package/build/src/tools/snapshot.js +5 -1
- package/build/src/tools/{inPage.js → thirdPartyDeveloper.js} +17 -16
- package/build/src/tools/tools.js +3 -2
- package/build/src/tools/webmcp.js +5 -4
- package/build/src/trace-processing/parse.js +1 -0
- package/build/src/types.js +1 -0
- package/build/src/utils/check-for-updates.js +1 -0
- package/build/src/utils/files.js +5 -10
- package/build/src/utils/id.js +1 -0
- package/build/src/utils/keyboard.js +1 -0
- package/build/src/utils/pagination.js +1 -0
- package/build/src/utils/string.js +1 -0
- package/build/src/utils/types.js +1 -0
- package/build/src/version.js +2 -1
- package/package.json +10 -11
- package/build/src/bin/cliDefinitions.js +0 -621
|
@@ -6,32 +6,31 @@
|
|
|
6
6
|
import { zod, ajv } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
8
|
import { definePageTool } from './ToolDefinition.js';
|
|
9
|
-
export const
|
|
10
|
-
name: '
|
|
11
|
-
description: `Lists all
|
|
12
|
-
|
|
13
|
-
Alternatively,
|
|
9
|
+
export const listThirdPartyDeveloperTools = definePageTool({
|
|
10
|
+
name: 'list_3p_developer_tools',
|
|
11
|
+
description: `Lists all third-party developer tools the page exposes for providing runtime information.
|
|
12
|
+
Third-party developer tools can be called via the 'execute_3p_developer_tool()' MCP tool.
|
|
13
|
+
Alternatively, third-party developer tools can be executed by calling 'evaluate_script' and adding the
|
|
14
14
|
following command to the script:
|
|
15
15
|
'window.__dtmcp.executeTool(toolName, params)'
|
|
16
|
-
This might be helpful when the
|
|
17
|
-
|
|
16
|
+
This might be helpful when the third-party developer tools return non-serializable values or when composing
|
|
17
|
+
third-party developer tools with additional functionality.`,
|
|
18
18
|
annotations: {
|
|
19
|
-
category: ToolCategory.
|
|
19
|
+
category: ToolCategory.THIRD_PARTY,
|
|
20
20
|
readOnlyHint: true,
|
|
21
|
-
conditions: ['inPageTools'],
|
|
22
21
|
},
|
|
23
22
|
schema: {},
|
|
23
|
+
blockedByDialog: false,
|
|
24
24
|
handler: async (_request, response, _context) => {
|
|
25
|
-
response.
|
|
25
|
+
response.setListThirdPartyDeveloperTools();
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
|
-
export const
|
|
29
|
-
name: '
|
|
28
|
+
export const executeThirdPartyDeveloperTool = definePageTool({
|
|
29
|
+
name: 'execute_3p_developer_tool',
|
|
30
30
|
description: `Executes a tool exposed by the page.`,
|
|
31
31
|
annotations: {
|
|
32
|
-
category: ToolCategory.
|
|
32
|
+
category: ToolCategory.THIRD_PARTY,
|
|
33
33
|
readOnlyHint: false,
|
|
34
|
-
conditions: ['inPageTools'],
|
|
35
34
|
},
|
|
36
35
|
schema: {
|
|
37
36
|
toolName: zod.string().describe('The name of the tool to execute'),
|
|
@@ -40,6 +39,7 @@ export const executeInPageTool = definePageTool({
|
|
|
40
39
|
.optional()
|
|
41
40
|
.describe('The JSON-stringified parameters to pass to the tool'),
|
|
42
41
|
},
|
|
42
|
+
blockedByDialog: false,
|
|
43
43
|
handler: async (request, response) => {
|
|
44
44
|
const toolName = request.params.toolName;
|
|
45
45
|
let params = {};
|
|
@@ -58,7 +58,7 @@ export const executeInPageTool = definePageTool({
|
|
|
58
58
|
throw new Error(`Failed to parse params as JSON: ${errorMessage}`);
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
-
const toolGroup = request.page.
|
|
61
|
+
const toolGroup = request.page.getThirdPartyDeveloperTools();
|
|
62
62
|
const tool = toolGroup?.tools.find(t => t.name === toolName);
|
|
63
63
|
if (!tool) {
|
|
64
64
|
throw new Error(`Tool ${toolName} not found`);
|
|
@@ -69,6 +69,7 @@ export const executeInPageTool = definePageTool({
|
|
|
69
69
|
if (!valid) {
|
|
70
70
|
throw new Error(`Invalid parameters for tool ${toolName}: ${ajvInstance.errorsText(validate.errors)}`);
|
|
71
71
|
}
|
|
72
|
-
await request.page.
|
|
72
|
+
await request.page.executeThirdPartyDeveloperTool(toolName, params, response);
|
|
73
73
|
},
|
|
74
74
|
});
|
|
75
|
+
//# sourceMappingURL=thirdPartyDeveloper.js.map
|
package/build/src/tools/tools.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import * as consoleTools from './console.js';
|
|
7
7
|
import * as emulationTools from './emulation.js';
|
|
8
8
|
import * as extensionTools from './extensions.js';
|
|
9
|
-
import * as inPageTools from './inPage.js';
|
|
10
9
|
import * as inputTools from './input.js';
|
|
11
10
|
import * as lighthouseTools from './lighthouse.js';
|
|
12
11
|
import * as memoryTools from './memory.js';
|
|
@@ -18,6 +17,7 @@ import * as screenshotTools from './screenshot.js';
|
|
|
18
17
|
import * as scriptTools from './script.js';
|
|
19
18
|
import * as slimTools from './slim/tools.js';
|
|
20
19
|
import * as snapshotTools from './snapshot.js';
|
|
20
|
+
import * as thirdPartyDeveloperTools from './thirdPartyDeveloper.js';
|
|
21
21
|
import * as webmcpTools from './webmcp.js';
|
|
22
22
|
export const createTools = (args) => {
|
|
23
23
|
const rawTools = args.slim
|
|
@@ -26,7 +26,6 @@ export const createTools = (args) => {
|
|
|
26
26
|
...Object.values(consoleTools),
|
|
27
27
|
...Object.values(emulationTools),
|
|
28
28
|
...Object.values(extensionTools),
|
|
29
|
-
...Object.values(inPageTools),
|
|
30
29
|
...Object.values(inputTools),
|
|
31
30
|
...Object.values(lighthouseTools),
|
|
32
31
|
...Object.values(memoryTools),
|
|
@@ -37,6 +36,7 @@ export const createTools = (args) => {
|
|
|
37
36
|
...Object.values(screenshotTools),
|
|
38
37
|
...Object.values(scriptTools),
|
|
39
38
|
...Object.values(snapshotTools),
|
|
39
|
+
...Object.values(thirdPartyDeveloperTools),
|
|
40
40
|
...Object.values(webmcpTools),
|
|
41
41
|
];
|
|
42
42
|
const tools = [];
|
|
@@ -53,3 +53,4 @@ export const createTools = (args) => {
|
|
|
53
53
|
});
|
|
54
54
|
return tools;
|
|
55
55
|
};
|
|
56
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -10,11 +10,11 @@ export const listWebMcpTools = definePageTool({
|
|
|
10
10
|
name: 'list_webmcp_tools',
|
|
11
11
|
description: `Lists all WebMCP tools the page exposes.`,
|
|
12
12
|
annotations: {
|
|
13
|
-
category: ToolCategory.
|
|
13
|
+
category: ToolCategory.WEBMCP,
|
|
14
14
|
readOnlyHint: true,
|
|
15
|
-
conditions: ['experimentalWebmcp'],
|
|
16
15
|
},
|
|
17
16
|
schema: {},
|
|
17
|
+
blockedByDialog: false,
|
|
18
18
|
handler: async (_request, response, _context) => {
|
|
19
19
|
response.setListWebMcpTools();
|
|
20
20
|
},
|
|
@@ -23,9 +23,8 @@ export const executeWebMcpTool = definePageTool({
|
|
|
23
23
|
name: 'execute_webmcp_tool',
|
|
24
24
|
description: `Executes a WebMCP tool exposed by the page.`,
|
|
25
25
|
annotations: {
|
|
26
|
-
category: ToolCategory.
|
|
26
|
+
category: ToolCategory.WEBMCP,
|
|
27
27
|
readOnlyHint: false,
|
|
28
|
-
conditions: ['experimentalWebmcp'],
|
|
29
28
|
},
|
|
30
29
|
schema: {
|
|
31
30
|
toolName: zod.string().describe('The name of the WebMCP tool to execute'),
|
|
@@ -34,6 +33,7 @@ export const executeWebMcpTool = definePageTool({
|
|
|
34
33
|
.optional()
|
|
35
34
|
.describe('The JSON-stringified parameters to pass to the WebMCP tool'),
|
|
36
35
|
},
|
|
36
|
+
blockedByDialog: false,
|
|
37
37
|
handler: async (request, response) => {
|
|
38
38
|
const toolName = request.params.toolName;
|
|
39
39
|
let input = {};
|
|
@@ -61,3 +61,4 @@ export const executeWebMcpTool = definePageTool({
|
|
|
61
61
|
response.appendResponseLine(JSON.stringify({ status, output, errorText }, null, 2));
|
|
62
62
|
},
|
|
63
63
|
});
|
|
64
|
+
//# sourceMappingURL=webmcp.js.map
|
|
@@ -82,3 +82,4 @@ export function getInsightOutput(result, insightSetId, insightName) {
|
|
|
82
82
|
const formatter = new DevTools.PerformanceInsightFormatter(DevTools.AgentFocus.fromParsedTrace(result.parsedTrace), matchingInsight);
|
|
83
83
|
return { output: formatter.formatInsight() };
|
|
84
84
|
}
|
|
85
|
+
//# sourceMappingURL=parse.js.map
|
package/build/src/types.js
CHANGED
package/build/src/utils/files.js
CHANGED
|
@@ -6,18 +6,13 @@
|
|
|
6
6
|
import fs from 'node:fs/promises';
|
|
7
7
|
import os from 'node:os';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
-
export async function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
await fs.writeFile(filepath, data);
|
|
14
|
-
return { filepath };
|
|
15
|
-
}
|
|
16
|
-
catch (err) {
|
|
17
|
-
throw new Error('Could not save a file', { cause: err });
|
|
18
|
-
}
|
|
9
|
+
export async function getTempFilePath(filename) {
|
|
10
|
+
const dir = await fs.mkdtemp(path.join(os.tmpdir(), 'chrome-devtools-mcp-'));
|
|
11
|
+
const filepath = path.join(dir, filename);
|
|
12
|
+
return filepath;
|
|
19
13
|
}
|
|
20
14
|
export function ensureExtension(filepath, extension) {
|
|
21
15
|
const ext = path.extname(filepath);
|
|
22
16
|
return filepath.slice(0, filepath.length - ext.length) + extension;
|
|
23
17
|
}
|
|
18
|
+
//# sourceMappingURL=files.js.map
|
package/build/src/utils/id.js
CHANGED
package/build/src/utils/types.js
CHANGED
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.25.0",
|
|
4
4
|
"description": "MCP server for Chrome DevTools",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"typecheck": "tsc --noEmit",
|
|
17
17
|
"format": "eslint --cache --fix . && prettier --write --cache .",
|
|
18
18
|
"check-format": "eslint --cache . && prettier --check --cache .;",
|
|
19
|
-
"gen": "npm run build && npm run docs:generate && npm run cli:generate && npm run update-
|
|
19
|
+
"gen": "npm run build && npm run docs:generate && npm run cli:generate && npm run update-metrics && npm run format",
|
|
20
20
|
"docs:generate": "node --experimental-strip-types scripts/generate-docs.ts",
|
|
21
|
-
"start": "npm run build && node build/src/
|
|
22
|
-
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/
|
|
21
|
+
"start": "npm run build && node build/src/bin/chrome-devtools-mcp.js",
|
|
22
|
+
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/bin/chrome-devtools-mcp.js",
|
|
23
23
|
"test": "npm run build && node scripts/test.mjs",
|
|
24
24
|
"test:no-build": "node scripts/test.mjs",
|
|
25
25
|
"test:only": "npm run build && node scripts/test.mjs --test-only",
|
|
@@ -27,8 +27,7 @@
|
|
|
27
27
|
"prepare": "node --experimental-strip-types scripts/prepare.ts",
|
|
28
28
|
"verify-server-json-version": "node --experimental-strip-types scripts/verify-server-json-version.ts",
|
|
29
29
|
"update-lighthouse": "node --experimental-strip-types scripts/update-lighthouse.ts",
|
|
30
|
-
"update-
|
|
31
|
-
"update-flag-usage-metrics": "node --experimental-strip-types scripts/update_flag_usage_metrics.ts",
|
|
30
|
+
"update-metrics": "node --experimental-strip-types scripts/update_metrics.ts",
|
|
32
31
|
"verify-npm-package": "node scripts/verify-npm-package.mjs",
|
|
33
32
|
"eval": "npm run build && node --experimental-strip-types scripts/eval_gemini.ts",
|
|
34
33
|
"count-tokens": "node --experimental-strip-types scripts/count_tokens.ts"
|
|
@@ -36,7 +35,8 @@
|
|
|
36
35
|
"files": [
|
|
37
36
|
"build/src",
|
|
38
37
|
"LICENSE",
|
|
39
|
-
"!*.tsbuildinfo"
|
|
38
|
+
"!*.tsbuildinfo",
|
|
39
|
+
"!*.js.map"
|
|
40
40
|
],
|
|
41
41
|
"repository": "ChromeDevTools/chrome-devtools-mcp",
|
|
42
42
|
"author": "Google LLC",
|
|
@@ -62,22 +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.1625079",
|
|
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.2.0",
|
|
73
73
|
"prettier": "^3.6.2",
|
|
74
|
-
"puppeteer": "24.
|
|
74
|
+
"puppeteer": "24.43.0",
|
|
75
75
|
"rollup": "4.60.2",
|
|
76
76
|
"rollup-plugin-cleanup": "^3.2.1",
|
|
77
77
|
"rollup-plugin-license": "^3.6.0",
|
|
78
78
|
"semver": "^7.7.4",
|
|
79
79
|
"sinon": "^21.0.0",
|
|
80
|
-
"tiktoken": "^1.0.22",
|
|
81
80
|
"typescript": "^6.0.2",
|
|
82
81
|
"typescript-eslint": "^8.43.0",
|
|
83
82
|
"urlpattern-polyfill": "^10.1.0",
|