pub struct McpClient { /* private fields */ }Expand description
MCP client that communicates with a server process via stdio.
Implementations§
Source§impl McpClient
impl McpClient
Sourcepub async fn connect(config: &McpConfig) -> Result<Self>
pub async fn connect(config: &McpConfig) -> Result<Self>
Spawn an MCP server process and perform the initialize handshake.
Sourcepub async fn list_tools(&self) -> Result<Vec<McpTool>>
pub async fn list_tools(&self) -> Result<Vec<McpTool>>
List available tools from the server.
Sourcepub async fn call_tool(
&self,
name: &str,
arguments: Value,
) -> Result<McpToolResult>
pub async fn call_tool( &self, name: &str, arguments: Value, ) -> Result<McpToolResult>
Call a tool with the given arguments.
Sourcepub async fn capabilities(&self) -> Option<McpServerCapabilities>
pub async fn capabilities(&self) -> Option<McpServerCapabilities>
Get server capabilities.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for McpClient
impl !RefUnwindSafe for McpClient
impl Send for McpClient
impl Sync for McpClient
impl Unpin for McpClient
impl UnsafeUnpin for McpClient
impl !UnwindSafe 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