pub struct McpHandler { /* private fields */ }Expand description
MCP bridge owner.
Implementations§
Source§impl McpHandler
impl McpHandler
Sourcepub async fn load(configs: &[McpServerConfig]) -> Self
pub async fn load(configs: &[McpServerConfig]) -> Self
Load MCP servers from the given configs at startup.
Sourcepub async fn list(&self) -> Vec<(String, Vec<String>)>
pub async fn list(&self) -> Vec<(String, Vec<String>)>
List all connected servers with their tool names.
Sourcepub fn cached_list(&self) -> Vec<(String, Vec<String>)>
pub fn cached_list(&self) -> Vec<(String, Vec<String>)>
Sync access to the cached server→tools list (populated at load time).
Sourcepub fn try_bridge(&self) -> Option<Arc<McpBridge>>
pub fn try_bridge(&self) -> Option<Arc<McpBridge>>
Try to get a clone of the current bridge Arc without blocking.
Source§impl McpHandler
impl McpHandler
Sourcepub fn register_tools(&self, registry: &mut ToolRegistry)
pub fn register_tools(&self, registry: &mut ToolRegistry)
Register the mcp tool schema into the registry.
Auto Trait Implementations§
impl !Freeze for McpHandler
impl !RefUnwindSafe for McpHandler
impl Send for McpHandler
impl Sync for McpHandler
impl Unpin for McpHandler
impl UnsafeUnpin for McpHandler
impl !UnwindSafe for McpHandler
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