Skip to main content

run

Function run 

Source
pub async fn run(
    action: ServerAction,
    output_format: OutputFormat,
) -> Result<ExitCode>
Expand description

Runs the server command.

Manages server listing, detailed info, and validation. All server definitions are loaded from ~/.claude/mcp.json.

§Arguments

  • action - Server management action
  • output_format - Output format (json, text, pretty)

§Errors

Returns an error if the server operation fails.

§Examples

use mcp_execution_cli::commands::server;
use mcp_execution_core::cli::{ExitCode, OutputFormat};

let result = server::run(
    mcp_execution_cli::ServerAction::List,
    OutputFormat::Json
).await;
assert!(result.is_ok());