a3s_code_core/mcp/transport/
mod.rs1pub mod http_sse;
8pub mod stdio;
9
10use crate::mcp::protocol::{JsonRpcNotification, JsonRpcRequest, JsonRpcResponse, McpNotification};
11use anyhow::Result;
12use async_trait::async_trait;
13use tokio::sync::mpsc;
14
15#[async_trait]
17pub trait McpTransport: Send + Sync {
18 async fn request(&self, request: JsonRpcRequest) -> Result<JsonRpcResponse>;
20
21 async fn notify(&self, notification: JsonRpcNotification) -> Result<()>;
23
24 fn notifications(&self) -> mpsc::Receiver<McpNotification>;
26
27 async fn close(&self) -> Result<()>;
29
30 fn is_connected(&self) -> bool;
32}