pub struct McpServer<B: McpBackend> { /* private fields */ }
Expand description
Generic MCP server with pluggable backend
Implementations§
Source§impl<B: McpBackend + 'static> McpServer<B>
impl<B: McpBackend + 'static> McpServer<B>
Sourcepub async fn new(backend: B, config: ServerConfig) -> Result<Self, ServerError>
pub async fn new(backend: B, config: ServerConfig) -> Result<Self, ServerError>
Create a new MCP server with the given backend and configuration
Sourcepub async fn start(&mut self) -> Result<(), ServerError>
pub async fn start(&mut self) -> Result<(), ServerError>
Start the server
Sourcepub async fn stop(&mut self) -> Result<(), ServerError>
pub async fn stop(&mut self) -> Result<(), ServerError>
Stop the server gracefully
Sourcepub async fn run(&mut self) -> Result<(), ServerError>
pub async fn run(&mut self) -> Result<(), ServerError>
Run the server until shutdown signal
Sourcepub async fn health_check(&self) -> Result<HealthStatus, ServerError>
pub async fn health_check(&self) -> Result<HealthStatus, ServerError>
Get server health status
Sourcepub async fn get_metrics(&self) -> ServerMetrics
pub async fn get_metrics(&self) -> ServerMetrics
Get server metrics
Sourcepub fn get_server_info(&self) -> &ServerInfo
pub fn get_server_info(&self) -> &ServerInfo
Get server information
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if server is running
Auto Trait Implementations§
impl<B> Freeze for McpServer<B>
impl<B> !RefUnwindSafe for McpServer<B>
impl<B> Send for McpServer<B>
impl<B> Sync for McpServer<B>
impl<B> Unpin for McpServer<B>
impl<B> !UnwindSafe for McpServer<B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more