pub struct StdioServerTransport { /* private fields */ }
Expand description
STDIO transport for MCP servers
This transport communicates with an MCP client via STDIO (standard input/output). It reads requests from stdin and writes responses to stdout.
Implementations§
Source§impl StdioServerTransport
impl StdioServerTransport
Sourcepub fn with_config(config: TransportConfig) -> Self
pub fn with_config(config: TransportConfig) -> Self
Source§impl StdioServerTransport
impl StdioServerTransport
Sourcepub async fn handle_request(
&mut self,
request: JsonRpcRequest,
) -> McpResult<JsonRpcResponse>
pub async fn handle_request( &mut self, request: JsonRpcRequest, ) -> McpResult<JsonRpcResponse>
Backward compatibility method for tests This method provides a default response for testing purposes
Trait Implementations§
Source§impl Default for StdioServerTransport
impl Default for StdioServerTransport
Source§impl ServerTransport for StdioServerTransport
impl ServerTransport for StdioServerTransport
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 set_request_handler(&mut self, handler: ServerRequestHandler)
fn set_request_handler(&mut self, handler: ServerRequestHandler)
Set the request handler that will process incoming requests 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 StdioServerTransport
impl !RefUnwindSafe for StdioServerTransport
impl Send for StdioServerTransport
impl Sync for StdioServerTransport
impl Unpin for StdioServerTransport
impl !UnwindSafe for StdioServerTransport
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