diff --git a/crates/q_cli/src/cli/mod.rs b/crates/q_cli/src/cli/mod.rs index 429323b040..49bcf60032 100644 --- a/crates/q_cli/src/cli/mod.rs +++ b/crates/q_cli/src/cli/mod.rs @@ -201,6 +201,7 @@ pub enum CliRootCommands { args: Vec, }, /// Model Context Protocol (MCP) + #[command(disable_help_flag = true)] Mcp { /// Args for the MCP subcommand (passed through to `qchat mcp …`) #[arg(trailing_var_arg = true, allow_hyphen_values = true)] @@ -352,7 +353,12 @@ impl Cli { CliRootCommands::Version { changelog } => Self::print_version(changelog), CliRootCommands::Dashboard => launch_dashboard(false).await, CliRootCommands::Chat { args } => Self::execute_chat("chat", Some(args), true).await, - CliRootCommands::Mcp { args } => Self::execute_chat("mcp", Some(args), true).await, + CliRootCommands::Mcp { args } => { + if args.iter().any(|arg| ["--help", "-h"].contains(&arg.as_str())) { + return Self::execute_chat("mcp", Some(vec!["--help".to_owned()]), false).await; + } + Self::execute_chat("mcp", Some(args), true).await + }, CliRootCommands::Inline(subcommand) => subcommand.execute(&cli_context).await, }, // Root command