pub struct StdioTransport { /* private fields */ }Expand description
Production stdio MCP client. Wraps an rmcp running service so
that callers see only the McpTransport trait.
The cloneable Peer is cached at construction time so every
list_tools / call_tool is a lock-free dispatch into rmcp.
Concurrent calls fan out without serialising on a transport-level
mutex; rmcp itself multiplexes the underlying stdio channel.
Implementations§
Source§impl StdioTransport
impl StdioTransport
Sourcepub async fn spawn(
endpoint: impl Into<String>,
program: impl AsRef<OsStr>,
args: &[&str],
) -> Result<Self, KernelError>
pub async fn spawn( endpoint: impl Into<String>, program: impl AsRef<OsStr>, args: &[&str], ) -> Result<Self, KernelError>
Spawn program with args and connect over its stdio.
endpoint is a free-form identifier surfaced via
McpTransport::endpoint; it has no protocol meaning.
Trait Implementations§
Source§impl McpTransport for StdioTransport
impl McpTransport for StdioTransport
Source§fn endpoint(&self) -> &str
fn endpoint(&self) -> &str
Stable identifier for this transport instance (typically the
server URI or stdio command).
Source§fn list_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolSchema>, KernelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<ToolSchema>, KernelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Discover the tools exposed by the remote endpoint. Called at
registration time; the returned schemas are authoritative.
Source§fn call_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, KernelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value, KernelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Invoke a named tool. Implementations MUST round-trip the result
JSON without modification so callers can rely on schema fidelity.
Auto Trait Implementations§
impl Freeze for StdioTransport
impl !RefUnwindSafe for StdioTransport
impl Send for StdioTransport
impl Sync for StdioTransport
impl Unpin for StdioTransport
impl UnsafeUnpin 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