pub trait McpServerBase: Send + Sync {
// Required methods
fn get_capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerCapabilities>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn handle_tool_request<'life0, 'async_trait>(
&'life0 self,
request: McpToolRequest,
) -> Pin<Box<dyn Future<Output = Result<McpToolResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn initialize<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn shutdown<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Base MCP server trait
Required Methods§
Sourcefn get_capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerCapabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_capabilities<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerCapabilities>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get server capabilities
Sourcefn handle_tool_request<'life0, 'async_trait>(
&'life0 self,
request: McpToolRequest,
) -> Pin<Box<dyn Future<Output = Result<McpToolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_tool_request<'life0, 'async_trait>(
&'life0 self,
request: McpToolRequest,
) -> Pin<Box<dyn Future<Output = Result<McpToolResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle tool execution request
Sourcefn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ServerStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get server statistics