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