feat: provide more context information (#236)

* feat: provide more context information

1. provide context for notification
2. allow extract more info from tool call
3. inject http request part for streamable http server

* docs: add document for getting peer from context
This commit is contained in:
4t145 2025-05-29 11:52:54 +08:00 • committed by GitHub
commit 969fad26cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -52,7 +52,11 @@ pub struct Client {
}
impl ClientHandler for Client {
async fn on_resource_updated(&self, params: rmcp::model::ResourceUpdatedNotificationParam) {
async fn on_resource_updated(
&self,
params: rmcp::model::ResourceUpdatedNotificationParam,
_context: rmcp::service::NotificationContext<rmcp::RoleClient>,
) {
let uri = params.uri;
tracing::info!("Resource updated: {}", uri);
self.receive_signal.notify_one();