pub struct MCPClient { /* private fields */ }Expand description
MCP Client for communicating with MCP servers
Implementations§
Source§impl MCPClient
impl MCPClient
Sourcepub fn with_timeout(_timeout_ms: u64) -> Self
pub fn with_timeout(_timeout_ms: u64) -> Self
Creates a new MCP client with custom timeout
Sourcepub async fn disconnect(&self, server_id: &str) -> Result<()>
pub async fn disconnect(&self, server_id: &str) -> Result<()>
Sourcepub async fn discover_servers(&self) -> Result<Vec<String>>
pub async fn discover_servers(&self) -> Result<Vec<String>>
Sourcepub async fn discover_tools(&self, server_id: &str) -> Result<Vec<ToolMetadata>>
pub async fn discover_tools(&self, server_id: &str) -> Result<Vec<ToolMetadata>>
Sourcepub async fn register_tools(
&self,
server_id: &str,
tools: Vec<ToolMetadata>,
) -> Result<()>
pub async fn register_tools( &self, server_id: &str, tools: Vec<ToolMetadata>, ) -> Result<()>
Sourcepub async fn get_connected_servers(&self) -> Result<Vec<ServerConnection>>
pub async fn get_connected_servers(&self) -> Result<Vec<ServerConnection>>
Sourcepub async fn get_server(
&self,
server_id: &str,
) -> Result<Option<ServerConnection>>
pub async fn get_server( &self, server_id: &str, ) -> Result<Option<ServerConnection>>
Sourcepub async fn is_connected(&self, server_id: &str) -> bool
pub async fn is_connected(&self, server_id: &str) -> bool
Sourcepub async fn connected_server_count(&self) -> usize
pub async fn connected_server_count(&self) -> usize
Gets the number of connected servers
Sourcepub async fn get_all_tools(&self) -> Result<Vec<ToolMetadata>>
pub async fn get_all_tools(&self) -> Result<Vec<ToolMetadata>>
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 !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