pub struct WebSocketServerTransport { /* private fields */ }
Expand description
WebSocket transport for MCP servers
This transport serves MCP requests over WebSocket connections, allowing multiple concurrent clients with bidirectional communication.
Implementations§
Source§impl WebSocketServerTransport
impl WebSocketServerTransport
Sourcepub fn with_config<S: Into<String>>(
bind_addr: S,
config: TransportConfig,
) -> Self
pub fn with_config<S: Into<String>>( bind_addr: S, config: TransportConfig, ) -> Self
Sourcepub async fn set_request_handler<F>(&mut self, handler: F)
pub async fn set_request_handler<F>(&mut self, handler: F)
Trait Implementations§
Source§impl ServerTransport for WebSocketServerTransport
impl ServerTransport for WebSocketServerTransport
Source§fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the server transport and begin listening for connections Read more
Source§fn handle_request<'life0, 'async_trait>(
&'life0 mut self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn handle_request<'life0, 'async_trait>(
&'life0 mut self,
request: JsonRpcRequest,
) -> Pin<Box<dyn Future<Output = McpResult<JsonRpcResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an incoming JSON-RPC request and return a response Read more
Source§fn send_notification<'life0, 'async_trait>(
&'life0 mut self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send_notification<'life0, 'async_trait>(
&'life0 mut self,
notification: JsonRpcNotification,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a JSON-RPC notification to the client Read more
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop the server transport Read more
Source§fn is_running(&self) -> bool
fn is_running(&self) -> bool
Check if the server is running Read more
Source§fn server_info(&self) -> String
fn server_info(&self) -> String
Get server information for debugging Read more
Auto Trait Implementations§
impl Freeze for WebSocketServerTransport
impl !RefUnwindSafe for WebSocketServerTransport
impl Send for WebSocketServerTransport
impl Sync for WebSocketServerTransport
impl Unpin for WebSocketServerTransport
impl !UnwindSafe for WebSocketServerTransport
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