From d986442e8e4bc2d716c9d63159a1cfa7b1e6ed76 Mon Sep 17 00:00:00 2001 From: main Date: Sun, 22 Mar 2026 22:20:17 -0400 Subject: Bootstrap consultative Claude Code MCP --- crates/phone-opus/src/main.rs | 51 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 crates/phone-opus/src/main.rs (limited to 'crates/phone-opus/src/main.rs') diff --git a/crates/phone-opus/src/main.rs b/crates/phone-opus/src/main.rs new file mode 100644 index 0000000..79ace26 --- /dev/null +++ b/crates/phone-opus/src/main.rs @@ -0,0 +1,51 @@ +mod mcp; + +use clap::{Args, Parser, Subcommand}; +#[cfg(test)] +use libmcp_testkit as _; + +#[derive(Parser)] +#[command( + author, + version, + about = "Consultative Claude Code MCP with a hardened host/worker spine" +)] +struct Cli { + #[command(subcommand)] + command: Command, +} + +#[derive(Subcommand)] +enum Command { + /// Serve the stdio MCP host. + Mcp { + #[command(subcommand)] + command: McpCommand, + }, +} + +#[derive(Subcommand)] +enum McpCommand { + /// Run the durable stdio host. + Serve, + /// Run the disposable worker process. + Worker(McpWorkerArgs), +} + +#[derive(Args)] +struct McpWorkerArgs { + /// Logical worker generation assigned by the host. + #[arg(long)] + generation: u64, +} + +fn main() -> Result<(), Box> { + let cli = Cli::parse(); + match cli.command { + Command::Mcp { command } => match command { + McpCommand::Serve => mcp::run_host()?, + McpCommand::Worker(args) => mcp::run_worker(args.generation)?, + }, + } + Ok(()) +} -- cgit v1.2.3