use std::future::Future;
use std::pin::Pin;
use crate::context::CommandContext;
use crate::{CommandError, CommandHandler, CommandOutput, SlashCategory};
pub struct McpCommand;
impl CommandHandler<CommandContext<'_>> for McpCommand {
fn name(&self) -> &'static str {
"/mcp"
}
fn description(&self) -> &'static str {
"Manage MCP server connections"
}
fn args_hint(&self) -> &'static str {
"add|list|tools|remove"
}
fn category(&self) -> SlashCategory {
SlashCategory::Integration
}
fn handle<'a>(
&'a self,
ctx: &'a mut CommandContext<'_>,
args: &'a str,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput, CommandError>> + Send + 'a>> {
Box::pin(async move {
let output = ctx.agent.handle_mcp(args).await?;
Ok(CommandOutput::Message(output))
})
}
}