pub struct McpServerManager { /* private fields */ }Expand description
A manager for multiple MCP server connections.
Implementations§
Source§impl McpServerManager
impl McpServerManager
Sourcepub fn add_server(&mut self, server: Box<dyn McpServer>)
pub fn add_server(&mut self, server: Box<dyn McpServer>)
Add a server to the manager.
Sourcepub fn remove_server(&mut self, name: &str) -> Option<Box<dyn McpServer>>
pub fn remove_server(&mut self, name: &str) -> Option<Box<dyn McpServer>>
Remove a server by name.
Sourcepub fn get_mut(&mut self, name: &str) -> Option<&mut Box<dyn McpServer>>
pub fn get_mut(&mut self, name: &str) -> Option<&mut Box<dyn McpServer>>
Get a mutable reference to a server.
Sourcepub async fn list_all_tools(&self) -> Vec<(String, Vec<McpTool>)>
pub async fn list_all_tools(&self) -> Vec<(String, Vec<McpTool>)>
Get all tools from all connected servers.
Sourcepub async fn list_all_resources(&self) -> Vec<(String, Vec<McpResource>)>
pub async fn list_all_resources(&self) -> Vec<(String, Vec<McpResource>)>
Get all resources from all connected servers.
Trait Implementations§
Source§impl Debug for McpServerManager
impl Debug for McpServerManager
Source§impl Default for McpServerManager
impl Default for McpServerManager
Source§fn default() -> McpServerManager
fn default() -> McpServerManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for McpServerManager
impl !UnwindSafe for McpServerManager
impl Freeze for McpServerManager
impl Send for McpServerManager
impl Sync for McpServerManager
impl Unpin for McpServerManager
impl UnsafeUnpin for McpServerManager
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