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_factory: Option<OAuthHandlerFactory>, ) -> Self
pub fn with_aether_home(self, aether_home: impl Into<PathBuf>) -> Self
pub fn with_oauth_credential_store( self, store: Arc<dyn OAuthCredentialStorage>, ) -> Self
pub async fn register_pending( &mut self, servers: Vec<McpServer>, ) -> Result<Vec<McpServer>>
pub async fn bootstrap_proxy_setup( &mut self, servers: &[McpServer], ) -> Result<()>
pub fn connect_pending_task( &self, server: McpServer, ) -> impl Future<Output = McpConnectAttempt> + Send + 'static
pub async fn add_mcps(&mut self, servers: Vec<McpServer>) -> 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) -> BTreeMap<String, String>
pub fn server_statuses(&self) -> Vec<McpServerStatusEntry>
pub async fn authenticate_server_task( &mut self, name: &str, ) -> Result<impl Future<Output = McpConnectAttempt> + Send + 'static>
pub async fn apply_connection_attempt(&mut self, attempt: McpConnectAttempt)
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
Sourcepub async fn set_roots(&mut self, new_roots: Vec<Root>) -> Result<()>
pub async fn set_roots(&mut self, new_roots: Vec<Root>) -> Result<()>
Set the roots advertised to MCP servers.
This updates the roots and sends notifications to all connected servers
that support the roots/list_changed notification.
pub async fn emit_connection_ready(&self)
Trait Implementations§
Source§impl Drop for McpManager
impl Drop for McpManager
Auto Trait Implementations§
impl !RefUnwindSafe for McpManager
impl !UnwindSafe for McpManager
impl Freeze for McpManager
impl Send for McpManager
impl Sync for McpManager
impl Unpin for McpManager
impl UnsafeUnpin 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