ExMCP.Reliability.Supervisor (ex_mcp v0.9.2)

View Source

Supervisor for reliability components in ExMCP.

Manages circuit breakers, health checks, and provides integrated reliability features for MCP clients and servers.

Usage

# Add to your supervision tree
children = [
  {ExMCP.Reliability.Supervisor, name: MyApp.Reliability}
]

# Or start manually
{:ok, sup} = ExMCP.Reliability.Supervisor.start_link()

# Create reliability-enhanced client
{:ok, client} = ExMCP.Reliability.Supervisor.create_reliable_client(
  sup,
  transport: :stdio,
  circuit_breaker: [
    failure_threshold: 5,
    reset_timeout: 30_000
  ],
  retry: [
    max_attempts: 3,
    backoff_factor: 2
  ],
  health_check: [
    check_interval: 60_000,
    failure_threshold: 3
  ]
)

Summary

Functions

Returns a specification to start this module under a supervisor.

Creates a reliability-enhanced MCP client.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

create_reliable_client(supervisor \\ __MODULE__, opts)

@spec create_reliable_client(
  Supervisor.supervisor(),
  keyword()
) :: {:ok, pid()} | {:error, term()}

Creates a reliability-enhanced MCP client.

This wraps a standard MCP client with circuit breaker, retry logic, and health monitoring.

Options

  • :transport - Transport configuration for the client
  • :circuit_breaker - Circuit breaker options (optional)
  • :retry - Retry configuration (optional)
  • :health_check - Health check configuration (optional)

start_link(opts \\ [])