modelcontextprotocol-client 0.1.3

Client implementation for the Model Context Protocol (MCP)
Documentation
// mcp-client/src/transport/mod.rs
pub mod stdio;

use async_trait::async_trait;
use anyhow::Result;
use mcp_protocol::messages::JsonRpcMessage;

/// Transport trait for sending and receiving MCP messages
#[async_trait]
pub trait Transport: Send + Sync + 'static {
    /// Start the transport (listening for incoming messages)
    async fn start(&self) -> Result<()>;
    
    /// Send a message to the server
    async fn send(&self, message: JsonRpcMessage) -> Result<()>;
    
    /// Close the transport
    async fn close(&self) -> Result<()>;
    
    /// Clone the transport
    fn box_clone(&self) -> Box<dyn Transport>;
}

pub use stdio::StdioTransport;