aether_cli/
mcp_config_args.rs1use aether_core::mcp::{McpConfig, ParseError};
2use std::path::{Path, PathBuf};
3
4#[derive(Clone, Debug, Default, clap::Args)]
5pub struct McpConfigArgs {
6 #[arg(long = "mcp-config", value_name = "PATH")]
7 pub mcp_configs: Vec<PathBuf>,
8
9 #[arg(long = "mcp-config-json", value_name = "JSON")]
10 pub mcp_config_jsons: Vec<String>,
11}
12
13impl McpConfigArgs {
14 pub fn load(&self, project_root: &Path) -> Result<McpConfig, ParseError> {
15 let files = self.mcp_configs.iter().map(|path| McpConfig::from_json_file(project_root.join(path)));
16 let jsons = self.mcp_config_jsons.iter().map(|json| McpConfig::from_json(json));
17 files.chain(jsons).collect()
18 }
19}