Skip to main content

run

Function run 

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

Runs the setup command.

Validates that the runtime environment is ready for MCP tool execution and renders the results according to output_format.

§Checks Performed

  1. Node.js version: Ensures Node.js 18.0.0 or higher is installed
  2. File permissions: Makes TypeScript files executable (Unix only)
  3. Configuration: Checks if ~/.claude/mcp.json exists

§Examples

# Run setup validation (default pretty output)
mcp-execution-cli setup

# Output:
# ✓ Node.js v20.10.0 detected
# ✓ Runtime setup complete
# Claude Code can now execute MCP tools via:
#   node ~/.claude/servers/<server>/<tool>.ts '{"param":"value"}'

# Structured output for scripting
mcp-execution-cli --format json setup

§Errors

Returns an error if:

  • Node.js is not installed
  • Node.js version is less than 18.0.0
  • Home directory cannot be determined
  • Output formatting fails (serialization error)