Skip to main content
Glama
mako10k

Web Proxy MCP Server

by mako10k

proxy_add_target

Add a new target domain for proxy monitoring, enabling traffic analysis with optional header and body capture, and control its active status for HTTP/HTTPS traffic.

Instructions

Add a new target domain for proxy monitoring

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
captureBodyNoCapture request/response body
captureHeadersNoCapture request/response headers
descriptionNoOptional description of the target
domainYesDomain to monitor (e.g., example.com)
enabledNoWhether the target is active

Implementation Reference

  • Tool handler case for 'proxy_add_target' that validates args (via outer validation), calls targetManager.addTarget with parameters, and returns formatted success response.
    case 'proxy_add_target': const added = this.targetManager.addTarget( args.domain, args.description, { enabled: args.enabled, captureHeaders: args.captureHeaders, captureBody: args.captureBody } ); return { content: [{ type: "text", text: `Target added: ${args.domain}\nStatus: ${added ? 'success' : 'already exists'}\nMonitored domains: ${this.targetManager.getStats().enabled}` }] };
  • Input schema definition for proxy_add_target tool, specifying parameters like domain (required), description, enabled, captureHeaders, captureBody.
    proxy_add_target: { name: "proxy_add_target", description: "Add a new target domain for proxy monitoring", inputSchema: { type: "object", properties: { domain: { type: "string", description: "Domain to monitor (e.g., example.com)" }, description: { type: "string", description: "Optional description of the target" }, enabled: { type: "boolean", description: "Whether the target is active", default: true }, captureHeaders: { type: "boolean", description: "Capture request/response headers", default: true }, captureBody: { type: "boolean", description: "Capture request/response body", default: false } }, required: ["domain"] } },
  • index.js:66-74 (registration)
    MCP listTools registration using TOOLS object, which includes proxy_add_target schema and description.
    this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) }; });
  • index.js:77-99 (registration)
    MCP callTool registration that dispatches to ToolHandlers.handleTool based on tool name, executing proxy_add_target when called.
    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; } catch (error) { console.error(`Tool error [${name}]:`, error.message); throw new McpError( ErrorCode.InternalError, `Tool execution failed: ${error.message}` ); } });
  • Supporting utility method in TargetManager class that implements the core logic for adding a proxy target: validation, configuration normalization, storage in Map, PAC update, and logging.
    addTarget(domain, config = {}) { // Pre-conditions if (!domain || typeof domain !== 'string') { throw new Error('Domain is required and must be a string'); } const targetConfig = { domain: domain.toLowerCase(), enabled: config.enabled !== false, includeSubdomains: config.includeSubdomains !== false, description: config.description || '', captureHeaders: config.captureHeaders !== false, // Default to true captureBody: config.captureBody !== false, // Default to true addedAt: new Date(), ...config }; // Post-conditions: validate critical fields console.assert(typeof targetConfig.captureHeaders === 'boolean', 'captureHeaders must be boolean'); console.assert(typeof targetConfig.captureBody === 'boolean', 'captureBody must be boolean'); console.assert(typeof targetConfig.enabled === 'boolean', 'enabled must be boolean'); this.targets.set(domain.toLowerCase(), targetConfig); this._updatePacFile(); console.log(`✅ Target added: ${domain} (captureHeaders=${targetConfig.captureHeaders}, captureBody=${targetConfig.captureBody})`); return true; }

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