/** * Memory Journal MCP Server - MCP Protocol Logger * * Logging that sends structured messages via MCP notifications/message. * Falls back to stderr when MCP server is not connected. * Follows RFC 5424 severity levels as per MCP spec. */ import { type McpServer } from '@modelcontextprotocol/server'; /** * Narrow interface for MCP protocol log notification dispatch. * Decouples McpLogger from the SDK's SEP-2577 deprecation annotation on McpServer * while maintaining backward-compatible notifications/message support. */ export interface McpLoggingReceiver { sendLoggingMessage(params: { level: McpLogLevel; logger?: string; data: unknown; }): Promise | void; } /** * MCP log levels per RFC 5424 */ export type McpLogLevel = 'debug' | 'info' | 'notice' | 'warning' | 'error' | 'critical' | 'alert' | 'emergency'; interface LogData { message: string; module?: string; operation?: string; [key: string]: unknown; } /** * MCP Protocol Logger * * Sends structured log messages via MCP notifications/message protocol. * Falls back to stderr when server not connected. */ export declare class McpLogger { private server; private minLevel; /** * Connect to MCP server for protocol logging */ setServer(server: McpServer | McpLoggingReceiver): void; /** * Set minimum log level (from logging/setLevel request) */ setLevel(level: McpLogLevel): void; /** * Get current minimum log level */ getLevel(): McpLogLevel; /** * Check if a level should be logged */ private shouldLog; /** * Format message for stderr fallback */ private formatForStderr; /** * Send log message via MCP protocol or fallback to stderr */ log(level: McpLogLevel, loggerName: string, data: LogData): void; debug(loggerName: string, message: string, context?: Record): void; info(loggerName: string, message: string, context?: Record): void; notice(loggerName: string, message: string, context?: Record): void; warning(loggerName: string, message: string, context?: Record): void; error(loggerName: string, message: string, context?: Record): void; critical(loggerName: string, message: string, context?: Record): void; } export declare const mcpLogger: McpLogger; export {}; //# sourceMappingURL=mcp-logger.d.ts.map