pub struct StdioTransport { /* private fields */ }Available on crate feature
stdio only.Expand description
Stdio-based MCP transport for communicating with child processes.
Implementations§
Source§impl StdioTransport
impl StdioTransport
Sourcepub fn spawn(command: &str, args: &[String]) -> Result<Self, McpTransportError>
pub fn spawn(command: &str, args: &[String]) -> Result<Self, McpTransportError>
Spawn a new MCP server process.
Sourcepub fn spawn_with_env(
command: &str,
args: &[String],
env: HashMap<String, String>,
) -> Result<Self, McpTransportError>
pub fn spawn_with_env( command: &str, args: &[String], env: HashMap<String, String>, ) -> Result<Self, McpTransportError>
Spawn a new MCP server process with environment variables.
Sourcepub fn send_request_sync(
&self,
method: &str,
params: Option<Value>,
) -> Result<Value, McpTransportError>
pub fn send_request_sync( &self, method: &str, params: Option<Value>, ) -> Result<Value, McpTransportError>
Send a JSON-RPC request and wait for response (blocking).
Sourcepub fn stop(&self) -> Result<(), McpTransportError>
pub fn stop(&self) -> Result<(), McpTransportError>
Stop the process.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StdioTransport
impl RefUnwindSafe for StdioTransport
impl Send for StdioTransport
impl Sync for StdioTransport
impl Unpin for StdioTransport
impl UnwindSafe for StdioTransport
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