onProgressNotification method

void onProgressNotification(
  1. void handler(
    1. ProgressNotificationParams progress
    )
)

Register a handler for progress updates from the server: the whole notifications/progress params (token, progress, total, message).

Implementation

void onProgressNotification(void Function(ProgressNotificationParams progress) handler) {
  onNotification(McpProtocol.methodProgress, (params) {
    handler(ProgressNotificationParams.fromJson(Map<String, Object?>.from(params)));
  });
}