Expand description
Progress tracking for long-running operations.
When a client sends a request with a _meta.progressToken, the server can
send progress notifications back to the client during the operation.
§Example
use mcp_kit::server::progress::ProgressTracker;
use mcp_kit::server::NotificationSender;
use mcp_kit::protocol::ProgressToken;
async fn long_operation(
notifier: NotificationSender,
progress_token: Option<ProgressToken>,
) {
let tracker = ProgressTracker::new(notifier, progress_token);
for i in 0..100 {
// Do some work...
tracker.update(i as f64, 100.0, Some(format!("Processing item {}", i))).await;
}
tracker.complete("Done!").await;
}Structs§
- Progress
Tracker - A helper for sending progress updates for a long-running operation.
Traits§
- Progress
Token Ext - Extension trait to extract progress token from request parameters.