pub struct MCPClient { /* private fields */ }Expand description
MCP client for communicating with servers over stdio transport.
Implementations§
Source§impl MCPClient
impl MCPClient
Sourcepub async fn new(server_cmd: &str) -> Result<Self>
pub async fn new(server_cmd: &str) -> Result<Self>
Create a new MCP client and connect to a server via stdio.
§Arguments
server_cmd- Command to spawn the server (e.g., “python -m my_server”)
pub async fn call_tool(&mut self, tool_name: &str, args: Value) -> Result<Value>
pub async fn list_tools(&mut self) -> Result<Vec<Tool>>
pub fn get_server_name(&self) -> String
pub fn get_server_version(&self) -> String
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