Skip to main content

McpConnector

Trait McpConnector 

Source
pub trait McpConnector: Send + Sync {
    // Required methods
    fn connect<'life0, 'async_trait>(
        &'life0 self,
        request: Arc<McpBindingRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<ConnectedMcpServer, McpBindingError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trusted host adapter for transport establishment and complete discovery. Implementations must use the request’s snapshot and credential revision, preserve reconnect inputs, and cancel partial resources when dropped.

Required Methods§

Source

fn connect<'life0, 'async_trait>( &'life0 self, request: Arc<McpBindingRequest>, ) -> Pin<Box<dyn Future<Output = Result<ConnectedMcpServer, McpBindingError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Establish an owned single-server registry and discover every tool page.

§Errors

Report secret-free failures; missing tools/list pages are not success.

Source

fn shutdown<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Close admission and join cleanup, including cancelled partial attempts.

§Errors

Report a cleanup failure instead of claiming all resources were reaped.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§