/** * MCP Audit Logger Service * * Logs all external MCP operations for security auditing. * Tracks approval decisions, connections, tool calls, and errors. */ import type { MCPAuditLogEntry, MCPDashboardMetrics } from '../types/mcp-client.types.js'; /** * MCP Audit Logger Service * * Responsibilities: * - Log all external MCP operations * - Track approval decisions * - Track connections and disconnections * - Track tool calls with timing * - Support both file-based and memory-based logging */ export declare class MCPAuditLoggerService { private logPath; private writeToFile; private initialized; private memoryLog; constructor(logPath?: string, writeToFile?: boolean); /** * Initialize the audit logger */ initialize(): void; /** * Log an approval decision */ logApproval(serverId: string, approved: boolean, decision?: string, notes?: string): Promise; /** * Log a connection attempt */ logConnection(serverId: string, success: boolean, error?: string): Promise; /** * Log a disconnection */ logDisconnection(serverId: string): Promise; /** * Log a tool call */ logToolCall(serverId: string, toolName: string, success: boolean, durationMs: number, error?: string): Promise; /** * Log an error */ logError(serverId: string, error: string, details?: Record): Promise; /** * Get recent audit entries from memory */ getRecentEntries(limit?: number): MCPAuditLogEntry[]; /** * Get entries for a specific server */ getServerEntries(serverId: string, limit?: number): MCPAuditLogEntry[]; /** * Get entries by operation type */ getEntriesByOperation(operation: MCPAuditLogEntry['operation'], limit?: number): MCPAuditLogEntry[]; /** * Get statistics summary */ getStats(): { byOperation: Record; byServer: Record; successRate: number; totalEntries: number; }; /** * Load historical entries from file */ loadHistoricalEntries(limit?: number): Promise; /** * Get aggregated metrics for dashboard display. * Pure in-memory, synchronous computation. */ getDashboardMetrics(): MCPDashboardMetrics; private accumulateServerEntry; private buildRecentToolCalls; private buildServerMetrics; private getConnectionState; private groupToolCalls; /** * Clear the in-memory log */ clearMemoryLog(): void; /** * Write an entry to both memory and file */ private writeEntry; } /** * Get the MCP Audit Logger service instance */ export declare function getMCPAuditLogger(logPath?: string, writeToFile?: boolean): MCPAuditLoggerService; /** * Reset the singleton (for testing) */ export declare function resetMCPAuditLogger(): void; //# sourceMappingURL=mcp-audit-logger.service.d.ts.map