@dynamicu/chromedebug-mcp 2.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/CLAUDE.md +344 -0
- package/LICENSE +21 -0
- package/README.md +250 -0
- package/chrome-extension/README.md +41 -0
- package/chrome-extension/background.js +3917 -0
- package/chrome-extension/chrome-session-manager.js +706 -0
- package/chrome-extension/content.css +181 -0
- package/chrome-extension/content.js +3022 -0
- package/chrome-extension/data-buffer.js +435 -0
- package/chrome-extension/dom-tracker.js +411 -0
- package/chrome-extension/extension-config.js +78 -0
- package/chrome-extension/firebase-client.js +278 -0
- package/chrome-extension/firebase-config.js +32 -0
- package/chrome-extension/firebase-config.module.js +22 -0
- package/chrome-extension/firebase-config.module.template.js +27 -0
- package/chrome-extension/firebase-config.template.js +36 -0
- package/chrome-extension/frame-capture.js +407 -0
- package/chrome-extension/icon128.png +1 -0
- package/chrome-extension/icon16.png +1 -0
- package/chrome-extension/icon48.png +1 -0
- package/chrome-extension/license-helper.js +181 -0
- package/chrome-extension/logger.js +23 -0
- package/chrome-extension/manifest.json +73 -0
- package/chrome-extension/network-tracker.js +510 -0
- package/chrome-extension/offscreen.html +10 -0
- package/chrome-extension/options.html +203 -0
- package/chrome-extension/options.js +282 -0
- package/chrome-extension/pako.min.js +2 -0
- package/chrome-extension/performance-monitor.js +533 -0
- package/chrome-extension/pii-redactor.js +405 -0
- package/chrome-extension/popup.html +532 -0
- package/chrome-extension/popup.js +2446 -0
- package/chrome-extension/upload-manager.js +323 -0
- package/chrome-extension/web-vitals.iife.js +1 -0
- package/config/api-keys.json +11 -0
- package/config/chrome-pilot-config.json +45 -0
- package/package.json +126 -0
- package/scripts/cleanup-processes.js +109 -0
- package/scripts/config-manager.js +280 -0
- package/scripts/generate-extension-config.js +53 -0
- package/scripts/setup-security.js +64 -0
- package/src/capture/architecture.js +426 -0
- package/src/capture/error-handling-tests.md +38 -0
- package/src/capture/error-handling-types.ts +360 -0
- package/src/capture/index.js +508 -0
- package/src/capture/interfaces.js +625 -0
- package/src/capture/memory-manager.js +713 -0
- package/src/capture/types.js +342 -0
- package/src/chrome-controller.js +2658 -0
- package/src/cli.js +19 -0
- package/src/config-loader.js +303 -0
- package/src/database.js +2178 -0
- package/src/firebase-license-manager.js +462 -0
- package/src/firebase-privacy-guard.js +397 -0
- package/src/http-server.js +1516 -0
- package/src/index-direct.js +157 -0
- package/src/index-modular.js +219 -0
- package/src/index-monolithic-backup.js +2230 -0
- package/src/index.js +305 -0
- package/src/legacy/chrome-controller-old.js +1406 -0
- package/src/legacy/index-express.js +625 -0
- package/src/legacy/index-old.js +977 -0
- package/src/legacy/routes.js +260 -0
- package/src/legacy/shared-storage.js +101 -0
- package/src/logger.js +10 -0
- package/src/mcp/handlers/chrome-tool-handler.js +306 -0
- package/src/mcp/handlers/element-tool-handler.js +51 -0
- package/src/mcp/handlers/frame-tool-handler.js +957 -0
- package/src/mcp/handlers/request-handler.js +104 -0
- package/src/mcp/handlers/workflow-tool-handler.js +636 -0
- package/src/mcp/server.js +68 -0
- package/src/mcp/tools/index.js +701 -0
- package/src/middleware/auth.js +371 -0
- package/src/middleware/security.js +267 -0
- package/src/port-discovery.js +258 -0
- package/src/routes/admin.js +182 -0
- package/src/services/browser-daemon.js +494 -0
- package/src/services/chrome-service.js +375 -0
- package/src/services/failover-manager.js +412 -0
- package/src/services/git-safety-service.js +675 -0
- package/src/services/heartbeat-manager.js +200 -0
- package/src/services/http-client.js +195 -0
- package/src/services/process-manager.js +318 -0
- package/src/services/process-tracker.js +574 -0
- package/src/services/profile-manager.js +449 -0
- package/src/services/project-manager.js +415 -0
- package/src/services/session-manager.js +497 -0
- package/src/services/session-registry.js +491 -0
- package/src/services/unified-session-manager.js +678 -0
- package/src/shared-storage-old.js +267 -0
- package/src/standalone-server.js +53 -0
- package/src/utils/extension-path.js +145 -0
- package/src/utils.js +187 -0
- package/src/validation/log-transformer.js +125 -0
- package/src/validation/schemas.js +391 -0
|
@@ -0,0 +1,701 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Registry module for managing MCP tools
|
|
3
|
+
* Provides centralized tool definition and lazy loading capabilities
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Tool definitions - extracted from original index.js
|
|
7
|
+
const toolDefinitions = [
|
|
8
|
+
{
|
|
9
|
+
name: 'launch_chrome',
|
|
10
|
+
description: 'Launch a Chrome browser instance for this MCP server',
|
|
11
|
+
inputSchema: {
|
|
12
|
+
type: 'object',
|
|
13
|
+
properties: {},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'connect_to_existing_chrome',
|
|
18
|
+
description: 'Connect to an existing Chrome instance with debugging enabled',
|
|
19
|
+
inputSchema: {
|
|
20
|
+
type: 'object',
|
|
21
|
+
properties: {
|
|
22
|
+
port: {
|
|
23
|
+
type: 'number',
|
|
24
|
+
description: 'Debugging port Chrome is running on (default: 9222)',
|
|
25
|
+
default: 9222,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'navigate_to',
|
|
32
|
+
description: 'Navigate to a URL',
|
|
33
|
+
inputSchema: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
url: {
|
|
37
|
+
type: 'string',
|
|
38
|
+
description: 'URL to navigate to',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
required: ['url'],
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'pause_execution',
|
|
46
|
+
description: 'Pause Chrome execution',
|
|
47
|
+
inputSchema: {
|
|
48
|
+
type: 'object',
|
|
49
|
+
properties: {},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'resume_execution',
|
|
54
|
+
description: 'Resume Chrome execution',
|
|
55
|
+
inputSchema: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
properties: {},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'step_over',
|
|
62
|
+
description: 'Step over in Chrome debugger',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'evaluate_expression',
|
|
70
|
+
description: 'Evaluate a JavaScript expression in Chrome',
|
|
71
|
+
inputSchema: {
|
|
72
|
+
type: 'object',
|
|
73
|
+
properties: {
|
|
74
|
+
expression: {
|
|
75
|
+
type: 'string',
|
|
76
|
+
description: 'JavaScript expression to evaluate',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
required: ['expression'],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'get_scopes',
|
|
84
|
+
description: 'Get scope variables from the top call frame',
|
|
85
|
+
inputSchema: {
|
|
86
|
+
type: 'object',
|
|
87
|
+
properties: {},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'set_breakpoint',
|
|
92
|
+
description: 'Set a breakpoint at a specific URL and line',
|
|
93
|
+
inputSchema: {
|
|
94
|
+
type: 'object',
|
|
95
|
+
properties: {
|
|
96
|
+
url: {
|
|
97
|
+
type: 'string',
|
|
98
|
+
description: 'URL of the script',
|
|
99
|
+
},
|
|
100
|
+
lineNumber: {
|
|
101
|
+
type: 'number',
|
|
102
|
+
description: 'Line number for the breakpoint',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
required: ['url', 'lineNumber'],
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
name: 'get_logs',
|
|
110
|
+
description: 'Get recent console logs',
|
|
111
|
+
inputSchema: {
|
|
112
|
+
type: 'object',
|
|
113
|
+
properties: {},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'check_connection',
|
|
118
|
+
description: 'Check if Chrome is connected',
|
|
119
|
+
inputSchema: {
|
|
120
|
+
type: 'object',
|
|
121
|
+
properties: {},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'force_reset',
|
|
126
|
+
description: 'Force reset Chrome by killing all processes and clearing state',
|
|
127
|
+
inputSchema: {
|
|
128
|
+
type: 'object',
|
|
129
|
+
properties: {},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'take_screenshot',
|
|
134
|
+
description: 'Take a screenshot optimized for AI processing',
|
|
135
|
+
inputSchema: {
|
|
136
|
+
type: 'object',
|
|
137
|
+
properties: {
|
|
138
|
+
fullPage: {
|
|
139
|
+
type: 'boolean',
|
|
140
|
+
description: 'Capture full page (default: true, but limited to 600px height for AI)',
|
|
141
|
+
},
|
|
142
|
+
lowRes: {
|
|
143
|
+
type: 'boolean',
|
|
144
|
+
description: 'Low-resolution mode for AI (default: true)',
|
|
145
|
+
},
|
|
146
|
+
quality: {
|
|
147
|
+
type: 'number',
|
|
148
|
+
description: 'JPEG quality (1-100, default: 30)',
|
|
149
|
+
minimum: 1,
|
|
150
|
+
maximum: 100,
|
|
151
|
+
},
|
|
152
|
+
type: {
|
|
153
|
+
type: 'string',
|
|
154
|
+
description: 'Image type (default: jpeg)',
|
|
155
|
+
enum: ['png', 'jpeg'],
|
|
156
|
+
},
|
|
157
|
+
path: {
|
|
158
|
+
type: 'string',
|
|
159
|
+
description: 'Save screenshot to file path',
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'get_page_content',
|
|
166
|
+
description: 'Get the content of the current page including text, HTML, and DOM structure. Useful for checking if specific content exists without taking a screenshot.',
|
|
167
|
+
inputSchema: {
|
|
168
|
+
type: 'object',
|
|
169
|
+
properties: {
|
|
170
|
+
includeText: {
|
|
171
|
+
type: 'boolean',
|
|
172
|
+
description: 'Include extracted text content (default: true)',
|
|
173
|
+
},
|
|
174
|
+
includeHtml: {
|
|
175
|
+
type: 'boolean',
|
|
176
|
+
description: 'Include full HTML source (default: false, can be large)',
|
|
177
|
+
},
|
|
178
|
+
includeStructure: {
|
|
179
|
+
type: 'boolean',
|
|
180
|
+
description: 'Include DOM structure with important elements and attributes (default: true)',
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: 'get_selected_element',
|
|
187
|
+
description: 'Get information about the currently selected element from Chrome extension',
|
|
188
|
+
inputSchema: {
|
|
189
|
+
type: 'object',
|
|
190
|
+
properties: {},
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'apply_css_to_selected',
|
|
195
|
+
description: 'Apply CSS styles to the currently selected element',
|
|
196
|
+
inputSchema: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
css: {
|
|
200
|
+
type: 'string',
|
|
201
|
+
description: 'CSS rules to apply',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
required: ['css'],
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'execute_js_on_selected',
|
|
209
|
+
description: 'Execute JavaScript code on the currently selected element',
|
|
210
|
+
inputSchema: {
|
|
211
|
+
type: 'object',
|
|
212
|
+
properties: {
|
|
213
|
+
code: {
|
|
214
|
+
type: 'string',
|
|
215
|
+
description: 'JavaScript code to execute. The element is available as the "element" variable.',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
required: ['code'],
|
|
219
|
+
},
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
name: 'clear_selected_element',
|
|
223
|
+
description: 'Clear the currently selected element',
|
|
224
|
+
inputSchema: {
|
|
225
|
+
type: 'object',
|
|
226
|
+
properties: {},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'get_websocket_info',
|
|
231
|
+
description: 'Get WebSocket server information for Chrome extension',
|
|
232
|
+
inputSchema: {
|
|
233
|
+
type: 'object',
|
|
234
|
+
properties: {},
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: 'get_workflow_recording',
|
|
239
|
+
description: 'Get a complete workflow recording including actions and optional logs',
|
|
240
|
+
inputSchema: {
|
|
241
|
+
type: 'object',
|
|
242
|
+
properties: {
|
|
243
|
+
sessionId: {
|
|
244
|
+
type: 'string',
|
|
245
|
+
description: 'The workflow session ID',
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
required: ['sessionId'],
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
name: 'list_workflow_recordings',
|
|
253
|
+
description: 'List all workflow recordings stored in the database',
|
|
254
|
+
inputSchema: {
|
|
255
|
+
type: 'object',
|
|
256
|
+
properties: {},
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
name: 'get_workflow_function_traces',
|
|
261
|
+
description: 'Get only function execution traces from a workflow recording',
|
|
262
|
+
inputSchema: {
|
|
263
|
+
type: 'object',
|
|
264
|
+
properties: {
|
|
265
|
+
sessionId: {
|
|
266
|
+
type: 'string',
|
|
267
|
+
description: 'The workflow session ID',
|
|
268
|
+
},
|
|
269
|
+
includeStack: {
|
|
270
|
+
type: 'boolean',
|
|
271
|
+
description: 'Include stack traces (default: false)',
|
|
272
|
+
},
|
|
273
|
+
limit: {
|
|
274
|
+
type: 'number',
|
|
275
|
+
description: 'Maximum number of traces to return',
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
|
+
required: ['sessionId'],
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
name: 'get_workflow_errors',
|
|
283
|
+
description: 'Get only error logs and error-related actions from a workflow',
|
|
284
|
+
inputSchema: {
|
|
285
|
+
type: 'object',
|
|
286
|
+
properties: {
|
|
287
|
+
sessionId: {
|
|
288
|
+
type: 'string',
|
|
289
|
+
description: 'The workflow session ID',
|
|
290
|
+
},
|
|
291
|
+
includeWarnings: {
|
|
292
|
+
type: 'boolean',
|
|
293
|
+
description: 'Include warning logs (default: false)',
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
|
+
required: ['sessionId'],
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
name: 'get_workflow_summary',
|
|
301
|
+
description: 'Get a concise summary of a workflow recording',
|
|
302
|
+
inputSchema: {
|
|
303
|
+
type: 'object',
|
|
304
|
+
properties: {
|
|
305
|
+
sessionId: {
|
|
306
|
+
type: 'string',
|
|
307
|
+
description: 'The workflow session ID',
|
|
308
|
+
},
|
|
309
|
+
},
|
|
310
|
+
required: ['sessionId'],
|
|
311
|
+
},
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
name: 'get_workflow_actions_filtered',
|
|
315
|
+
description: 'Get filtered workflow actions by type or time range',
|
|
316
|
+
inputSchema: {
|
|
317
|
+
type: 'object',
|
|
318
|
+
properties: {
|
|
319
|
+
sessionId: {
|
|
320
|
+
type: 'string',
|
|
321
|
+
description: 'The workflow session ID',
|
|
322
|
+
},
|
|
323
|
+
actionTypes: {
|
|
324
|
+
type: 'array',
|
|
325
|
+
items: { type: 'string' },
|
|
326
|
+
description: 'Filter by action types (e.g., ["click", "input", "function-trace"])',
|
|
327
|
+
},
|
|
328
|
+
startIndex: {
|
|
329
|
+
type: 'number',
|
|
330
|
+
description: 'Start index for pagination',
|
|
331
|
+
},
|
|
332
|
+
limit: {
|
|
333
|
+
type: 'number',
|
|
334
|
+
description: 'Maximum number of actions to return',
|
|
335
|
+
},
|
|
336
|
+
includeDetails: {
|
|
337
|
+
type: 'boolean',
|
|
338
|
+
description: 'Include full action details (default: false)',
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
required: ['sessionId'],
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: 'save_restore_point',
|
|
346
|
+
description: 'Save a restore point for the current browser state including DOM, form values, storage, and cookies',
|
|
347
|
+
inputSchema: {
|
|
348
|
+
type: 'object',
|
|
349
|
+
properties: {
|
|
350
|
+
workflowId: {
|
|
351
|
+
type: 'string',
|
|
352
|
+
description: 'The workflow ID this restore point belongs to',
|
|
353
|
+
},
|
|
354
|
+
actionIndex: {
|
|
355
|
+
type: 'number',
|
|
356
|
+
description: 'The action index in the workflow where this restore point was created',
|
|
357
|
+
},
|
|
358
|
+
description: {
|
|
359
|
+
type: 'string',
|
|
360
|
+
description: 'Optional description of this restore point',
|
|
361
|
+
},
|
|
362
|
+
},
|
|
363
|
+
required: ['workflowId'],
|
|
364
|
+
},
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
name: 'restore_from_point',
|
|
368
|
+
description: 'Restore the browser to a previously saved restore point',
|
|
369
|
+
inputSchema: {
|
|
370
|
+
type: 'object',
|
|
371
|
+
properties: {
|
|
372
|
+
restorePointId: {
|
|
373
|
+
type: 'string',
|
|
374
|
+
description: 'The ID of the restore point to restore from',
|
|
375
|
+
},
|
|
376
|
+
},
|
|
377
|
+
required: ['restorePointId'],
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
{
|
|
381
|
+
name: 'list_restore_points',
|
|
382
|
+
description: 'List all restore points for a workflow',
|
|
383
|
+
inputSchema: {
|
|
384
|
+
type: 'object',
|
|
385
|
+
properties: {
|
|
386
|
+
workflowId: {
|
|
387
|
+
type: 'string',
|
|
388
|
+
description: 'The workflow ID to get restore points for',
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
required: ['workflowId'],
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
name: 'chromedebug_show_frames',
|
|
396
|
+
description: 'Display frame recording information in a compact format optimized for MCP tools. Shows frame metadata, console logs, and timestamps without including large image data.',
|
|
397
|
+
inputSchema: {
|
|
398
|
+
type: 'object',
|
|
399
|
+
properties: {
|
|
400
|
+
sessionId: {
|
|
401
|
+
type: 'string',
|
|
402
|
+
description: 'The frame session ID to display',
|
|
403
|
+
},
|
|
404
|
+
maxFrames: {
|
|
405
|
+
type: 'number',
|
|
406
|
+
description: 'Maximum number of frames to display (default: 10)',
|
|
407
|
+
default: 10,
|
|
408
|
+
},
|
|
409
|
+
showLogs: {
|
|
410
|
+
type: 'boolean',
|
|
411
|
+
description: 'Whether to show console logs for each frame (default: true)',
|
|
412
|
+
default: true,
|
|
413
|
+
},
|
|
414
|
+
showInteractions: {
|
|
415
|
+
type: 'boolean',
|
|
416
|
+
description: 'Whether to show user interactions for each frame (default: true)',
|
|
417
|
+
default: true,
|
|
418
|
+
},
|
|
419
|
+
logLevel: {
|
|
420
|
+
type: 'string',
|
|
421
|
+
description: 'Filter logs by level: error, warn, info, debug, log, or all (default: all)',
|
|
422
|
+
enum: ['error', 'warn', 'info', 'debug', 'log', 'all'],
|
|
423
|
+
default: 'all',
|
|
424
|
+
},
|
|
425
|
+
maxLogsPerFrame: {
|
|
426
|
+
type: 'number',
|
|
427
|
+
description: 'Maximum number of logs to show per frame (default: 10). Use 0 for no limit.',
|
|
428
|
+
default: 10,
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
required: ['sessionId'],
|
|
432
|
+
},
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
name: 'get_frame_session_info',
|
|
436
|
+
description: 'Get information about a frame capture session including total frames and timestamps',
|
|
437
|
+
inputSchema: {
|
|
438
|
+
type: 'object',
|
|
439
|
+
properties: {
|
|
440
|
+
sessionId: {
|
|
441
|
+
type: 'string',
|
|
442
|
+
description: 'The frame session ID returned when recording was saved',
|
|
443
|
+
},
|
|
444
|
+
},
|
|
445
|
+
required: ['sessionId'],
|
|
446
|
+
},
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
name: 'get_screen_interactions',
|
|
450
|
+
description: 'Get all user interactions (clicks, inputs, keypresses, scrolls) recorded during a screen recording session',
|
|
451
|
+
inputSchema: {
|
|
452
|
+
type: 'object',
|
|
453
|
+
properties: {
|
|
454
|
+
sessionId: {
|
|
455
|
+
type: 'string',
|
|
456
|
+
description: 'The screen recording session ID',
|
|
457
|
+
},
|
|
458
|
+
},
|
|
459
|
+
required: ['sessionId'],
|
|
460
|
+
},
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
name: 'get_frame',
|
|
464
|
+
description: 'Get a specific frame from a frame capture session',
|
|
465
|
+
inputSchema: {
|
|
466
|
+
type: 'object',
|
|
467
|
+
properties: {
|
|
468
|
+
sessionId: {
|
|
469
|
+
type: 'string',
|
|
470
|
+
description: 'The frame session ID',
|
|
471
|
+
},
|
|
472
|
+
frameIndex: {
|
|
473
|
+
type: 'number',
|
|
474
|
+
description: 'The frame index to retrieve (0-based)',
|
|
475
|
+
},
|
|
476
|
+
maxLogs: {
|
|
477
|
+
type: 'number',
|
|
478
|
+
description: 'Maximum number of logs to show (default: 20). Use 0 for no limit.',
|
|
479
|
+
default: 20,
|
|
480
|
+
},
|
|
481
|
+
logLevel: {
|
|
482
|
+
type: 'string',
|
|
483
|
+
description: 'Filter logs by level: error, warn, info, debug, log, or all (default: all)',
|
|
484
|
+
enum: ['error', 'warn', 'info', 'debug', 'log', 'all'],
|
|
485
|
+
default: 'all',
|
|
486
|
+
},
|
|
487
|
+
searchLogs: {
|
|
488
|
+
type: 'string',
|
|
489
|
+
description: 'Search for specific text in log messages (case insensitive)',
|
|
490
|
+
},
|
|
491
|
+
},
|
|
492
|
+
required: ['sessionId', 'frameIndex'],
|
|
493
|
+
},
|
|
494
|
+
},
|
|
495
|
+
{
|
|
496
|
+
name: 'search_frame_logs',
|
|
497
|
+
description: 'Search for specific logs across all frames in a recording session',
|
|
498
|
+
inputSchema: {
|
|
499
|
+
type: 'object',
|
|
500
|
+
properties: {
|
|
501
|
+
sessionId: {
|
|
502
|
+
type: 'string',
|
|
503
|
+
description: 'The frame session ID to search',
|
|
504
|
+
},
|
|
505
|
+
searchText: {
|
|
506
|
+
type: 'string',
|
|
507
|
+
description: 'Text to search for in log messages (case insensitive)',
|
|
508
|
+
},
|
|
509
|
+
logLevel: {
|
|
510
|
+
type: 'string',
|
|
511
|
+
description: 'Filter by log level: error, warn, info, debug, log, or all (default: all)',
|
|
512
|
+
enum: ['error', 'warn', 'info', 'debug', 'log', 'all'],
|
|
513
|
+
default: 'all',
|
|
514
|
+
},
|
|
515
|
+
maxResults: {
|
|
516
|
+
type: 'number',
|
|
517
|
+
description: 'Maximum number of matching logs to return (default: 50)',
|
|
518
|
+
default: 50,
|
|
519
|
+
},
|
|
520
|
+
},
|
|
521
|
+
required: ['sessionId', 'searchText'],
|
|
522
|
+
},
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
name: 'get_frame_logs_paginated',
|
|
526
|
+
description: 'Get logs for a specific frame with pagination to handle large log volumes',
|
|
527
|
+
inputSchema: {
|
|
528
|
+
type: 'object',
|
|
529
|
+
properties: {
|
|
530
|
+
sessionId: {
|
|
531
|
+
type: 'string',
|
|
532
|
+
description: 'The frame session ID',
|
|
533
|
+
},
|
|
534
|
+
frameIndex: {
|
|
535
|
+
type: 'number',
|
|
536
|
+
description: 'The frame index to retrieve logs from (0-based)',
|
|
537
|
+
},
|
|
538
|
+
offset: {
|
|
539
|
+
type: 'number',
|
|
540
|
+
description: 'Number of logs to skip (for pagination, default: 0)',
|
|
541
|
+
default: 0,
|
|
542
|
+
},
|
|
543
|
+
limit: {
|
|
544
|
+
type: 'number',
|
|
545
|
+
description: 'Maximum number of logs to return (default: 100)',
|
|
546
|
+
default: 100,
|
|
547
|
+
},
|
|
548
|
+
logLevel: {
|
|
549
|
+
type: 'string',
|
|
550
|
+
description: 'Filter by log level: error, warn, info, debug, log, or all (default: all)',
|
|
551
|
+
enum: ['error', 'warn', 'info', 'debug', 'log', 'all'],
|
|
552
|
+
default: 'all',
|
|
553
|
+
},
|
|
554
|
+
searchText: {
|
|
555
|
+
type: 'string',
|
|
556
|
+
description: 'Search for specific text in log messages (case insensitive)',
|
|
557
|
+
},
|
|
558
|
+
},
|
|
559
|
+
required: ['sessionId', 'frameIndex'],
|
|
560
|
+
},
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
name: 'get_frame_screenshot',
|
|
564
|
+
description: 'Get the screenshot image data for a specific frame as base64 encoded string. This allows viewing of the actual screenshots captured during frame recordings.',
|
|
565
|
+
inputSchema: {
|
|
566
|
+
type: 'object',
|
|
567
|
+
properties: {
|
|
568
|
+
sessionId: {
|
|
569
|
+
type: 'string',
|
|
570
|
+
description: 'The frame session ID',
|
|
571
|
+
},
|
|
572
|
+
frameIndex: {
|
|
573
|
+
type: 'number',
|
|
574
|
+
description: 'The frame index to retrieve screenshot from (0-based)',
|
|
575
|
+
},
|
|
576
|
+
includeMetadata: {
|
|
577
|
+
type: 'boolean',
|
|
578
|
+
description: 'Include image metadata like size and format (default: false)',
|
|
579
|
+
default: false,
|
|
580
|
+
},
|
|
581
|
+
},
|
|
582
|
+
required: ['sessionId', 'frameIndex'],
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
name: 'play_workflow_recording',
|
|
587
|
+
description: 'Play a workflow recording by executing all recorded actions',
|
|
588
|
+
inputSchema: {
|
|
589
|
+
type: 'object',
|
|
590
|
+
properties: {
|
|
591
|
+
sessionId: {
|
|
592
|
+
type: 'string',
|
|
593
|
+
description: 'The workflow session ID to play',
|
|
594
|
+
},
|
|
595
|
+
speed: {
|
|
596
|
+
type: 'number',
|
|
597
|
+
description: 'Playback speed multiplier (1 = normal, 2 = 2x faster, 0.5 = half speed)',
|
|
598
|
+
default: 1,
|
|
599
|
+
},
|
|
600
|
+
},
|
|
601
|
+
required: ['sessionId'],
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: 'play_workflow_by_name',
|
|
606
|
+
description: 'Play a workflow recording by its name',
|
|
607
|
+
inputSchema: {
|
|
608
|
+
type: 'object',
|
|
609
|
+
properties: {
|
|
610
|
+
name: {
|
|
611
|
+
type: 'string',
|
|
612
|
+
description: 'The name of the workflow recording to play',
|
|
613
|
+
},
|
|
614
|
+
speed: {
|
|
615
|
+
type: 'number',
|
|
616
|
+
description: 'Playback speed multiplier (1 = normal, 2 = 2x faster, 0.5 = half speed)',
|
|
617
|
+
default: 1,
|
|
618
|
+
},
|
|
619
|
+
},
|
|
620
|
+
required: ['name'],
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
/*
|
|
624
|
+
* SNAPSHOT FEATURE DISABLED (2025-10-01)
|
|
625
|
+
*
|
|
626
|
+
* Snapshot MCP tools removed - see SNAPSHOT_FEATURE_DISABLED.md
|
|
627
|
+
*
|
|
628
|
+
* Removed tools:
|
|
629
|
+
* - take_snapshot
|
|
630
|
+
* - list_snapshots
|
|
631
|
+
* - get_snapshot
|
|
632
|
+
* - search_snapshot_logs
|
|
633
|
+
*/
|
|
634
|
+
];
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* Tool Registry class for managing MCP tools
|
|
638
|
+
* Provides centralized access to tool definitions and metadata
|
|
639
|
+
*/
|
|
640
|
+
export class ToolRegistry {
|
|
641
|
+
constructor() {
|
|
642
|
+
this.tools = new Map();
|
|
643
|
+
this.loadTools();
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
/**
|
|
647
|
+
* Loads all tool definitions into the registry
|
|
648
|
+
*/
|
|
649
|
+
loadTools() {
|
|
650
|
+
toolDefinitions.forEach(tool => {
|
|
651
|
+
this.tools.set(tool.name, tool);
|
|
652
|
+
});
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/**
|
|
656
|
+
* Gets all registered tools
|
|
657
|
+
* @returns {Array} Array of tool definitions
|
|
658
|
+
*/
|
|
659
|
+
getAllTools() {
|
|
660
|
+
return Array.from(this.tools.values());
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Gets a specific tool by name
|
|
665
|
+
* @param {string} name - Tool name
|
|
666
|
+
* @returns {Object|null} Tool definition or null if not found
|
|
667
|
+
*/
|
|
668
|
+
getTool(name) {
|
|
669
|
+
return this.tools.get(name) || null;
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Checks if a tool exists
|
|
674
|
+
* @param {string} name - Tool name
|
|
675
|
+
* @returns {boolean} True if tool exists
|
|
676
|
+
*/
|
|
677
|
+
hasTool(name) {
|
|
678
|
+
return this.tools.has(name);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
/**
|
|
682
|
+
* Gets tool names grouped by category for organization
|
|
683
|
+
* @returns {Object} Object with tool names grouped by functionality
|
|
684
|
+
*/
|
|
685
|
+
getToolsByCategory() {
|
|
686
|
+
const categories = {
|
|
687
|
+
chrome: ['launch_chrome', 'connect_to_existing_chrome', 'check_connection', 'force_reset'],
|
|
688
|
+
navigation: ['navigate_to'],
|
|
689
|
+
debugging: ['pause_execution', 'resume_execution', 'step_over', 'set_breakpoint', 'get_scopes'],
|
|
690
|
+
content: ['get_page_content', 'take_screenshot', 'evaluate_expression', 'get_logs'],
|
|
691
|
+
element: ['get_selected_element', 'apply_css_to_selected', 'execute_js_on_selected', 'clear_selected_element'],
|
|
692
|
+
workflow: ['get_workflow_recording', 'list_workflow_recordings', 'play_workflow_recording', 'play_workflow_by_name'],
|
|
693
|
+
restore: ['save_restore_point', 'restore_from_point', 'list_restore_points'],
|
|
694
|
+
frames: ['chromedebug_show_frames', 'get_frame_session_info', 'get_frame', 'search_frame_logs', 'get_frame_logs_paginated', 'get_frame_screenshot'],
|
|
695
|
+
interactions: ['get_screen_interactions'],
|
|
696
|
+
system: ['get_websocket_info'],
|
|
697
|
+
};
|
|
698
|
+
|
|
699
|
+
return categories;
|
|
700
|
+
}
|
|
701
|
+
}
|