* * @deprecated since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28. * Log to stderr (stdio) or use OpenTelemetry instead. */ class LoggingNotificationHandler implements NotificationHandlerInterface { /** * @param callable(LoggingMessageNotification): void $callback */ public function __construct( private readonly mixed $callback, ) { trigger_deprecation('mcp/sdk', '0.8', 'MCP logging is deprecated since protocol revision 2026-07-28 (SEP-2577); log to stderr or use OpenTelemetry instead.'); } public function supports(Notification $notification): bool { return $notification instanceof LoggingMessageNotification; } public function handle(Notification $notification): void { \assert($notification instanceof LoggingMessageNotification); ($this->callback)($notification); } }