//! `ckg mcp` — MCP server over stdio. Phase 11.
use std::path::PathBuf;

use anyhow::Result;
use clap::Args as ClapArgs;

#[derive(ClapArgs, Debug)]
pub struct Args {
    #[arg(long, default_value = "stdio")]
    pub transport: String,
}

pub fn run(_home: Option<PathBuf>, args: Args) -> Result<()> {
    let _ = args.transport;
    // Single-threaded async runtime for stdio JSON-RPC.
    let rt = tokio::runtime::Builder::new_current_thread()
        .enable_all()
        .build()?;
    rt.block_on(async { ckg_mcp::run().await })?;
    Ok(())
}
