use clap::{Parser, Subcommand};
use super::help;
use crate::runtime::{EXIT_SUCCESS, ExitCode};
#[derive(Parser, Default)]
#[command(
name = "mcp",
about = "Manage MCP server configurations",
color = clap::ColorChoice::Auto
)]
pub struct McpArgs {
#[command(subcommand)]
pub command: Option<McpCommands>,
}
#[derive(Subcommand)]
pub enum McpCommands {
List,
Add {
name: String,
#[arg(value_name = "CONFIG")]
config: Option<String>,
},
Remove {
name: String,
},
Doctor,
Auth {
name: String,
},
Logout {
name: String,
},
}
pub fn handle(args: &McpArgs) -> ExitCode {
let Some(cmd) = &args.command else {
return help::print_subcommand_help::<McpArgs>();
};
match cmd {
McpCommands::List => {
help::unimplemented("MCP list — not yet implemented");
EXIT_SUCCESS
}
McpCommands::Add { name, config } => {
help::unimplemented(&format!(
"MCP add — not yet implemented (name: {name}, config: {})",
config.as_deref().unwrap_or("<interactive>")
));
EXIT_SUCCESS
}
McpCommands::Remove { name } => {
help::unimplemented(&format!("MCP remove — not yet implemented (name: {name})"));
EXIT_SUCCESS
}
McpCommands::Doctor => {
help::unimplemented("MCP doctor — not yet implemented");
EXIT_SUCCESS
}
McpCommands::Auth { name } => {
help::unimplemented(&format!("MCP auth — not yet implemented (name: {name})"));
EXIT_SUCCESS
}
McpCommands::Logout { name } => {
help::unimplemented(&format!("MCP logout — not yet implemented (name: {name})"));
EXIT_SUCCESS
}
}
}