@mcp-b/chrome-devtools-mcp 1.5.2 → 1.5.4
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/build/src/McpContext.js
CHANGED
|
@@ -507,7 +507,9 @@ export class McpContext {
|
|
|
507
507
|
}
|
|
508
508
|
const [snapshotId] = uid.split('_');
|
|
509
509
|
if (this.#textSnapshot.snapshotId !== snapshotId) {
|
|
510
|
-
throw new Error(
|
|
510
|
+
throw new Error(`This uid (${uid}) is from an old snapshot. The page has changed since then. ` +
|
|
511
|
+
'Always call take_snapshot immediately before using UIDs from it. ' +
|
|
512
|
+
'Workflow: 1) take_snapshot, 2) use the UIDs from that response, 3) repeat for each action.');
|
|
511
513
|
}
|
|
512
514
|
const node = this.#textSnapshot?.idToNode.get(uid);
|
|
513
515
|
if (!node) {
|
package/build/src/main.js
CHANGED
|
@@ -22,7 +22,7 @@ import { WebMCPToolHub } from './tools/WebMCPToolHub.js';
|
|
|
22
22
|
* @remarks If moved, update release-please config.
|
|
23
23
|
*/
|
|
24
24
|
// x-release-please-start-version
|
|
25
|
-
const VERSION = '
|
|
25
|
+
const VERSION = '1.5.4';
|
|
26
26
|
// x-release-please-end
|
|
27
27
|
process.on('unhandledRejection', (reason, promise) => {
|
|
28
28
|
logger('Unhandled promise rejection', promise, reason);
|
package/build/src/tools/input.js
CHANGED
|
@@ -9,7 +9,7 @@ import { ToolCategory } from './categories.js';
|
|
|
9
9
|
import { defineTool } from './ToolDefinition.js';
|
|
10
10
|
export const click = defineTool({
|
|
11
11
|
name: 'click',
|
|
12
|
-
description: `Clicks on the provided element
|
|
12
|
+
description: `Clicks on the provided element. IMPORTANT: Always call take_snapshot first to get a fresh uid - UIDs expire when the page changes.`,
|
|
13
13
|
annotations: {
|
|
14
14
|
category: ToolCategory.INPUT,
|
|
15
15
|
readOnlyHint: false,
|
|
@@ -9,8 +9,9 @@ import { defineTool, timeoutSchema } from './ToolDefinition.js';
|
|
|
9
9
|
export const takeSnapshot = defineTool({
|
|
10
10
|
name: 'take_snapshot',
|
|
11
11
|
description: `Take a text snapshot of the currently selected page based on the a11y tree. The snapshot lists page elements along with a unique
|
|
12
|
-
identifier (uid).
|
|
13
|
-
|
|
12
|
+
identifier (uid). IMPORTANT: UIDs expire when the page changes. Always take a fresh snapshot immediately before using UIDs for click/type/etc.
|
|
13
|
+
Workflow: 1) take_snapshot, 2) find the uid you need, 3) use it in click/type, 4) take_snapshot again for next action.
|
|
14
|
+
Prefer taking a snapshot over taking a screenshot. The snapshot indicates the element selected in the DevTools Elements panel (if any).`,
|
|
14
15
|
annotations: {
|
|
15
16
|
category: ToolCategory.DEBUGGING,
|
|
16
17
|
// Not read-only due to filePath param.
|
|
@@ -86,8 +86,8 @@ export const listWebMCPTools = defineTool({
|
|
|
86
86
|
description: 'List all WebMCP tools registered across all pages, with diff since last call. ' +
|
|
87
87
|
'First call returns full list. Subsequent calls return only added/removed tools. ' +
|
|
88
88
|
'Use full=true to force complete list. ' +
|
|
89
|
-
'
|
|
90
|
-
'
|
|
89
|
+
'To call these tools, use call_webmcp_tool with the ORIGINAL tool name (without the webmcp_ prefix). ' +
|
|
90
|
+
'Example: call_webmcp_tool({ name: "idp_config_get" }) NOT "webmcp_localhost_3000_page0_idp_config_get".',
|
|
91
91
|
annotations: {
|
|
92
92
|
title: 'Diff Website MCP Tools',
|
|
93
93
|
category: ToolCategory.WEBMCP,
|
|
@@ -120,19 +120,19 @@ export const listWebMCPTools = defineTool({
|
|
|
120
120
|
response.appendResponseLine(`${tools.length} WebMCP tool(s) registered:`);
|
|
121
121
|
response.appendResponseLine('');
|
|
122
122
|
for (const tool of tools) {
|
|
123
|
-
response.appendResponseLine(`- ${tool.
|
|
124
|
-
response.appendResponseLine(` Original: ${tool.originalName}`);
|
|
125
|
-
response.appendResponseLine(` Domain: ${tool.domain} (page ${tool.pageIdx})`);
|
|
123
|
+
response.appendResponseLine(`- ${tool.originalName}`);
|
|
126
124
|
if (tool.description) {
|
|
127
125
|
response.appendResponseLine(` Description: ${tool.description}`);
|
|
128
126
|
}
|
|
127
|
+
response.appendResponseLine(` Domain: ${tool.domain} (page ${tool.pageIdx})`);
|
|
128
|
+
response.appendResponseLine(` Full ID: ${tool.toolId}`);
|
|
129
129
|
response.appendResponseLine('');
|
|
130
130
|
}
|
|
131
|
-
response.appendResponseLine('IMPORTANT:
|
|
132
|
-
response.appendResponseLine('Call them directly using: mcp__chrome-devtools__<toolId>');
|
|
131
|
+
response.appendResponseLine('IMPORTANT: Use call_webmcp_tool with the ORIGINAL name (without webmcp_ prefix).');
|
|
133
132
|
if (tools.length > 0) {
|
|
134
|
-
response.appendResponseLine(`Example:
|
|
133
|
+
response.appendResponseLine(`Example: call_webmcp_tool({ name: "${tools[0].originalName}" })`);
|
|
135
134
|
}
|
|
135
|
+
response.appendResponseLine('NOT: call_webmcp_tool({ name: "webmcp_localhost_..." })');
|
|
136
136
|
return;
|
|
137
137
|
}
|
|
138
138
|
// Subsequent calls: return diff
|
|
@@ -150,14 +150,15 @@ export const listWebMCPTools = defineTool({
|
|
|
150
150
|
if (added.length > 0) {
|
|
151
151
|
response.appendResponseLine(`Added (${added.length}):`);
|
|
152
152
|
for (const tool of added) {
|
|
153
|
-
response.appendResponseLine(`+ ${tool.
|
|
153
|
+
response.appendResponseLine(`+ ${tool.originalName}`);
|
|
154
154
|
if (tool.description) {
|
|
155
155
|
response.appendResponseLine(` ${tool.description}`);
|
|
156
156
|
}
|
|
157
|
+
response.appendResponseLine(` Full ID: ${tool.toolId}`);
|
|
157
158
|
}
|
|
158
159
|
response.appendResponseLine('');
|
|
159
|
-
response.appendResponseLine('NEW TOOLS AVAILABLE:
|
|
160
|
-
response.appendResponseLine(`
|
|
160
|
+
response.appendResponseLine('NEW TOOLS AVAILABLE: Use call_webmcp_tool with the original name.');
|
|
161
|
+
response.appendResponseLine(`Example: call_webmcp_tool({ name: "${added[0].originalName}" })`);
|
|
161
162
|
response.appendResponseLine('');
|
|
162
163
|
}
|
|
163
164
|
if (removed.length > 0) {
|