MCP.STDIOWrapper (fnord v0.9.29)

View Source

Creates a small executable wrapper for stdio MCP servers.

Hermes' stdio transport reads JSON-RPC from the child's stdout. Many MCP servers also write human-readable logs to stderr.

This module generates a temporary wrapper script that:

  • Executes the real server command (passed as the wrapper's first argument)
  • Captures the server's stderr to a temp file
  • Replays captured stderr only when the server exits non-zero

This keeps successful runs quiet while preserving debugging output for failures.

Summary

Types

path()

@type path() :: binary()

Functions

script_path()

@spec script_path() :: {:ok, path()} | {:error, term()}

script_path!()

@spec script_path!() :: path()