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: Some(self.args.bind_address.to_string()),
port: Some(self.args.port),
route_path: Some(self.args.route_path.to_string()),
allowed_networks: Some(self.args.allowed_networks.clone()),
};
run_mcp(mcp_config)?;
Ok(())
}
}