HexpmMcp.MCP.StdioLifecycle (hexpm_mcp v0.3.8)

Copy Markdown View Source

Serves the CLI's stdio connection and exits with its transport outcome.

The serving task owns the transport lifecycle through Stdio.serve/2, which installs its monitor before starting input. Immediate EOF therefore cannot race a separately started lifecycle monitor. EOF waits for admitted requests to finish before a clean exit.

Transport failures are reported to stderr and exit with status 1. A consumed stdio stream cannot be reconnected by restarting a supervised child.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

arg is passed as the argument to Task.start_link/1 in the :start field of the spec.

For more information, see the Supervisor module, the Supervisor.child_spec/2 function and the Supervisor.child_spec/0 type.

start_link(opts)

@spec start_link(keyword()) :: {:ok, pid()}