pub struct McpClient { /* private fields */ }Expand description
MCP client for a single server connection
Implementations§
Source§impl McpClient
impl McpClient
pub async fn connect_stdio( command: &str, args: &[String], env: Option<&HashMap<String, String>>, ) -> Result<McpClient, Error>
pub async fn connect_http( endpoint: &str, auth: Option<Auth>, ) -> Result<McpClient, Error>
pub async fn connect_websocket(url: &str) -> Result<McpClient, Error>
pub async fn refresh_all(&self) -> Result<(), Error>
pub async fn refresh_tools(&self) -> Result<(), Error>
pub async fn refresh_resources(&self) -> Result<(), Error>
pub async fn refresh_prompts(&self) -> Result<(), Error>
pub async fn call_tool( &self, name: &str, arguments: Value, ) -> Result<Value, Error>
pub async fn read_resource(&self, uri: &str) -> Result<Value, Error>
pub async fn get_prompt( &self, name: &str, arguments: Option<Value>, ) -> Result<Value, Error>
pub async fn tools(&self) -> Vec<McpTool>
pub async fn resources(&self) -> Vec<McpResource>
pub async fn prompts(&self) -> Vec<McpPrompt>
pub async fn server_info(&self) -> Option<McpServerInfo>
pub fn is_connected(&self) -> bool
pub async fn close(&self) -> Result<(), Error>
Auto Trait Implementations§
impl !Freeze for McpClient
impl !RefUnwindSafe for McpClient
impl Send for McpClient
impl Sync for McpClient
impl Unpin 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