use crate::cli::parser::McpArgs;
use crate::commands::base::{Command, CommandContext};
use anyhow::Result;
use rudof_mcp::server::{McpConfig, run_mcp};
pub struct McpCommand {
args: McpArgs,
}
impl McpCommand {
pub fn new(args: McpArgs) -> Self {
Self { args }
}
}
impl Command for McpCommand {
fn name(&self) -> &'static str {
"mcp"
}
fn execute(&self, _ctx: &mut CommandContext) -> Result<()> {
let mcp_config = McpConfig {
transport: self.args.transport,
bind_address: self.args.bind_address.clone(),
port: self.args.port,
route_path: self.args.route_path.clone(),
allowed_origins: self.args.allowed_origins.clone(),
allowed_hosts: self.args.allowed_hosts.clone(),
};
run_mcp(mcp_config)?;
Ok(())
}
}