proxy_get_pac_file
Retrieve the Proxy Auto-Configuration (PAC) file content for automated browser proxy setup, specifying the proxy server host and port for integration with Web Proxy MCP Server.
Instructions
Get the current PAC (Proxy Auto-Configuration) file content
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| proxyHost | No | Proxy server host | localhost |
| proxyPort | No | Proxy server port |
Implementation Reference
- Schema definition for the proxy_get_pac_file tool including input validation for proxy host and port.proxy_get_pac_file: { name: "proxy_get_pac_file", description: "Get the current PAC (Proxy Auto-Configuration) file content", inputSchema: { type: "object", properties: { proxyHost: { type: "string", description: "Proxy server host", default: "localhost" }, proxyPort: { type: "number", description: "Proxy server port", default: 8080 } } } },
- src/tools/tool-handlers.js:307-318 (handler)Tool handler that calls targetManager.generatePacFile and formats the response with PAC content.case 'proxy_get_pac_file': const pacContent = this.targetManager.generatePacFile( args.proxyHost, args.proxyPort ); return { content: [{ type: "text", text: `📄 PAC File Content:\n\n\`\`\`javascript\n${pacContent}\n\`\`\`` }] };
- src/proxy/target-manager.js:141-166 (helper)Generates the actual PAC file JavaScript content based on currently enabled proxy targets, including domain matching logic for subdomains.generatePacFile(proxyHost = 'localhost', proxyPort = 8080) { const enabledTargets = Array.from(this.targets.values()) .filter(target => target.enabled); const domainChecks = enabledTargets.map(target => { if (target.includeSubdomains) { return ` if (host === "${target.domain}" || host.endsWith(".${target.domain}")) return "PROXY ${proxyHost}:${proxyPort}";`; } else { return ` if (host === "${target.domain}") return "PROXY ${proxyHost}:${proxyPort}";`; } }).join('\n'); return `function FindProxyForURL(url, host) { host = host.toLowerCase(); // Proxy specific domains through our proxy server ${domainChecks} // All other traffic goes direct return "DIRECT"; } // Generated by Web Proxy MCP Server // Last updated: ${new Date().toISOString()} // Active targets: ${enabledTargets.length}`; }