Skip to main content

outrig_cli/cli/
mcp_self.rs

1//! CLI entry point for `outrig mcp self`.
2
3use crate::cli::mcp::McpArgs;
4use crate::error::{OutrigError, Result};
5
6pub async fn execute(args: &McpArgs) -> Result<i32> {
7    if args.image.is_some() {
8        return Err(OutrigError::Configuration(
9            "`outrig mcp self` does not select an image; remove --image".to_string(),
10        )
11        .into());
12    }
13    if args.session_dir.is_some() {
14        return Err(OutrigError::Configuration(
15            "`outrig mcp self` does not create a session; remove --session-dir".to_string(),
16        )
17        .into());
18    }
19    if args.attach.is_some() {
20        return Err(OutrigError::Configuration(
21            "`outrig mcp self` does not attach to a container; remove --attach".to_string(),
22        )
23        .into());
24    }
25    if args.listen.is_some() {
26        return Err(OutrigError::Configuration(
27            "`outrig mcp self` serves stdio only; remove --listen".to_string(),
28        )
29        .into());
30    }
31
32    crate::mcp_self::serve_stdio().await
33}