pub struct StdioTransportConfig {
pub command: String,
pub args: Vec<String>,
pub env: Vec<(String, String)>,
pub cwd: Option<PathBuf>,
}Expand description
Configuration for an MCP server that communicates over standard I/O.
The specified command is spawned as a child process; rmcp drives the JSON-RPC framing over its stdin/stdout.
Fields§
§command: StringThe executable to launch (e.g. "npx", "python", "node").
args: Vec<String>Command-line arguments passed to the executable.
env: Vec<(String, String)>Additional environment variables set for the child process.
cwd: Option<PathBuf>Optional working directory for the child process.
Implementations§
Source§impl StdioTransportConfig
impl StdioTransportConfig
Sourcepub fn new(command: impl Into<String>) -> Self
pub fn new(command: impl Into<String>) -> Self
Creates a new stdio transport configuration for the given command.
Sourcepub fn with_arg(self, arg: impl Into<String>) -> Self
pub fn with_arg(self, arg: impl Into<String>) -> Self
Appends a command-line argument. Returns self for chaining.
Trait Implementations§
Source§impl Clone for StdioTransportConfig
impl Clone for StdioTransportConfig
Source§fn clone(&self) -> StdioTransportConfig
fn clone(&self) -> StdioTransportConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StdioTransportConfig
impl Debug for StdioTransportConfig
impl Eq for StdioTransportConfig
Source§impl PartialEq for StdioTransportConfig
impl PartialEq for StdioTransportConfig
Source§fn eq(&self, other: &StdioTransportConfig) -> bool
fn eq(&self, other: &StdioTransportConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StdioTransportConfig
Auto Trait Implementations§
impl Freeze for StdioTransportConfig
impl RefUnwindSafe for StdioTransportConfig
impl Send for StdioTransportConfig
impl Sync for StdioTransportConfig
impl Unpin for StdioTransportConfig
impl UnsafeUnpin for StdioTransportConfig
impl UnwindSafe for StdioTransportConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.