@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
package/dist/index.js ADDED
@@ -0,0 +1,211 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Custom Chrome MCP Server
4
+ * Main entry point for the MCP server
5
+ */
6
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
7
+ import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
8
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
9
+ import { ChromeConnector } from './chrome-connector.js';
10
+ import { createNavigationTools } from './tools/navigation.js';
11
+ import { createInteractionTools } from './tools/interaction.js';
12
+ import { createAntiDetectionTools } from './tools/anti-detection.js';
13
+ import { createServiceWorkerTools } from './tools/service-worker.js';
14
+ import { createCaptureTools } from './tools/capture.js';
15
+ import { createSessionTools } from './tools/session.js';
16
+ import { createSystemTools } from './tools/system.js';
17
+ import { createPlaywrightLauncherTools } from './tools/playwright-launcher.js';
18
+ // Parse command line arguments
19
+ const args = process.argv.slice(2);
20
+ const portArg = args.find(arg => arg.startsWith('--port='));
21
+ const PORT = portArg ? parseInt(portArg.split('=')[1]) : 9222;
22
+ // Initialize Chrome connector
23
+ const connector = new ChromeConnector(PORT);
24
+ // Create MCP server
25
+ const server = new Server({
26
+ name: 'custom-chrome-mcp',
27
+ version: '1.0.0',
28
+ }, {
29
+ capabilities: {
30
+ tools: {},
31
+ },
32
+ });
33
+ // Collect all tools
34
+ const allTools = [
35
+ ...createPlaywrightLauncherTools(connector), // Playwright tools first (recommended)
36
+ ...createNavigationTools(connector),
37
+ ...createInteractionTools(connector),
38
+ ...createAntiDetectionTools(connector),
39
+ ...createServiceWorkerTools(connector),
40
+ ...createCaptureTools(connector),
41
+ ...createSessionTools(connector),
42
+ ...createSystemTools(connector),
43
+ ];
44
+ // Create tool map for quick lookup
45
+ const toolMap = new Map(allTools.map(tool => [tool.name, tool]));
46
+ // Helper to convert Zod schema to JSON Schema property
47
+ function zodTypeToJsonSchema(schema) {
48
+ if (!schema)
49
+ return { type: 'string' };
50
+ let current = schema;
51
+ let isOptional = false;
52
+ // Unwrap Optional/Default wrappers
53
+ while (current._def.typeName === 'ZodOptional' || current._def.typeName === 'ZodDefault') {
54
+ if (current._def.typeName === 'ZodOptional')
55
+ isOptional = true;
56
+ current = current._def.innerType;
57
+ }
58
+ const def = current._def;
59
+ let type = 'string'; // Default fallback
60
+ const jsonSchema = {};
61
+ if (current.description) {
62
+ jsonSchema.description = current.description;
63
+ }
64
+ switch (def.typeName) {
65
+ case 'ZodString':
66
+ type = 'string';
67
+ break;
68
+ case 'ZodNumber':
69
+ type = 'number';
70
+ break;
71
+ case 'ZodBoolean':
72
+ type = 'boolean';
73
+ break;
74
+ case 'ZodEnum':
75
+ type = 'string';
76
+ jsonSchema.enum = def.values;
77
+ break;
78
+ }
79
+ jsonSchema.type = type;
80
+ return jsonSchema;
81
+ }
82
+ // Handle tool listing
83
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
84
+ return {
85
+ tools: allTools.map(tool => {
86
+ // Cast to any to access Zod shape
87
+ const shape = tool.inputSchema.shape;
88
+ const properties = {};
89
+ const required = [];
90
+ if (shape) {
91
+ for (const key in shape) {
92
+ const zodSchema = shape[key];
93
+ properties[key] = zodTypeToJsonSchema(zodSchema);
94
+ // Check if required
95
+ let isOptional = false;
96
+ let current = zodSchema;
97
+ while (current._def.typeName === 'ZodOptional' || current._def.typeName === 'ZodDefault') {
98
+ if (current._def.typeName === 'ZodOptional')
99
+ isOptional = true;
100
+ current = current._def.innerType;
101
+ }
102
+ if (!isOptional) {
103
+ required.push(key);
104
+ }
105
+ }
106
+ }
107
+ return {
108
+ name: tool.name,
109
+ description: tool.description,
110
+ inputSchema: {
111
+ type: 'object',
112
+ properties,
113
+ required,
114
+ },
115
+ };
116
+ }),
117
+ };
118
+ });
119
+ // Handle tool execution
120
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
121
+ const { name, arguments: args } = request.params;
122
+ const tool = toolMap.get(name);
123
+ if (!tool) {
124
+ throw new Error(`Unknown tool: ${name}`);
125
+ }
126
+ try {
127
+ // Validate arguments with Zod
128
+ const validatedArgs = tool.inputSchema.parse(args || {});
129
+ // Execute tool handler
130
+ const result = await tool.handler(validatedArgs);
131
+ return {
132
+ content: [
133
+ {
134
+ type: 'text',
135
+ text: JSON.stringify(result, null, 2),
136
+ },
137
+ ],
138
+ };
139
+ }
140
+ catch (error) {
141
+ const err = error;
142
+ // Return error in a structured format
143
+ return {
144
+ content: [
145
+ {
146
+ type: 'text',
147
+ text: JSON.stringify({
148
+ success: false,
149
+ error: err.message,
150
+ tool: name,
151
+ }, null, 2),
152
+ },
153
+ ],
154
+ isError: true,
155
+ };
156
+ }
157
+ });
158
+ // Start server
159
+ async function main() {
160
+ console.error('🚀 Custom Chrome MCP Server starting...');
161
+ console.error(`📡 CDP Port: ${PORT}`);
162
+ console.error('');
163
+ console.error('🎭 Playwright Integration Active!');
164
+ console.error(' Use "launch_chrome_with_profile" to start Chrome with your profile');
165
+ console.error(' This keeps all cookies, sessions, and extensions intact');
166
+ console.error('');
167
+ try {
168
+ console.error('🔧 Tools available:', allTools.length);
169
+ console.error('');
170
+ console.error('Tool categories:');
171
+ console.error(' - 🎭 Playwright Launcher (4 tools) - NEW!');
172
+ console.error(' - Navigation & Tabs (8 tools)');
173
+ console.error(' - Page Interaction (8 tools)');
174
+ console.error(' - Anti-Detection (5 tools)');
175
+ console.error(' - Service Workers (9 tools)');
176
+ console.error(' - Capture & Export (5 tools)');
177
+ console.error(' - Session & Cookies (9 tools)');
178
+ console.error(' - System & Extensions (4 tools)');
179
+ console.error('');
180
+ console.error('✨ Server ready! Use launch_chrome_with_profile to start...');
181
+ // Start MCP server with stdio transport
182
+ const transport = new StdioServerTransport();
183
+ await server.connect(transport);
184
+ }
185
+ catch (error) {
186
+ const err = error;
187
+ console.error('❌ Failed to start server:', err.message);
188
+ console.error('');
189
+ console.error('💡 Server started but not connected to Chrome.');
190
+ console.error(' Use "launch_chrome_with_profile" tool to start Chrome with Playwright');
191
+ console.error('');
192
+ process.exit(1);
193
+ }
194
+ }
195
+ // Handle shutdown gracefully
196
+ process.on('SIGINT', async () => {
197
+ console.error('\n🛑 Shutting down server...');
198
+ await connector.disconnect();
199
+ process.exit(0);
200
+ });
201
+ process.on('SIGTERM', async () => {
202
+ console.error('\n🛑 Shutting down server...');
203
+ await connector.disconnect();
204
+ process.exit(0);
205
+ });
206
+ // Run server
207
+ main().catch(error => {
208
+ console.error('Fatal error:', error);
209
+ process.exit(1);
210
+ });
211
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,wBAAwB,EAAE,MAAM,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C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,KAAc,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,2BAA2B,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;QACxD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAChE,OAAO,CAAC,KAAK,CAAC,0EAA0E,CAAC,CAAC;QAC1F,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,6BAA6B;AAC7B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,IAAI,EAAE;IAC9B,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC9C,MAAM,SAAS,CAAC,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;IAC/B,OAAO,CAAC,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAC9C,MAAM,SAAS,CAAC,UAAU,EAAE,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,aAAa;AACb,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Anti-Detection Tools
3
+ * Helps evade bot detection mechanisms
4
+ */
5
+ import { z } from 'zod';
6
+ import type { ChromeConnector } from '../chrome-connector.js';
7
+ export declare function createAntiDetectionTools(connector: ChromeConnector): {
8
+ name: string;
9
+ description: string;
10
+ inputSchema: z.ZodObject<{
11
+ tabId: z.ZodOptional<z.ZodString>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ tabId?: string | undefined;
14
+ }, {
15
+ tabId?: string | undefined;
16
+ }>;
17
+ handler: ({ tabId }: any) => Promise<{
18
+ success: boolean;
19
+ message: string;
20
+ }>;
21
+ }[];
22
+ //# sourceMappingURL=anti-detection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anti-detection.d.ts","sourceRoot":"","sources":["../../src/tools/anti-detection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,eAAe;;;;;;;;;;yBASlC,GAAG;;;;IA+NnC"}
@@ -0,0 +1,220 @@
1
+ /**
2
+ * Anti-Detection Tools
3
+ * Helps evade bot detection mechanisms
4
+ */
5
+ import { z } from 'zod';
6
+ export function createAntiDetectionTools(connector) {
7
+ return [
8
+ // Apply stealth mode
9
+ {
10
+ name: 'enable_stealth_mode',
11
+ description: 'Apply anti-detection measures to make automation less detectable',
12
+ inputSchema: z.object({
13
+ tabId: z.string().optional().describe('Tab ID (optional)')
14
+ }),
15
+ handler: async ({ tabId }) => {
16
+ const client = await connector.getTabClient(tabId);
17
+ const { Runtime, Page } = client;
18
+ await Runtime.enable();
19
+ await Page.enable();
20
+ // Inject anti-detection scripts
21
+ const stealthScript = `
22
+ // Override navigator.webdriver
23
+ Object.defineProperty(navigator, 'webdriver', {
24
+ get: () => undefined
25
+ });
26
+
27
+ // Override plugins
28
+ Object.defineProperty(navigator, 'plugins', {
29
+ get: () => [
30
+ {
31
+ 0: { type: "application/x-google-chrome-pdf", suffixes: "pdf", description: "Portable Document Format" },
32
+ description: "Portable Document Format",
33
+ filename: "internal-pdf-viewer",
34
+ length: 1,
35
+ name: "Chrome PDF Plugin"
36
+ },
37
+ {
38
+ 0: { type: "application/pdf", suffixes: "pdf", description: "Portable Document Format" },
39
+ description: "Portable Document Format",
40
+ filename: "mhjfbmdgcfjbbpaeojofohoefgiehjai",
41
+ length: 1,
42
+ name: "Chrome PDF Viewer"
43
+ },
44
+ {
45
+ 0: { type: "application/x-nacl", suffixes: "", description: "Native Client Executable" },
46
+ 1: { type: "application/x-pnacl", suffixes: "", description: "Portable Native Client Executable" },
47
+ description: "",
48
+ filename: "internal-nacl-plugin",
49
+ length: 2,
50
+ name: "Native Client"
51
+ }
52
+ ]
53
+ });
54
+
55
+ // Override permissions
56
+ const originalQuery = window.navigator.permissions.query;
57
+ window.navigator.permissions.query = (parameters) => (
58
+ parameters.name === 'notifications' ?
59
+ Promise.resolve({ state: Notification.permission }) :
60
+ originalQuery(parameters)
61
+ );
62
+
63
+ // Override chrome runtime
64
+ if (!window.chrome) {
65
+ window.chrome = {};
66
+ }
67
+
68
+ if (!window.chrome.runtime) {
69
+ window.chrome.runtime = {};
70
+ }
71
+
72
+ // Add realistic properties
73
+ Object.defineProperty(navigator, 'languages', {
74
+ get: () => ['en-US', 'en']
75
+ });
76
+
77
+ Object.defineProperty(navigator, 'platform', {
78
+ get: () => 'Win32'
79
+ });
80
+
81
+ // Override toString methods
82
+ const originalToString = Function.prototype.toString;
83
+ Function.prototype.toString = function() {
84
+ if (this === window.navigator.permissions.query) {
85
+ return 'function query() { [native code] }';
86
+ }
87
+ return originalToString.call(this);
88
+ };
89
+
90
+ // Add realistic screen properties
91
+ Object.defineProperty(screen, 'availWidth', {
92
+ get: () => window.screen.width
93
+ });
94
+
95
+ Object.defineProperty(screen, 'availHeight', {
96
+ get: () => window.screen.height - 40
97
+ });
98
+
99
+ // Spoof timezone
100
+ Date.prototype.getTimezoneOffset = function() {
101
+ return 300; // EST timezone
102
+ };
103
+
104
+ console.log('✅ Stealth mode enabled');
105
+ `;
106
+ await Page.addScriptToEvaluateOnNewDocument({
107
+ source: stealthScript
108
+ });
109
+ // Also apply to current page
110
+ await Runtime.evaluate({
111
+ expression: stealthScript
112
+ });
113
+ return {
114
+ success: true,
115
+ message: 'Stealth mode enabled - navigator.webdriver hidden, plugins spoofed, and other anti-detection measures applied'
116
+ };
117
+ }
118
+ },
119
+ // Randomize user agent
120
+ {
121
+ name: 'set_user_agent',
122
+ description: 'Set a custom user agent string',
123
+ inputSchema: z.object({
124
+ userAgent: z.string().optional().describe('Custom user agent (optional, uses realistic default if not provided)'),
125
+ tabId: z.string().optional().describe('Tab ID (optional)')
126
+ }),
127
+ handler: async ({ userAgent, tabId }) => {
128
+ const client = await connector.getTabClient(tabId);
129
+ const { Network } = client;
130
+ await Network.enable();
131
+ const ua = userAgent ||
132
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36';
133
+ await Network.setUserAgentOverride({
134
+ userAgent: ua,
135
+ acceptLanguage: 'en-US,en;q=0.9',
136
+ platform: 'Win32'
137
+ });
138
+ return {
139
+ success: true,
140
+ userAgent: ua,
141
+ message: 'User agent updated'
142
+ };
143
+ }
144
+ },
145
+ // Set viewport
146
+ {
147
+ name: 'set_viewport',
148
+ description: 'Set browser viewport size',
149
+ inputSchema: z.object({
150
+ width: z.number().describe('Viewport width'),
151
+ height: z.number().describe('Viewport height'),
152
+ deviceScaleFactor: z.number().optional().default(1).describe('Device scale factor'),
153
+ mobile: z.boolean().optional().default(false).describe('Emulate mobile device'),
154
+ tabId: z.string().optional().describe('Tab ID (optional)')
155
+ }),
156
+ handler: async ({ width, height, deviceScaleFactor, mobile, tabId }) => {
157
+ const client = await connector.getTabClient(tabId);
158
+ const { Emulation } = client;
159
+ await Emulation.setDeviceMetricsOverride({
160
+ width,
161
+ height,
162
+ deviceScaleFactor,
163
+ mobile
164
+ });
165
+ return {
166
+ success: true,
167
+ viewport: { width, height, deviceScaleFactor, mobile },
168
+ message: `Viewport set to ${width}x${height}`
169
+ };
170
+ }
171
+ },
172
+ // Emulate geolocation
173
+ {
174
+ name: 'set_geolocation',
175
+ description: 'Set geolocation coordinates',
176
+ inputSchema: z.object({
177
+ latitude: z.number().describe('Latitude'),
178
+ longitude: z.number().describe('Longitude'),
179
+ accuracy: z.number().optional().default(100).describe('Accuracy in meters'),
180
+ tabId: z.string().optional().describe('Tab ID (optional)')
181
+ }),
182
+ handler: async ({ latitude, longitude, accuracy, tabId }) => {
183
+ const client = await connector.getTabClient(tabId);
184
+ const { Emulation } = client;
185
+ await Emulation.setGeolocationOverride({
186
+ latitude,
187
+ longitude,
188
+ accuracy
189
+ });
190
+ return {
191
+ success: true,
192
+ location: { latitude, longitude, accuracy },
193
+ message: `Geolocation set to ${latitude}, ${longitude}`
194
+ };
195
+ }
196
+ },
197
+ // Set timezone
198
+ {
199
+ name: 'set_timezone',
200
+ description: 'Set timezone for the browser',
201
+ inputSchema: z.object({
202
+ timezoneId: z.string().describe('Timezone ID (e.g., "America/New_York")'),
203
+ tabId: z.string().optional().describe('Tab ID (optional)')
204
+ }),
205
+ handler: async ({ timezoneId, tabId }) => {
206
+ const client = await connector.getTabClient(tabId);
207
+ const { Emulation } = client;
208
+ await Emulation.setTimezoneOverride({
209
+ timezoneId
210
+ });
211
+ return {
212
+ success: true,
213
+ timezone: timezoneId,
214
+ message: `Timezone set to ${timezoneId}`
215
+ };
216
+ }
217
+ }
218
+ ];
219
+ }
220
+ //# sourceMappingURL=anti-detection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"anti-detection.js","sourceRoot":"","sources":["../../src/tools/anti-detection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,UAAU,wBAAwB,CAAC,SAA0B;IACjE,OAAO;QACL,qBAAqB;QACrB;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,kEAAkE;YAC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SAAS;oBACT,QAAQ;iBACT,CAAC,CAAC;gBAEH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE;oBAC3C,OAAO,EAAE,sBAAsB,QAAQ,KAAK,SAAS,EAAE;iBACxD,CAAC;YACJ,CAAC;SACF;QAED,eAAe;QACf;YACE,IAAI,EAAE,cAAc;YACpB,WAAW,EAAE,8BAA8B;YAC3C,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;gBACpB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;gBACzE,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;aAC3D,CAAC;YACF,OAAO,EAAE,KAAK,EAAE,EAAE,UAAU,EAAE,KAAK,EAAO,EAAE,EAAE;gBAC5C,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACnD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;gBAE7B,MAAM,SAAS,CAAC,mBAAmB,CAAC;oBAClC,UAAU;iBACX,CAAC,CAAC;gBAEH,OAAO;oBACL,OAAO,EAAE,IAAI;oBACb,QAAQ,EAAE,UAAU;oBACpB,OAAO,EAAE,mBAAmB,UAAU,EAAE;iBACzC,CAAC;YACJ,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,130 @@
1
+ /**
2
+ * Screenshot and Page Capture Tools
3
+ */
4
+ import { z } from 'zod';
5
+ import type { ChromeConnector } from '../chrome-connector.js';
6
+ export declare function createCaptureTools(connector: ChromeConnector): ({
7
+ name: string;
8
+ description: string;
9
+ inputSchema: z.ZodObject<{
10
+ format: z.ZodDefault<z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>>;
11
+ quality: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
12
+ fullPage: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
13
+ clipX: z.ZodOptional<z.ZodNumber>;
14
+ clipY: z.ZodOptional<z.ZodNumber>;
15
+ clipWidth: z.ZodOptional<z.ZodNumber>;
16
+ clipHeight: z.ZodOptional<z.ZodNumber>;
17
+ tabId: z.ZodOptional<z.ZodString>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ format: "png" | "jpeg";
20
+ quality: number;
21
+ fullPage: boolean;
22
+ tabId?: string | undefined;
23
+ clipX?: number | undefined;
24
+ clipY?: number | undefined;
25
+ clipWidth?: number | undefined;
26
+ clipHeight?: number | undefined;
27
+ }, {
28
+ tabId?: string | undefined;
29
+ format?: "png" | "jpeg" | undefined;
30
+ quality?: number | undefined;
31
+ fullPage?: boolean | undefined;
32
+ clipX?: number | undefined;
33
+ clipY?: number | undefined;
34
+ clipWidth?: number | undefined;
35
+ clipHeight?: number | undefined;
36
+ }>;
37
+ handler: ({ format, quality, fullPage, clipX, clipY, clipWidth, clipHeight, tabId }: any) => Promise<{
38
+ success: boolean;
39
+ format: any;
40
+ fullPage: any;
41
+ data: any;
42
+ message: string;
43
+ }>;
44
+ } | {
45
+ name: string;
46
+ description: string;
47
+ inputSchema: z.ZodObject<{
48
+ tabId: z.ZodOptional<z.ZodString>;
49
+ outerHTML: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ outerHTML: boolean;
52
+ tabId?: string | undefined;
53
+ }, {
54
+ tabId?: string | undefined;
55
+ outerHTML?: boolean | undefined;
56
+ }>;
57
+ handler: ({ tabId, outerHTML }: any) => Promise<{
58
+ success: boolean;
59
+ html: any;
60
+ size: any;
61
+ }>;
62
+ } | {
63
+ name: string;
64
+ description: string;
65
+ inputSchema: z.ZodObject<{
66
+ landscape: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
67
+ displayHeaderFooter: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
68
+ printBackground: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
69
+ scale: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
70
+ paperWidth: z.ZodOptional<z.ZodNumber>;
71
+ paperHeight: z.ZodOptional<z.ZodNumber>;
72
+ tabId: z.ZodOptional<z.ZodString>;
73
+ }, "strip", z.ZodTypeAny, {
74
+ landscape: boolean;
75
+ displayHeaderFooter: boolean;
76
+ printBackground: boolean;
77
+ scale: number;
78
+ tabId?: string | undefined;
79
+ paperWidth?: number | undefined;
80
+ paperHeight?: number | undefined;
81
+ }, {
82
+ tabId?: string | undefined;
83
+ landscape?: boolean | undefined;
84
+ displayHeaderFooter?: boolean | undefined;
85
+ printBackground?: boolean | undefined;
86
+ scale?: number | undefined;
87
+ paperWidth?: number | undefined;
88
+ paperHeight?: number | undefined;
89
+ }>;
90
+ handler: ({ landscape, displayHeaderFooter, printBackground, scale, paperWidth, paperHeight, tabId }: any) => Promise<{
91
+ success: boolean;
92
+ data: any;
93
+ format: string;
94
+ message: string;
95
+ }>;
96
+ } | {
97
+ name: string;
98
+ description: string;
99
+ inputSchema: z.ZodObject<{
100
+ tabId: z.ZodOptional<z.ZodString>;
101
+ }, "strip", z.ZodTypeAny, {
102
+ tabId?: string | undefined;
103
+ }, {
104
+ tabId?: string | undefined;
105
+ }>;
106
+ handler: ({ tabId }: any) => Promise<{
107
+ success: boolean;
108
+ metrics: {
109
+ contentSize: any;
110
+ layoutViewport: any;
111
+ visualViewport: any;
112
+ };
113
+ }>;
114
+ } | {
115
+ name: string;
116
+ description: string;
117
+ inputSchema: z.ZodObject<{
118
+ tabId: z.ZodOptional<z.ZodString>;
119
+ }, "strip", z.ZodTypeAny, {
120
+ tabId?: string | undefined;
121
+ }, {
122
+ tabId?: string | undefined;
123
+ }>;
124
+ handler: ({ tabId }: any) => Promise<{
125
+ success: boolean;
126
+ nodeCount: any;
127
+ nodes: any;
128
+ }>;
129
+ })[];
130
+ //# sourceMappingURL=capture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../src/tools/capture.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yFAgBoC,GAAG;;;;;;;;;;;;;;;;;;;;oCAmDxD,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0GAoCmE,GAAG;;;;;;;;;;;;;;;;yBAkCpF,GAAG;;;;;;;;;;;;;;;;;;yBA0BH,GAAG;;;;;KAgBnC"}