UNPKG

@cyanheads/git-mcp-server

Version:

An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management,

55 lines 2.53 kB
/** * Supported logging levels based on RFC 5424 Syslog severity levels used by MCP. * emerg: 0, alert: 1, crit: 2, error: 3, warning: 4, notice: 5, info: 6, debug: 7 */ export type McpLogLevel = "debug" | "info" | "notice" | "warning" | "error" | "crit" | "alert" | "emerg"; export type McpNotificationSender = (level: McpLogLevel, data: Record<string, unknown>, loggerName?: string) => void; /** * Singleton Logger wrapping Winston, adapted for MCP. * Logs to files and optionally sends MCP notifications/message. */ export declare class Logger { private static instance; private winstonLogger?; private initialized; private mcpNotificationSender?; private currentMcpLevel; private currentWinstonLevel; private constructor(); /** * Initialize Winston logger for file transport. Must be called once at app start. * Console transport is added conditionally. * @param level Initial minimum level to log ('info' default). */ initialize(level?: McpLogLevel): Promise<void>; /** * Sets the function used to send MCP 'notifications/message'. */ setMcpNotificationSender(sender: McpNotificationSender | undefined): void; /** * Dynamically sets the minimum logging level. */ setLevel(newLevel: McpLogLevel): void; /** Get singleton instance. */ static getInstance(): Logger; /** * Resets the singleton instance for testing purposes. * This should only be used in test environments. */ static resetForTesting(): void; /** Ensures the logger has been initialized. */ private ensureInitialized; /** Centralized log processing */ private log; debug(msg: string, context?: Record<string, unknown>): void; info(msg: string, context?: Record<string, unknown>): void; notice(msg: string, context?: Record<string, unknown>): void; warning(msg: string, context?: Record<string, unknown>): void; error(msg: string, err?: Error | Record<string, unknown>, context?: Record<string, unknown>): void; crit(msg: string, err?: Error | Record<string, unknown>, context?: Record<string, unknown>): void; alert(msg: string, err?: Error | Record<string, unknown>, context?: Record<string, unknown>): void; emerg(msg: string, err?: Error | Record<string, unknown>, context?: Record<string, unknown>): void; fatal(msg: string, err?: Error | Record<string, unknown>, context?: Record<string, unknown>): void; } export declare const logger: Logger; //# sourceMappingURL=logger.d.ts.map