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