diff options
| author | main <main@swarm.moe> | 2026-03-20 21:19:07 -0400 |
|---|---|---|
| committer | main <main@swarm.moe> | 2026-03-20 21:19:07 -0400 |
| commit | c9337a12e5a64087be760460259bdc747e49a2d6 (patch) | |
| tree | e8657446564121d035f3d42b058d25907af7704c /crates/jira-at-home/src/main.rs | |
| download | jira_at_home-c9337a12e5a64087be760460259bdc747e49a2d6.zip | |
Bootstrap minimal issue MCP
Diffstat (limited to 'crates/jira-at-home/src/main.rs')
| -rw-r--r-- | crates/jira-at-home/src/main.rs | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/crates/jira-at-home/src/main.rs b/crates/jira-at-home/src/main.rs new file mode 100644 index 0000000..932bc63 --- /dev/null +++ b/crates/jira-at-home/src/main.rs @@ -0,0 +1,64 @@ +mod mcp; +mod store; + +use std::path::PathBuf; + +use clap::{Args, Parser, Subcommand}; +#[cfg(test)] +use libmcp_testkit as _; + +#[derive(Parser)] +#[command( + author, + version, + about = "Per-project issue notebook 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(McpServeArgs), + /// Run the disposable worker process. + Worker(McpWorkerArgs), +} + +#[derive(Args)] +struct McpServeArgs { + /// Optional project path to bind immediately on startup. + #[arg(long)] + project: Option<PathBuf>, +} + +#[derive(Args)] +struct McpWorkerArgs { + /// Bound project root. + #[arg(long)] + project: PathBuf, + /// Logical worker generation assigned by the host. + #[arg(long)] + generation: u64, +} + +fn main() -> Result<(), Box<dyn std::error::Error>> { + let cli = Cli::parse(); + match cli.command { + Command::Mcp { command } => match command { + McpCommand::Serve(args) => mcp::run_host(args.project)?, + McpCommand::Worker(args) => mcp::run_worker(args.project, args.generation)?, + }, + } + Ok(()) +} |