Skip to main content
Glama
mako10k

Web Proxy MCP Server

by mako10k

proxy_export_config

Export current proxy configuration to a file for backup, sharing, or analysis purposes. Specify file path and optionally include traffic logs.

Instructions

Export current proxy configuration to file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathNoOutput file path
includeTrafficLogNoInclude traffic log in export

Implementation Reference

  • The main handler for the proxy_export_config tool within _handleConfigTool. It validates args via validateToolArgs (called earlier), then calls targetManager.exportToFile with filepath and optional trafficLog from trafficAnalyzer, and returns a formatted success response with export details.
    case 'proxy_export_config': const exported = await this.targetManager.exportToFile( args.filepath, args.includeTrafficLog && this.trafficAnalyzer ? { trafficLog: this.trafficAnalyzer.getAllEntries() } : undefined ); return { content: [{ type: "text", text: `📤 Configuration exported to ${exported.filepath}\nTargets: ${exported.targetCount}\nFile size: ${exported.fileSize} bytes` }] };
  • Tool definition including name, description, and JSON schema for input validation (filepath required, includeTrafficLog optional boolean). Used by validateToolArgs and listTools.
    proxy_export_config: { name: "proxy_export_config", description: "Export current proxy configuration to file", inputSchema: { type: "object", properties: { filepath: { type: "string", description: "Output file path" }, includeTrafficLog: { type: "boolean", description: "Include traffic log in export", default: false } } } },
  • index.js:66-74 (registration)
    MCP server registration of all tools (including proxy_export_config) via ListToolsRequestHandler, exposing name, description, and inputSchema from the imported TOOLS object.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });
  • Core helper function in TargetManager that performs the actual file export: ensures directory exists, constructs JSON with targets and additionalData (e.g., trafficLog), writes file, returns filepath, targetCount, and fileSize.
    async exportToFile(filepath, additionalData = {}) { try { const fs = await import('fs/promises'); const path = await import('path'); // Ensure directory exists const dir = path.dirname(filepath); await fs.mkdir(dir, { recursive: true }); const exportData = { version: '1.0', exportedAt: new Date().toISOString(), targets: Object.fromEntries(this.targets), ...additionalData }; const content = JSON.stringify(exportData, null, 2); await fs.writeFile(filepath, content); return { filepath, targetCount: this.targets.size, fileSize: content.length }; } catch (error) { throw new Error(`Failed to export to file: ${error.message}`); } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mako10k/mcp-web-proxy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server