import { MCPError, MCPErrorCode, MCPResponse } from '../protocol/types.js'; export declare class ErrorHandlingMiddleware { static createError(code: MCPErrorCode, message: string, data?: unknown, id?: string | number | null): MCPError; static createErrorResponse(error: MCPError, id?: string | number | null): any; static handleError(error: unknown, requestId?: string | number | null): any; static wrapHandler(handler: (...args: T) => Promise, requestId?: string | number | null): (...args: T) => Promise; } export declare class MCPServerError extends Error { code: MCPErrorCode; data?: unknown | undefined; constructor(code: MCPErrorCode, message: string, data?: unknown | undefined); static notInitialized(message?: string): MCPServerError; static methodNotFound(method: string): MCPServerError; static invalidParams(message: string, data?: unknown): MCPServerError; static parseError(message?: string): MCPServerError; static invalidRequest(message?: string): MCPServerError; static internalError(message?: string, data?: unknown): MCPServerError; } export interface ErrorLogger { error(message: string, error?: unknown): void; warn(message: string, data?: unknown): void; info(message: string, data?: unknown): void; debug(message: string, data?: unknown): void; } export declare class ConsoleErrorLogger implements ErrorLogger { error(message: string, error?: unknown): void; warn(message: string, data?: unknown): void; info(message: string, data?: unknown): void; debug(message: string, data?: unknown): void; } export declare function setupGlobalErrorHandling(logger: ErrorLogger): void; //# sourceMappingURL=error.d.ts.map