pub struct McpManager { /* private fields */ }Expand description
Manages connections to multiple MCP servers and their tools
Implementations§
Source§impl McpManager
impl McpManager
pub fn new( event_sender: Sender<McpClientEvent>, oauth_handler: Option<Arc<dyn OAuthHandler>>, ) -> Self
pub async fn add_mcps(&mut self, configs: Vec<McpServerConfig>) -> Result<()>
pub async fn add_mcp_with_auth( &mut self, name: String, base_url: &str, auth_header: String, ) -> Result<()>
pub async fn add_mcp(&mut self, config: McpServerConfig) -> Result<()>
pub fn get_client_for_tool( &self, namespaced_tool_name: &str, arguments_json: &str, ) -> Result<(Arc<RunningService<RoleClient, McpClient>>, CallToolRequestParams)>
pub fn tool_definitions(&self) -> Vec<ToolDefinition>
pub fn server_instructions(&self) -> Vec<ServerInstructions>
pub fn server_statuses(&self) -> &[McpServerStatusEntry]
pub async fn authenticate_server(&mut self, name: &str) -> Result<()>
Sourcepub async fn list_prompts(&self) -> Result<Vec<Prompt>>
pub async fn list_prompts(&self) -> Result<Vec<Prompt>>
List all prompts from all connected MCP servers with namespacing
Sourcepub async fn get_prompt(
&self,
namespaced_prompt_name: &str,
arguments: Option<Map<String, Value>>,
) -> Result<GetPromptResult>
pub async fn get_prompt( &self, namespaced_prompt_name: &str, arguments: Option<Map<String, Value>>, ) -> Result<GetPromptResult>
Get a specific prompt by namespaced name
Sourcepub async fn shutdown_server(&mut self, server_name: &str) -> Result<()>
pub async fn shutdown_server(&mut self, server_name: &str) -> Result<()>
Shutdown a specific server by name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for McpManager
impl !RefUnwindSafe for McpManager
impl Send for McpManager
impl Sync for McpManager
impl Unpin for McpManager
impl UnsafeUnpin for McpManager
impl !UnwindSafe for McpManager
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