use anyhow::Context;
use clap::Args;
use std::path::PathBuf;
#[derive(Args)]
pub(crate) struct ServeArgs {
#[arg(long)]
pub(crate) mcp: bool,
#[arg(long)]
pub(crate) path: Option<PathBuf>,
}
pub(crate) fn run_serve(args: ServeArgs) -> anyhow::Result<()> {
if args.mcp {
let rt = tokio::runtime::Runtime::new().context("failed to create tokio runtime")?;
rt.block_on(crate::mcp_server::serve(crate::mcp_server::McpConfig {
path: args.path,
}))
} else {
anyhow::bail!("`serve` requires --mcp (other serve modes not yet implemented)");
}
}