mcp-adr-analysis-server
Version:
MCP server for analyzing Architectural Decision Records and project architecture
30 lines • 914 B
TypeScript
/**
* MCP Response Validator
*
* Validates and sanitizes MCP tool responses to prevent JSON-RPC 2.0 parse errors
*/
export interface McpToolResponse {
content: Array<{
type: 'text' | 'image' | 'resource';
text?: string;
data?: string;
mimeType?: string;
}>;
isError?: boolean;
}
/**
* Validate and sanitize an MCP tool response
*/
export declare function validateMcpResponse(response: any): McpToolResponse;
/**
* Validate that a response can be safely serialized as JSON-RPC 2.0
*/
export declare function validateJsonRpcSerialization(response: any): {
valid: boolean;
error?: string;
};
/**
* Safe wrapper for MCP tool functions
*/
export declare function safeMcpToolWrapper<T extends any[], R>(toolFunction: (...args: T) => Promise<R>, toolName: string): (...args: T) => Promise<McpToolResponse>;
//# sourceMappingURL=mcp-response-validator.d.ts.map