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 (stdin/stdout).
This is the most common transport for local MCP servers. The specified command is spawned as a child process, and JSON-RPC messages are exchanged line-by-line over its stdin and stdout streams.
§Example
use agentkit_mcp::StdioTransportConfig;
let config = StdioTransportConfig::new("npx")
.with_arg("-y")
.with_arg("@modelcontextprotocol/server-filesystem")
.with_env("HOME", "/home/user")
.with_cwd("/tmp");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 · 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
Source§impl PartialEq for StdioTransportConfig
impl PartialEq for StdioTransportConfig
impl Eq for StdioTransportConfig
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