aether_cli/
mcp_config_args.rs1use aether_core::agent_spec::McpConfigSource;
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 sources(&self, project_root: &Path) -> Vec<McpConfigSource> {
15 self.mcp_configs
16 .iter()
17 .map(|path| project_root.join(path))
18 .map(McpConfigSource::direct)
19 .chain(self.mcp_config_jsons.iter().cloned().map(McpConfigSource::Json))
20 .collect()
21 }
22}