pub struct McpClient { /* private fields */ }Expand description
MCP client for a connected server.
Implementations§
Source§impl McpClient
impl McpClient
Sourcepub fn connect_stdio(command: &str, args: &[String]) -> Result<Self>
pub fn connect_stdio(command: &str, args: &[String]) -> Result<Self>
Connects to an MCP server via stdio, spawning the given command.
Sends the initialize request and waits for the response.
§Errors
Returns an error if the subprocess cannot be spawned, the initialize handshake fails, or the server is unreachable.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for McpClient
impl !UnwindSafe for McpClient
impl Freeze for McpClient
impl Send for McpClient
impl Sync for McpClient
impl Unpin for McpClient
impl UnsafeUnpin for McpClient
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