McpServerHandler

Trait McpServerHandler 

Source
pub trait McpServerHandler: Send + Sync {
    // Required methods
    fn handle_request<'life0, 'async_trait>(
        &'life0 self,
        client_jsonrpc_request: RequestFromClient,
        runtime: Arc<dyn McpServer>,
    ) -> Pin<Box<dyn Future<Output = Result<ResultFromServer, RpcError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn handle_error<'life0, 'life1, 'async_trait>(
        &'life0 self,
        jsonrpc_error: &'life1 RpcError,
        runtime: Arc<dyn McpServer>,
    ) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn handle_notification<'life0, 'async_trait>(
        &'life0 self,
        client_jsonrpc_notification: NotificationFromClient,
        runtime: Arc<dyn McpServer>,
    ) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn handle_request<'life0, 'async_trait>( &'life0 self, client_jsonrpc_request: RequestFromClient, runtime: Arc<dyn McpServer>, ) -> Pin<Box<dyn Future<Output = Result<ResultFromServer, RpcError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn handle_error<'life0, 'life1, 'async_trait>( &'life0 self, jsonrpc_error: &'life1 RpcError, runtime: Arc<dyn McpServer>, ) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn handle_notification<'life0, 'async_trait>( &'life0 self, client_jsonrpc_notification: NotificationFromClient, runtime: Arc<dyn McpServer>, ) -> Pin<Box<dyn Future<Output = SdkResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§