proxy_generate_setup
Generate browser and system proxy setup scripts to configure web traffic routing through a specified proxy server for monitoring and analysis.
Instructions
Generate browser and system proxy setup scripts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| proxyHost | No | Proxy server host | localhost |
| proxyPort | No | Proxy server port | |
| browsers | No | Browser types to generate setup for |
Implementation Reference
- src/tools/tool-handlers.js:289-305 (handler)MCP tool handler for 'proxy_generate_setup' that invokes BrowserSetup.generateAllSetups and returns generated files info with quick guide.case 'proxy_generate_setup': const setup = await this.browserSetup.generateAllSetups( args.proxyHost, args.proxyPort ); const quickGuide = this.browserSetup.generateQuickSetup( args.proxyHost, args.proxyPort ); return { content: [{ type: "text", text: `✅ Browser setup scripts generated!\n\n${quickGuide}\n\nGenerated files:\n${Object.entries(setup.files).map(([type, file]) => `• ${file.filename} - ${file.description}`).join('\n')}` }] };
- Tool schema definition including name, description, and inputSchema with defaults for proxy host, port, and browsers.proxy_generate_setup: { name: "proxy_generate_setup", description: "Generate browser and system proxy setup scripts", inputSchema: { type: "object", properties: { proxyHost: { type: "string", description: "Proxy server host", default: "localhost" }, proxyPort: { type: "number", description: "Proxy server port", default: 8080 }, browsers: { type: "array", items: { type: "string", enum: ["chrome", "firefox", "curl", "system", "pac"] }, description: "Browser types to generate setup for", default: ["chrome", "firefox", "pac"] } } } },
- index.js:66-74 (registration)MCP server registration via ListToolsRequestHandler that exposes all tools from TOOLS object, including proxy_generate_setup.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });
- src/setup/browser-setup.js:21-57 (helper)Core helper function in BrowserSetup class that generates and saves setup scripts for PAC, Chrome, Firefox, cURL, and system proxy configurations.async generateAllSetups(proxyHost = 'localhost', proxyPort = 8080) { const scripts = { pac: await this.generatePacFile(proxyHost, proxyPort), chrome: this.generateChromeSetup(proxyHost, proxyPort), firefox: this.generateFirefoxSetup(proxyHost, proxyPort), curl: this.generateCurlSetup(proxyHost, proxyPort), system: this.generateSystemProxySetup(proxyHost, proxyPort) }; // Create setup directory try { await fs.mkdir(this.setupDir, { recursive: true }); } catch (error) { // Directory might already exist } // Write all scripts to files const files = {}; for (const [type, content] of Object.entries(scripts)) { const filename = `${type}-proxy-setup.${this._getFileExtension(type)}`; const filepath = path.join(this.setupDir, filename); await fs.writeFile(filepath, content.content); files[type] = { filename, filepath, description: content.description }; } return { proxyHost, proxyPort, targetCount: this.targetManager.getStats().enabled, files, generatedAt: new Date().toISOString() }; }