//! Arguments for `mcptest mcp-server`.
//!
//! Replaces the standalone `mcptest-mcp-server` binary so users only
//! install one CLI. Agent configs reference
//! `mcptest mcp-server --workspace .` instead of a sibling binary.

use std::path::PathBuf;

use clap::Args;

/// Arguments for `mcptest mcp-server`.
///
/// The subcommand spawns a stdio MCP server that exposes the mcptest
/// engine to local agents (Claude Code, Cursor, mcp-inspector). The
/// agent registers the command in its MCP server config; mcptest
/// drives the JSON-RPC loop over stdin / stdout.
#[derive(Debug, Args)]
pub struct McpServerArgs {
    /// Workspace root (defaults to the current directory).
    #[arg(long, value_name = "PATH")]
    pub workspace: Option<PathBuf>,

    /// Enable write tools (`trigger_run`, `record_cassette`). Off by
    /// default so an agent cannot accidentally mutate the workspace
    /// or spend on real provider calls without explicit opt-in.
    #[arg(long = "enable-writes")]
    pub enable_writes: bool,

    /// Override the path to the mcptest CLI binary the write tools
    /// spawn. Useful when the agent runs a debug build or a sibling
    /// install. Defaults to the current `mcptest` binary on PATH.
    #[arg(long = "mcptest-bin", value_name = "PATH")]
    pub mcptest_bin: Option<String>,

    /// Register mcptest as an MCP server in an agent config and exit, instead
    /// of starting the server. Writes a `mcptest` entry into the config's
    /// `mcpServers` map (default `.claude/mcp.json` under the workspace),
    /// preserving every other server. Pair with `--enable-writes` to register
    /// the write verbs.
    #[arg(long = "install")]
    pub install: bool,

    /// Target config file for `--install`. Defaults to `.claude/mcp.json`
    /// under the workspace (the project-local Claude Code config).
    #[arg(long = "install-path", value_name = "PATH")]
    pub install_path: Option<PathBuf>,
}
