proxy_update_target
Modify domain configurations in the Web Proxy MCP Server to enable/disable targets, capture headers, or capture body data for monitoring and analysis.
Instructions
Update target domain configuration
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| captureBody | No | Enable/disable body capture | |
| captureHeaders | No | Enable/disable header capture | |
| description | No | New description | |
| domain | Yes | Domain to update | |
| enabled | No | Enable/disable target |
Implementation Reference
- src/tools/tool-handlers.js:197-210 (handler)Main handler logic for the proxy_update_target tool. Constructs update object from args, calls TargetManager.updateTarget, and formats response.case 'proxy_update_target': const updates = {}; if ('enabled' in args) updates.enabled = args.enabled; if ('description' in args) updates.description = args.description; if ('captureHeaders' in args) updates.captureHeaders = args.captureHeaders; if ('captureBody' in args) updates.captureBody = args.captureBody; const updated = this.targetManager.updateTarget(args.domain, updates); return { content: [{ type: "text", text: `Target updated: ${args.domain}\nStatus: ${updated ? 'success' : 'not found'}\nUpdates: ${JSON.stringify(updates, null, 2)}` }] };
- src/tools/tool-definitions.js:73-102 (schema)Input schema validation for proxy_update_target tool parameters.proxy_update_target: { name: "proxy_update_target", description: "Update target domain configuration", inputSchema: { type: "object", properties: { domain: { type: "string", description: "Domain to update" }, description: { type: "string", description: "New description" }, enabled: { type: "boolean", description: "Enable/disable target" }, captureHeaders: { type: "boolean", description: "Enable/disable header capture" }, captureBody: { type: "boolean", description: "Enable/disable body capture" } }, required: ["domain"] } },
- index.js:77-98 (registration)MCP server request handler for tool calls, which dispatches to ToolHandlers.handleTool 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; } catch (error) { console.error(`Tool error [${name}]:`, error.message); throw new McpError( ErrorCode.InternalError, `Tool execution failed: ${error.message}` ); }
- index.js:66-73 (registration)MCP server request handler for listing tools, exposing proxy_update_target schema via TOOLS object.this.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: Object.entries(TOOLS).map(([name, tool]) => ({ name, description: tool.description, inputSchema: tool.inputSchema })) };
- src/proxy/target-manager.js:374-391 (helper)Core updateTarget method in TargetManager that modifies the target config in memory and updates PAC file.updateTarget(domain, updates) { const target = this.targets.get(domain.toLowerCase()); if (!target) { return false; } // Apply updates if ('enabled' in updates) target.enabled = updates.enabled; if ('description' in updates) target.description = updates.description; if ('includeSubdomains' in updates) target.includeSubdomains = updates.includeSubdomains; if ('captureHeaders' in updates) target.captureHeaders = updates.captureHeaders; if ('captureBody' in updates) target.captureBody = updates.captureBody; target.lastModified = new Date(); this._updatePacFile(); return true; }