pub struct McpClient { /* private fields */ }Expand description
MCP Client for interacting with MCP servers
Implementations§
Source§impl McpClient
impl McpClient
Sourcepub fn new(server: SdkMcpServer) -> Self
pub fn new(server: SdkMcpServer) -> Self
Create a new MCP client for a server
Sourcepub async fn call_tool(
&self,
tool_name: &str,
arguments: Value,
) -> Result<McpToolResult>
pub async fn call_tool( &self, tool_name: &str, arguments: Value, ) -> Result<McpToolResult>
Call a tool on the server
Sourcepub async fn list_tools(&self) -> Vec<String>
pub async fn list_tools(&self) -> Vec<String>
List available tools
Sourcepub fn server_name(&self) -> &str
pub fn server_name(&self) -> &str
Get the server name
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