@eddym06/custom-chrome-mcp 1.0.2

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.
Files changed (56) hide show
  1. package/.npmrc.example +2 -0
  2. package/CHANGELOG.md +87 -0
  3. package/INSTALL.md +148 -0
  4. package/LICENSE +21 -0
  5. package/README.md +403 -0
  6. package/dist/chrome-connector.d.ts +116 -0
  7. package/dist/chrome-connector.d.ts.map +1 -0
  8. package/dist/chrome-connector.js +452 -0
  9. package/dist/chrome-connector.js.map +1 -0
  10. package/dist/index.d.ts +7 -0
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +211 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/tools/anti-detection.d.ts +22 -0
  15. package/dist/tools/anti-detection.d.ts.map +1 -0
  16. package/dist/tools/anti-detection.js +220 -0
  17. package/dist/tools/anti-detection.js.map +1 -0
  18. package/dist/tools/capture.d.ts +130 -0
  19. package/dist/tools/capture.d.ts.map +1 -0
  20. package/dist/tools/capture.js +164 -0
  21. package/dist/tools/capture.js.map +1 -0
  22. package/dist/tools/interaction.d.ts +173 -0
  23. package/dist/tools/interaction.d.ts.map +1 -0
  24. package/dist/tools/interaction.js +274 -0
  25. package/dist/tools/interaction.js.map +1 -0
  26. package/dist/tools/navigation.d.ts +82 -0
  27. package/dist/tools/navigation.d.ts.map +1 -0
  28. package/dist/tools/navigation.js +196 -0
  29. package/dist/tools/navigation.js.map +1 -0
  30. package/dist/tools/playwright-launcher.d.ts +53 -0
  31. package/dist/tools/playwright-launcher.d.ts.map +1 -0
  32. package/dist/tools/playwright-launcher.js +117 -0
  33. package/dist/tools/playwright-launcher.js.map +1 -0
  34. package/dist/tools/service-worker.d.ts +128 -0
  35. package/dist/tools/service-worker.d.ts.map +1 -0
  36. package/dist/tools/service-worker.js +355 -0
  37. package/dist/tools/service-worker.js.map +1 -0
  38. package/dist/tools/session.d.ts +54 -0
  39. package/dist/tools/session.d.ts.map +1 -0
  40. package/dist/tools/session.js +311 -0
  41. package/dist/tools/session.js.map +1 -0
  42. package/dist/tools/system.d.ts +159 -0
  43. package/dist/tools/system.d.ts.map +1 -0
  44. package/dist/tools/system.js +252 -0
  45. package/dist/tools/system.js.map +1 -0
  46. package/dist/types/index.d.ts +75 -0
  47. package/dist/types/index.d.ts.map +1 -0
  48. package/dist/types/index.js +5 -0
  49. package/dist/types/index.js.map +1 -0
  50. package/dist/utils/helpers.d.ts +53 -0
  51. package/dist/utils/helpers.d.ts.map +1 -0
  52. package/dist/utils/helpers.js +122 -0
  53. package/dist/utils/helpers.js.map +1 -0
  54. package/mcp-config-example.json +12 -0
  55. package/package.json +61 -0
  56. package/test-playwright.js +57 -0
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Chrome Connection Manager
3
+ * Handles connection to existing Chrome instance via CDP
4
+ * Now with Playwright support for launching browser
5
+ */
6
+ import { type BrowserContext } from 'playwright';
7
+ export interface ChromeConnection {
8
+ client: any;
9
+ connected: boolean;
10
+ port: number;
11
+ }
12
+ export interface TabInfo {
13
+ id: string;
14
+ type: string;
15
+ title: string;
16
+ url: string;
17
+ description?: string;
18
+ }
19
+ export interface LaunchOptions {
20
+ headless?: boolean;
21
+ userDataDir?: string;
22
+ profileDirectory?: string;
23
+ executablePath?: string;
24
+ }
25
+ export declare class ChromeConnector {
26
+ private connection;
27
+ private port;
28
+ private currentTabId;
29
+ private browserContext;
30
+ private chromeProcess;
31
+ constructor(port?: number);
32
+ /**
33
+ * Get platform-specific Chrome paths
34
+ */
35
+ private getPlatformPaths;
36
+ /**
37
+ * createShadowProfile: Clones essential parts of the profile to a temp dir
38
+ * to bypass Chrome's restriction on debugging the Default profile.
39
+ * Cross-platform: uses robocopy on Windows, rsync on Unix systems.
40
+ */
41
+ private createShadowProfile;
42
+ /**
43
+ * Launch Chrome manually using child_process to avoid blocking and argument issues
44
+ * This is more robust for persistent profiles than Playwright's launcher
45
+ */
46
+ launchWithProfile(options?: LaunchOptions): Promise<void>;
47
+ /**
48
+ * Disconnect from Chrome and close Playwright browser
49
+ */
50
+ disconnect(): Promise<void>;
51
+ /**
52
+ * Connect to existing Chrome instance
53
+ */
54
+ connect(): Promise<void>;
55
+ /**
56
+ * Get Playwright browser context
57
+ */
58
+ getBrowserContext(): BrowserContext | null;
59
+ /**
60
+ * Check if browser was launched by Playwright
61
+ */
62
+ isPlaywrightManaged(): boolean;
63
+ /**
64
+ * Get current connection
65
+ */
66
+ getConnection(): ChromeConnection;
67
+ /**
68
+ * Check if connected
69
+ */
70
+ isConnected(): boolean;
71
+ /**
72
+ * List all open tabs and targets (including service workers)
73
+ */
74
+ listTabs(): Promise<TabInfo[]>;
75
+ /**
76
+ * Get active tab
77
+ */
78
+ getActiveTab(): Promise<TabInfo | null>;
79
+ /**
80
+ * Create new tab
81
+ */
82
+ createTab(url?: string): Promise<TabInfo>;
83
+ /**
84
+ * Close tab
85
+ */
86
+ closeTab(tabId: string): Promise<void>;
87
+ /**
88
+ * Activate tab
89
+ */
90
+ activateTab(tabId: string): Promise<void>;
91
+ /**
92
+ * Get CDP client for specific tab
93
+ */
94
+ getTabClient(tabId?: string): Promise<any>;
95
+ /**
96
+ * Execute CDP command
97
+ */
98
+ executeCommand(domain: string, method: string, params?: any): Promise<any>;
99
+ /**
100
+ * Get Chrome version info
101
+ */
102
+ getVersion(): Promise<any>;
103
+ /**
104
+ * Get current port
105
+ */
106
+ getPort(): number;
107
+ /**
108
+ * Set current tab
109
+ */
110
+ setCurrentTab(tabId: string): void;
111
+ /**
112
+ * Get current tab ID
113
+ */
114
+ getCurrentTabId(): string | null;
115
+ }
116
+ //# sourceMappingURL=chrome-connector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome-connector.d.ts","sourceRoot":"","sources":["../src/chrome-connector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAA0B,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AASzE,MAAM,WAAW,gBAAgB;IAC/B,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EG;IACG,SAAS,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAe/C;;OAEG;IACG,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ5C;;OAEG;IACG,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAS/C;;OAEG;IACG,YAAY,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBhD;;OAEG;IACG,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAWhF;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC;IAShC;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;OAEG;IACH,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIlC;;OAEG;IACH,eAAe,IAAI,MAAM,GAAG,IAAI;CAGjC"}
@@ -0,0 +1,452 @@
1
+ /**
2
+ * Chrome Connection Manager
3
+ * Handles connection to existing Chrome instance via CDP
4
+ * Now with Playwright support for launching browser
5
+ */
6
+ import CDP from 'chrome-remote-interface';
7
+ import { chromium } from 'playwright';
8
+ import { spawn, exec } from 'child_process';
9
+ import * as fs from 'fs';
10
+ import * as path from 'path';
11
+ import * as os from 'os';
12
+ import { promisify } from 'util';
13
+ const execAsync = promisify(exec);
14
+ export class ChromeConnector {
15
+ connection = null;
16
+ port;
17
+ currentTabId = null;
18
+ browserContext = null;
19
+ chromeProcess = null;
20
+ constructor(port = 9222) {
21
+ this.port = port;
22
+ }
23
+ /**
24
+ * Get platform-specific Chrome paths
25
+ */
26
+ getPlatformPaths() {
27
+ const platform = os.platform();
28
+ switch (platform) {
29
+ case 'win32':
30
+ return {
31
+ executable: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe',
32
+ userDataDir: `${process.env.LOCALAPPDATA}\\Google\\Chrome\\User Data`
33
+ };
34
+ case 'darwin':
35
+ return {
36
+ executable: '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome',
37
+ userDataDir: `${process.env.HOME}/Library/Application Support/Google/Chrome`
38
+ };
39
+ case 'linux':
40
+ return {
41
+ executable: '/usr/bin/google-chrome',
42
+ userDataDir: `${process.env.HOME}/.config/google-chrome`
43
+ };
44
+ default:
45
+ throw new Error(`Unsupported platform: ${platform}`);
46
+ }
47
+ }
48
+ /**
49
+ * createShadowProfile: Clones essential parts of the profile to a temp dir
50
+ * to bypass Chrome's restriction on debugging the Default profile.
51
+ * Cross-platform: uses robocopy on Windows, rsync on Unix systems.
52
+ */
53
+ async createShadowProfile(sourceUserData, profileName) {
54
+ const tempDir = path.join(os.tmpdir(), 'chrome-mcp-shadow');
55
+ const platform = os.platform();
56
+ // Ensure parent dir exists
57
+ if (!fs.existsSync(tempDir)) {
58
+ fs.mkdirSync(tempDir, { recursive: true });
59
+ }
60
+ console.error(`👥 Creating Shadow Profile structure at: ${tempDir}`);
61
+ console.error(` Platform: ${platform}`);
62
+ console.error(` Source: ${sourceUserData}`);
63
+ // 1. Copy Local State (critical for encryption keys + profiles list)
64
+ const localStateSrc = path.join(sourceUserData, 'Local State');
65
+ const localStateDest = path.join(tempDir, 'Local State');
66
+ try {
67
+ if (fs.existsSync(localStateSrc)) {
68
+ fs.copyFileSync(localStateSrc, localStateDest);
69
+ }
70
+ }
71
+ catch (e) {
72
+ console.error('Warning: could not copy Local State', e);
73
+ }
74
+ // 2. Copy the profile folder (platform-specific)
75
+ const profileSrc = path.join(sourceUserData, profileName);
76
+ const profileDest = path.join(tempDir, profileName);
77
+ // Exclude heavy cache folders to make launch fast
78
+ const excludeDirs = [
79
+ "Cache",
80
+ "Code Cache",
81
+ "GPUCache",
82
+ "DawnCache",
83
+ "ShaderCache",
84
+ "Safe Browsing",
85
+ "File System",
86
+ "Service Worker/CacheStorage",
87
+ "Service Worker/ScriptCache"
88
+ ];
89
+ let cmd;
90
+ if (platform === 'win32') {
91
+ // Windows: use robocopy
92
+ const xdParams = excludeDirs.map(d => `"${d}"`).join(' ');
93
+ // /MIR = Mirror, /XD = Exclude Dirs, /R:0 /W:0 = No retries, /XJ = No junctions, /MT = Multi-thread
94
+ cmd = `robocopy "${profileSrc}" "${profileDest}" /MIR /XD ${xdParams} /R:0 /W:0 /XJ /MT:16`;
95
+ try {
96
+ await execAsync(cmd);
97
+ }
98
+ catch (e) {
99
+ // Robocopy exit codes: 0-7 are success/partial, 8+ is failure
100
+ if (e.code > 7) {
101
+ console.error('⚠️ Shadow Profile copy had errors:', e.message);
102
+ }
103
+ }
104
+ }
105
+ else {
106
+ // Unix (Mac/Linux): use rsync
107
+ const excludeParams = excludeDirs.map(d => `--exclude="${d}"`).join(' ');
108
+ cmd = `rsync -av --delete ${excludeParams} "${profileSrc}/" "${profileDest}/"`;
109
+ try {
110
+ await execAsync(cmd);
111
+ console.error('✅ Profile copied via rsync');
112
+ }
113
+ catch (e) {
114
+ console.error('⚠️ Shadow Profile copy had errors:', e.message);
115
+ }
116
+ }
117
+ return tempDir;
118
+ }
119
+ /**
120
+ * Launch Chrome manually using child_process to avoid blocking and argument issues
121
+ * This is more robust for persistent profiles than Playwright's launcher
122
+ */
123
+ async launchWithProfile(options = {}) {
124
+ // 1. Check connections
125
+ if (this.connection?.connected) {
126
+ console.error('✅ Already connected to a Chrome instance.');
127
+ return;
128
+ }
129
+ try {
130
+ // Check if port is open
131
+ await this.connect();
132
+ console.error(`✅ Detected and connected to existing Chrome on port ${this.port}`);
133
+ return;
134
+ }
135
+ catch (e) {
136
+ // Port free, proceed
137
+ }
138
+ const platformPaths = this.getPlatformPaths();
139
+ let { userDataDir, profileDirectory = 'Default', executablePath = platformPaths.executable } = options;
140
+ const originalUserDataDir = userDataDir || platformPaths.userDataDir;
141
+ // Default to the original unless shadowed
142
+ let finalUserDataDir = originalUserDataDir;
143
+ // 2. Handle Shadow Profile Logic
144
+ // If identifying as Default profile, we MUST clone it to avoid debug lock
145
+ // ONLY IF we are not already pointing to a custom dir (userDataDir was null/undefined originally)
146
+ if (profileDirectory === 'Default' && !userDataDir) {
147
+ try {
148
+ console.error("🔒 Default profile requested. Creating Shadow Copy to enable debugging...");
149
+ finalUserDataDir = await this.createShadowProfile(originalUserDataDir, profileDirectory);
150
+ }
151
+ catch (err) {
152
+ console.error("❌ Failed to create shadow profile, attempting raw launch (may fail):", err);
153
+ finalUserDataDir = originalUserDataDir;
154
+ }
155
+ }
156
+ console.error(`🚀 Launching Chrome Native...`);
157
+ console.error(` User Data: ${finalUserDataDir}`);
158
+ console.error(` Profile: ${profileDirectory}`);
159
+ const args = [
160
+ `--remote-debugging-port=${this.port}`,
161
+ `--user-data-dir=${finalUserDataDir}`,
162
+ `--profile-directory=${profileDirectory}`,
163
+ '--remote-allow-origins=*',
164
+ '--no-first-run',
165
+ '--no-default-browser-check',
166
+ '--disable-blink-features=AutomationControlled',
167
+ '--disable-infobars',
168
+ '--exclude-switches=enable-automation',
169
+ '--use-mock-keychain',
170
+ '--password-store=basic'
171
+ ];
172
+ console.error(` Args: ${JSON.stringify(args)}`);
173
+ // Spawn completely detached process to prevent MCP hang
174
+ // Using 'pipe' for stderr to capture launch errors if any
175
+ this.chromeProcess = spawn(executablePath, args, {
176
+ detached: true,
177
+ stdio: ['ignore', 'ignore', 'pipe'],
178
+ windowsHide: false
179
+ });
180
+ let startupLogs = '';
181
+ if (this.chromeProcess.stderr) {
182
+ this.chromeProcess.stderr.on('data', (data) => {
183
+ startupLogs += data.toString();
184
+ console.error(`Chrome Err: ${data.toString()}`);
185
+ });
186
+ }
187
+ const processExited = new Promise((_, reject) => {
188
+ this.chromeProcess?.on('exit', (code) => {
189
+ if (code !== 0) {
190
+ reject(new Error(`Chrome process exited immediately with code ${code}. Logs: ${startupLogs}`));
191
+ }
192
+ });
193
+ this.chromeProcess?.on('error', (err) => {
194
+ reject(new Error(`Failed to spawn Chrome process: ${err.message}`));
195
+ });
196
+ });
197
+ // Race condition: wait for 3s OR for the process to exit
198
+ // Increased timeout to 5s for heavy profiles
199
+ const timeout = new Promise(resolve => setTimeout(resolve, 5000));
200
+ // Wait for either timeout (success) or exit (failure)
201
+ try {
202
+ await Promise.race([timeout, processExited]);
203
+ }
204
+ catch (e) {
205
+ this.chromeProcess = null;
206
+ throw e;
207
+ }
208
+ // If we got here, process didn't crash in the first 5 seconds
209
+ this.chromeProcess.unref();
210
+ if (this.chromeProcess.stderr) {
211
+ this.chromeProcess.stderr.destroy();
212
+ }
213
+ console.error(`✅ Chrome process spawned and stable (PID: ${this.chromeProcess.pid})`);
214
+ // Connect to CDP with retries
215
+ let connected = false;
216
+ for (let i = 0; i < 5; i++) {
217
+ try {
218
+ await this.connect();
219
+ connected = true;
220
+ break;
221
+ }
222
+ catch (e) {
223
+ console.error(`Starting CDP connection attempt ${i + 1}/5 failed. Retrying...`);
224
+ await new Promise(r => setTimeout(r, 1000));
225
+ }
226
+ }
227
+ if (!connected) {
228
+ throw new Error(`Chrome launched (PID ${this.chromeProcess.pid}) but port ${this.port} is not accessible after 10s. Logs: ${startupLogs}`);
229
+ }
230
+ // VERIFICATION: Check if we can actually list targets (proves browser is responsive)
231
+ try {
232
+ const targets = await this.listTabs();
233
+ console.error(`✅ Verification: Found ${targets.length} targets.`);
234
+ if (targets.length === 0) {
235
+ console.error('⚠️ Warning: Browser running but no targets found.');
236
+ }
237
+ }
238
+ catch (verErr) {
239
+ console.error('⚠️ Warning: Could not verify targets listing:', verErr);
240
+ }
241
+ // Optional: Try to attach Playwright over CDP for advanced features if needed
242
+ try {
243
+ const browser = await chromium.connectOverCDP(`http://localhost:${this.port}`);
244
+ // When connecting over CDP to a persistent profile, the default context is the first one
245
+ this.browserContext = browser.contexts()[0];
246
+ console.error('✅ Playwright wrapper connected over CDP');
247
+ }
248
+ catch (pwError) {
249
+ console.error('⚠️ Could not attach Playwright wrapper (CDP still works):', pwError.message);
250
+ }
251
+ }
252
+ /**
253
+ * Disconnect from Chrome and close Playwright browser
254
+ */
255
+ async disconnect() {
256
+ if (this.connection?.client) {
257
+ await this.connection.client.close();
258
+ this.connection = null;
259
+ console.error('Disconnected from Chrome CDP');
260
+ }
261
+ if (this.browserContext) {
262
+ await this.browserContext.close();
263
+ this.browserContext = null;
264
+ console.error('Closed Playwright context');
265
+ }
266
+ if (this.chromeProcess) {
267
+ // optional: kill process? usually we just disconnect
268
+ // this.chromeProcess.kill();
269
+ this.chromeProcess = null;
270
+ }
271
+ }
272
+ /**
273
+ * Connect to existing Chrome instance
274
+ */
275
+ async connect() {
276
+ try {
277
+ const client = await CDP({ port: this.port });
278
+ this.connection = {
279
+ client,
280
+ connected: true,
281
+ port: this.port
282
+ };
283
+ console.error(`✅ Connected to Chrome on port ${this.port}`);
284
+ }
285
+ catch (error) {
286
+ const err = error;
287
+ throw new Error(`Failed to connect to Chrome on port ${this.port}. ` +
288
+ `Make sure Chrome is running with --remote-debugging-port=${this.port}\n` +
289
+ `Error: ${err.message}`);
290
+ }
291
+ }
292
+ /**
293
+ * Get Playwright browser context
294
+ */
295
+ getBrowserContext() {
296
+ return this.browserContext;
297
+ }
298
+ /**
299
+ * Check if browser was launched by Playwright
300
+ */
301
+ isPlaywrightManaged() {
302
+ return this.browserContext !== null;
303
+ }
304
+ /**
305
+ * Get current connection
306
+ */
307
+ getConnection() {
308
+ if (!this.connection?.connected) {
309
+ throw new Error('Not connected to Chrome. Call connect() first.');
310
+ }
311
+ return this.connection;
312
+ }
313
+ /**
314
+ * Check if connected
315
+ */
316
+ isConnected() {
317
+ return this.connection?.connected ?? false;
318
+ }
319
+ /**
320
+ * List all open tabs and targets (including service workers)
321
+ */
322
+ async listTabs() {
323
+ try {
324
+ const targets = await CDP.List({ port: this.port });
325
+ // Return interesting targets (pages, service workers, extensions)
326
+ // Removed strict 'page' filter to allow finding service workers as requested
327
+ return targets
328
+ .filter((t) => t.type === 'page' || t.type === 'service_worker' || t.type === 'background_page' || t.type === 'other')
329
+ .map((t) => ({
330
+ id: t.id,
331
+ type: t.type,
332
+ title: t.title || t.url || 'Untitled', // Service workers might not have title
333
+ url: t.url,
334
+ description: t.description
335
+ }));
336
+ }
337
+ catch (error) {
338
+ throw new Error(`Failed to list tabs: ${error.message}`);
339
+ }
340
+ }
341
+ /**
342
+ * Get active tab
343
+ */
344
+ async getActiveTab() {
345
+ const tabs = await this.listTabs();
346
+ return tabs.length > 0 ? tabs[0] : null;
347
+ }
348
+ /**
349
+ * Create new tab
350
+ */
351
+ async createTab(url) {
352
+ try {
353
+ const newTab = await CDP.New({ port: this.port, url });
354
+ return {
355
+ id: newTab.id,
356
+ type: newTab.type,
357
+ title: newTab.title || '',
358
+ url: newTab.url || url || 'about:blank'
359
+ };
360
+ }
361
+ catch (error) {
362
+ throw new Error(`Failed to create tab: ${error.message}`);
363
+ }
364
+ }
365
+ /**
366
+ * Close tab
367
+ */
368
+ async closeTab(tabId) {
369
+ try {
370
+ await CDP.Close({ port: this.port, id: tabId });
371
+ }
372
+ catch (error) {
373
+ throw new Error(`Failed to close tab: ${error.message}`);
374
+ }
375
+ }
376
+ /**
377
+ * Activate tab
378
+ */
379
+ async activateTab(tabId) {
380
+ try {
381
+ await CDP.Activate({ port: this.port, id: tabId });
382
+ this.currentTabId = tabId;
383
+ }
384
+ catch (error) {
385
+ throw new Error(`Failed to activate tab: ${error.message}`);
386
+ }
387
+ }
388
+ /**
389
+ * Get CDP client for specific tab
390
+ */
391
+ async getTabClient(tabId) {
392
+ try {
393
+ const target = tabId || this.currentTabId;
394
+ if (!target) {
395
+ // Get the first available tab
396
+ const tabs = await this.listTabs();
397
+ if (tabs.length === 0) {
398
+ throw new Error('No tabs available');
399
+ }
400
+ return await CDP({ port: this.port, target: tabs[0].id });
401
+ }
402
+ return await CDP({ port: this.port, target });
403
+ }
404
+ catch (error) {
405
+ throw new Error(`Failed to get tab client: ${error.message}`);
406
+ }
407
+ }
408
+ /**
409
+ * Execute CDP command
410
+ */
411
+ async executeCommand(domain, method, params) {
412
+ const client = this.getConnection().client;
413
+ try {
414
+ const result = await client.send(`${domain}.${method}`, params);
415
+ return result;
416
+ }
417
+ catch (error) {
418
+ throw new Error(`CDP command failed: ${domain}.${method} - ${error.message}`);
419
+ }
420
+ }
421
+ /**
422
+ * Get Chrome version info
423
+ */
424
+ async getVersion() {
425
+ try {
426
+ const version = await CDP.Version({ port: this.port });
427
+ return version;
428
+ }
429
+ catch (error) {
430
+ throw new Error(`Failed to get Chrome version: ${error.message}`);
431
+ }
432
+ }
433
+ /**
434
+ * Get current port
435
+ */
436
+ getPort() {
437
+ return this.port;
438
+ }
439
+ /**
440
+ * Set current tab
441
+ */
442
+ setCurrentTab(tabId) {
443
+ this.currentTabId = tabId;
444
+ }
445
+ /**
446
+ * Get current tab ID
447
+ */
448
+ getCurrentTabId() {
449
+ return this.currentTabId;
450
+ }
451
+ }
452
+ //# sourceMappingURL=chrome-connector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome-connector.js","sourceRoot":"","sources":["../src/chrome-connector.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,GAAG,MAAM,yBAAyB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAqC,MAAM,YAAY,CAAC;AACzE,OAAO,EAAE,KAAK,EAAqB,IAAI,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAEjC,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAuBlC,MAAM,OAAO,eAAe;IAClB,UAAU,GAA4B,IAAI,CAAC;IAC3C,IAAI,CAAS;IACb,YAAY,GAAkB,IAAI,CAAC;IACnC,cAAc,GAA0B,IAAI,CAAC;IAC7C,aAAa,GAAw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OAEG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACH,aAAa,CAAC,KAAa;QACzB,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;IAC5B,CAAC;IAED;;OAEG;IACH,eAAe;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Custom Chrome MCP Server
4
+ * Main entry point for the MCP server
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG"}