mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
57 lines • 2.06 kB
TypeScript
/**
* Output masking middleware for MCP responses
* Automatically applies content masking to all tool and resource outputs
*/
/**
* Configuration for output masking behavior
*/
export interface MaskingConfig {
/** Whether masking is enabled */
enabled: boolean;
/** Masking strategy to apply */
strategy: 'full' | 'partial' | 'placeholder' | 'environment';
/** Custom patterns to mask */
customPatterns?: string[];
/** Patterns to skip during masking */
skipPatterns?: string[];
}
/**
* Apply content masking to MCP response content
*
* @param response - The MCP response to mask
* @param config - Masking configuration to use
* @returns Promise resolving to the masked response
* @throws McpAdrError if masking fails
*/
export declare function maskMcpResponse(response: any, config?: MaskingConfig): Promise<any>;
/**
* Generate AI-powered masking for sensitive content
*/
export declare function generateAiMasking(content: string, contentType?: 'code' | 'documentation' | 'configuration' | 'logs' | 'general'): Promise<{
maskedContent: string;
analysisPrompt: string;
}>;
/**
* Create masking configuration from environment or defaults
*/
export declare function createMaskingConfig(overrides?: Partial<MaskingConfig>): MaskingConfig;
/**
* Validate masking configuration
*/
export declare function validateMaskingConfig(config: MaskingConfig): {
isValid: boolean;
errors: string[];
};
/**
* Middleware wrapper for MCP tool responses
*/
export declare function withContentMasking<T extends (..._args: any[]) => Promise<any>>(toolFunction: T, config?: MaskingConfig): T;
/**
* Apply progressive masking based on content sensitivity
*/
export declare function applyProgressiveMasking(content: string, sensitivityLevel?: 'low' | 'medium' | 'high' | 'critical'): Promise<string>;
/**
* Detect content sensitivity level using heuristics
*/
export declare function detectContentSensitivity(content: string): 'low' | 'medium' | 'high' | 'critical';
//# sourceMappingURL=output-masking.d.ts.map