kuri 0.2.0

An SDK for building MCP servers, focused on elegant developer experience, where tools and prompts are just plain old Rust functions.
Documentation
use thiserror::Error;

/// Errors raised when parsing a message
#[derive(Error, Debug)]
pub enum MessageParseError {
    #[error("Error deserialising message: {0}")]
    Deserialisation(#[from] serde_json::Error),

    #[error("Error decoding line: {0}")]
    LinesCodecError(#[from] tokio_util::codec::LinesCodecError),
}

/// Errors raised by a transport.
///
/// The most common case is when reading from, or writing to, a connection.
#[derive(Error, Debug)]
pub enum TransportError {
    #[error("JSON serialisation error: {0}")]
    Serialisation(#[from] serde_json::Error),

    #[error("Error sending/receiving bytes: {0}")]
    LinesCodecError(#[from] tokio_util::codec::LinesCodecError),
}

mod stdio;
pub use stdio::StdioTransport;