mcp-protocol-server 0.2.0

⛔ DEPRECATED: Use mcp-protocol-sdk v0.4.0+ instead. This crate is consolidated into the main SDK.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Transport trait and implementations.

use async_trait::async_trait;
use mcp_protocol_types::{JsonRpcRequest, JsonRpcResponse};
use crate::error::ServerError;

/// Transport trait for MCP communication
#[async_trait]
pub trait Transport {
    /// Receive a request from the transport
    async fn receive_request(&mut self) -> Result<JsonRpcRequest, ServerError>;
    
    /// Send a response through the transport
    async fn send_response(&mut self, response: JsonRpcResponse) -> Result<(), ServerError>;
}