MCPcopy Create free account
hub / github.com/ChrisFeldmeier/OpenCodeRust / handle_notification

Method handle_notification

crates/opencode-mcp/src/client.rs:493–522  ·  view source on GitHub ↗

Handle a server notification received during request/response.

(&self, notif: JsonRpcNotification)

Source from the content-addressed store, hash-verified

491
492 /// Handle a server notification received during request/response.
493 async fn handle_notification(&self, notif: JsonRpcNotification) {
494 match notif.method.as_str() {
495 "notifications/tools/list_changed" => {
496 tracing::info!(
497 server = %self.server_name,
498 "MCP server tools changed, flagging for reload"
499 );
500 self.tools_changed.store(true, Ordering::SeqCst);
501 }
502 "notifications/resources/list_changed" => {
503 tracing::debug!(
504 server = %self.server_name,
505 "MCP server resources changed (not yet handled)"
506 );
507 }
508 "notifications/prompts/list_changed" => {
509 tracing::debug!(
510 server = %self.server_name,
511 "MCP server prompts changed (not yet handled)"
512 );
513 }
514 other => {
515 tracing::debug!(
516 server = %self.server_name,
517 method = other,
518 "Unhandled MCP notification"
519 );
520 }
521 }
522 }
523
524 fn is_progress_notification(notif: &JsonRpcNotification) -> bool {
525 notif.method == "notifications/progress" || notif.method == "$/progress"

Calls 1

as_strMethod · 0.45

Tested by

no test coverage detected