/** * External MCP Tool Proxy * * Wraps external tool calls with: * - Execution timeout enforcement * - Audit logging * - Error handling * - Risk assessment */ import type { MCPAuditLoggerService } from '../mcp-audit-logger.service.js'; import type { MCPClientManagerService } from '../mcp-client-manager.service.js'; import type { ExternalMCPServerConfig, ExternalMCPTool, ExternalMCPToolCallResult, MCPRiskLevel } from '../../types/mcp-client.types.js'; /** * Risk factors for tool assessment */ interface RiskAssessment { factors: string[]; overallRisk: MCPRiskLevel; score: number; } /** * Tool execution options */ export interface ToolProxyOptions { /** Override timeout for this call */ timeout_ms?: number; /** Skip audit logging */ skipAudit?: boolean; /** Allow blocked tools (for emergency use) */ allowBlocked?: boolean; } /** * External MCP Tool Proxy * * Responsibilities: * - Wrap external tool calls with safety measures * - Enforce execution timeouts * - Log all operations for auditing * - Assess and report risk levels */ export declare class ExternalMCPToolProxy { private clientManager; private auditLogger; constructor(clientManager: MCPClientManagerService, auditLogger: MCPAuditLoggerService); /** * Execute a tool on an external MCP server with safety measures */ executeWithProxy(serverId: string, toolName: string, args: Record, options?: ToolProxyOptions): Promise; /** * Execute multiple tools in sequence */ executeSequence(calls: Array<{ args: Record; serverId: string; toolName: string; }>, options?: ToolProxyOptions): Promise; /** * Get risk assessment for a tool */ assessToolRisk(config: ExternalMCPServerConfig, tool: ExternalMCPTool): RiskAssessment; /** * Assess risk based on server capabilities */ private assessCapabilityRisk; /** * Assess risk based on tool name/description patterns */ private assessToolPatternRisk; /** * Convert a numeric score to a risk level */ private scoreToRiskLevel; /** * Get all available tools from connected servers */ getAvailableTools(): ExternalMCPTool[]; /** * Get tools from a specific server */ getServerTools(serverId: string): ExternalMCPTool[]; /** * Validate that a tool can be accessed */ private validateToolAccess; /** * Execute a tool call with timeout */ private executeWithTimeout; /** * Generate a unique request ID */ private generateRequestId; } /** * Get the External MCP Tool Proxy instance */ export declare function getExternalMCPToolProxy(clientManager: MCPClientManagerService, auditLogger: MCPAuditLoggerService): ExternalMCPToolProxy; /** * Reset the singleton (for testing) */ export declare function resetExternalMCPToolProxy(): void; export {}; //# sourceMappingURL=tool-proxy.d.ts.map