feat: mcp router extension discovery and install tool (#1995)
Co-authored-by: Alice Hau <ahau@squareup.com>
This commit is contained in:
@@ -63,6 +63,22 @@ impl ExtensionManager {
|
||||
}))
|
||||
}
|
||||
|
||||
pub fn get_config_by_name(name: &str) -> Result<Option<ExtensionConfig>> {
|
||||
let config = Config::global();
|
||||
|
||||
// Try to get the extension entry
|
||||
let extensions: HashMap<String, ExtensionEntry> = match config.get_param("extensions") {
|
||||
Ok(exts) => exts,
|
||||
Err(super::ConfigError::NotFound(_)) => HashMap::new(),
|
||||
Err(_) => HashMap::new(),
|
||||
};
|
||||
|
||||
Ok(extensions
|
||||
.values()
|
||||
.find(|entry| entry.config.name() == name)
|
||||
.map(|entry| entry.config.clone()))
|
||||
}
|
||||
|
||||
/// Set or update an extension configuration
|
||||
pub fn set(entry: ExtensionEntry) -> Result<()> {
|
||||
let config = Config::global();
|
||||
|
||||
Reference in New Issue
Block a user