Struct McpManagerClient
pub struct McpManagerClient { /* private fields */ }Expand description
Manages MCP servers and provides a unified interface for tool discovery and invocation.
Implementations§
§impl McpManagerClient
impl McpManagerClient
pub fn new() -> McpManagerClient
pub async fn add_server(
&self,
id: &str,
transport: McpTransport,
) -> Result<(), Box<dyn Error>>
pub async fn add_server( &self, id: &str, transport: McpTransport, ) -> Result<(), Box<dyn Error>>
Registers a new MCP server in the registry, and discovers tools from the server.
pub fn set_dangerous_mode_enabled(&self, enabled: bool)
pub fn get_dangerous_mode_enabled(&self) -> bool
pub async fn list_tools(&self) -> Result<Vec<Tool>, Box<dyn Error>>
pub async fn list_tools(&self) -> Result<Vec<Tool>, Box<dyn Error>>
Lists and caches tools from all connected MCP servers.
pub fn get_latest_tools(&self) -> Vec<Tool>
pub fn get_all_namespaced_tools(&self) -> Vec<Tool>
pub async fn remove_server(&self, id: &str) -> Result<(), Box<dyn Error>>
pub async fn execute_tool_call(
&self,
tool_name: &str,
tool_call_id: &str,
arguments: Map<String, Value>,
) -> ToolResult
pub async fn execute_tool_call( &self, tool_name: &str, tool_call_id: &str, arguments: Map<String, Value>, ) -> ToolResult
Executes a tool call and returns the result
pub async fn execute_tool_calls(
&self,
tool_calls: Vec<ToolCall>,
) -> Vec<ToolResult>
pub async fn execute_tool_calls( &self, tool_calls: Vec<ToolCall>, ) -> Vec<ToolResult>
Executes multiple tool calls sequentially and returns the results
Trait Implementations§
§impl Clone for McpManagerClient
impl Clone for McpManagerClient
§fn clone(&self) -> McpManagerClient
fn clone(&self) -> McpManagerClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for McpManagerClient
impl RefUnwindSafe for McpManagerClient
impl Send for McpManagerClient
impl Sync for McpManagerClient
impl Unpin for McpManagerClient
impl UnwindSafe for McpManagerClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.