pub trait ConfigManager: Send + Sync {
Show 18 methods
// Required methods
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_servers(&self) -> HashMap<String, McpServerConfig>;
fn get_server(&self, name: &str) -> Option<McpServerConfig>;
fn add_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
config: McpServerConfig,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn update_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
config: McpServerConfig,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn remove_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn enable_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn disable_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_enabled_servers(&self) -> HashMap<String, McpServerConfig>;
fn validate(&self, config: &McpServerConfig) -> ValidationResult;
fn validate_all(&self) -> Vec<ServerValidationResult>;
fn save<'life0, 'async_trait>(
&'life0 self,
scope: ConfigScope,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn backup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<PathBuf>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn restore<'life0, 'life1, 'async_trait>(
&'life0 self,
backup_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn export(&self, mask_secrets: bool) -> String;
fn import<'life0, 'life1, 'async_trait>(
&'life0 self,
config_json: &'life1 str,
scope: ConfigScope,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn on_change(
&self,
callback: ConfigChangeCallback,
) -> Box<dyn FnOnce() + Send>;
}Expand description
Configuration manager trait
Defines the interface for managing MCP server configurations.
Required Methods§
Sourcefn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load configurations from files
Sourcefn reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn reload<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Reload configurations
Sourcefn get_servers(&self) -> HashMap<String, McpServerConfig>
fn get_servers(&self) -> HashMap<String, McpServerConfig>
Get all server configurations (merged)
Sourcefn get_server(&self, name: &str) -> Option<McpServerConfig>
fn get_server(&self, name: &str) -> Option<McpServerConfig>
Get a single server configuration
Sourcefn add_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
config: McpServerConfig,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
config: McpServerConfig,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a new server configuration
Sourcefn update_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
config: McpServerConfig,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
config: McpServerConfig,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Update an existing server configuration
Sourcefn remove_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a server configuration
Sourcefn enable_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enable_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Enable a server
Sourcefn disable_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn disable_server<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Disable a server
Sourcefn get_enabled_servers(&self) -> HashMap<String, McpServerConfig>
fn get_enabled_servers(&self) -> HashMap<String, McpServerConfig>
Get enabled servers only
Sourcefn validate(&self, config: &McpServerConfig) -> ValidationResult
fn validate(&self, config: &McpServerConfig) -> ValidationResult
Validate a server configuration
Sourcefn validate_all(&self) -> Vec<ServerValidationResult>
fn validate_all(&self) -> Vec<ServerValidationResult>
Validate all server configurations
Sourcefn save<'life0, 'async_trait>(
&'life0 self,
scope: ConfigScope,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save<'life0, 'async_trait>(
&'life0 self,
scope: ConfigScope,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Save configurations to file
Sourcefn backup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn backup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = McpResult<PathBuf>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Backup current configuration
Sourcefn restore<'life0, 'life1, 'async_trait>(
&'life0 self,
backup_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn restore<'life0, 'life1, 'async_trait>(
&'life0 self,
backup_path: &'life1 Path,
) -> Pin<Box<dyn Future<Output = McpResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Restore configuration from backup