Skip to main content
Glama
mako10k

Web Proxy MCP Server

by mako10k

proxy_import_config

Load and apply proxy server configurations from a specified file, with options to merge or replace existing settings. Simplify setup and management for automated traffic handling in the Web Proxy MCP Server.

Instructions

Import proxy configuration from file

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filepathYesPath to configuration file
mergeNoMerge with existing config or replace

Implementation Reference

  • Core execution logic for the proxy_import_config tool. Calls targetManager.importFromFile with filepath and merge options, then returns a text content response with import statistics.
    case 'proxy_import_config': const imported = await this.targetManager.importFromFile( args.filepath, args.merge ); return { content: [{ type: "text", text: `📥 Configuration imported from ${args.filepath}\nTargets imported: ${imported.imported}\nTotal targets: ${this.targetManager.getStats().total}` }] };
  • Tool definition including name, description, and inputSchema for parameter validation (filepath required, merge optional).
    proxy_import_config: { name: "proxy_import_config", description: "Import proxy configuration from file", inputSchema: { type: "object", properties: { filepath: { type: "string", description: "Path to configuration file" }, merge: { type: "boolean", description: "Merge with existing config or replace", default: false } }, required: ["filepath"] } },
  • index.js:66-74 (registration)
    MCP listTools request handler that exposes the proxy_import_config tool's schema and description from the central TOOLS object.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });
  • index.js:77-91 (registration)
    MCP callTool request handler that routes proxy_import_config calls to the centralized ToolHandlers.handleTool method for execution.
    this.server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await this.toolHandlers.handleTool(name, args || {}); if (result.isError) { throw new McpError( ErrorCode.InternalError, result.error ); } return result;
  • Helper method in TargetManager that reads the config file, optionally clears existing targets, imports the JSON data, and returns import results.
    async importFromFile(filepath, merge = false) { try { const fs = await import('fs/promises'); const data = await fs.readFile(filepath, 'utf-8'); if (!merge) { this.targets.clear(); } const imported = this.importTargets(data); return { imported, merge }; } catch (error) { throw new Error(`Failed to import from 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