MCPcopy Create free account
hub / github.com/AI45Lab/Code / notify

Method notify

core/src/mcp/transport/stdio.rs:204–216  ·  view source on GitHub ↗
(&self, notification: JsonRpcNotification)

Source from the content-addressed store, hash-verified

202 }
203
204 async fn notify(&self, notification: JsonRpcNotification) -> Result<()> {
205 if !self.connected.load(Ordering::SeqCst) {
206 return Err(anyhow!("Transport not connected"));
207 }
208
209 let msg = serde_json::to_string(&notification)? + "\n";
210 self.stdin_tx
211 .send(msg)
212 .await
213 .map_err(|_| anyhow!("Failed to send notification"))?;
214
215 Ok(())
216 }
217
218 fn notifications(&self) -> mpsc::Receiver<McpNotification> {
219 // This is a bit awkward - we need to take ownership of the receiver

Callers 2

initializeMethod · 0.45

Calls 2

loadMethod · 0.45
sendMethod · 0.45

Tested by 1