MCP.Client behaviour (fnord v0.9.37)
View SourceFacade for the Hermes MCP client runtime: the VM-global MCP.Supervisor
and the per-server Hermes client GenServers it supervises.
Every Hermes touch point in fnord routes through this module so tests can
substitute a Mox double (Fnord.TestCase.mock_mcp_client/0) instead of
booting real server transports. The real implementation lives in
MCP.Client.Default.
Callbacks are keyed by server name (the key in Settings.MCP config),
not by client pid or atom - resolving the registered process for a server
is an implementation detail of the runtime.
Summary
Callbacks
Invokes a tool on a connected server, returning the unwrapped result.
True when the server's client process is registered and alive.
Fetches the capabilities map negotiated with a connected server.
Lists the tools advertised by a connected server.
Starts the MCP supervisor (idempotent) and detaches it from the caller.
The Hermes stack is VM-global and must outlive the process that happened
to trigger it; see MCP.Client.Default for the unlink rationale.
Callbacks
@callback call_tool( server :: String.t(), tool :: String.t(), args :: map(), opts :: keyword() ) :: {:ok, term()} | {:error, term()}
Invokes a tool on a connected server, returning the unwrapped result.
True when the server's client process is registered and alive.
Fetches the capabilities map negotiated with a connected server.
Lists the tools advertised by a connected server.
@callback start_supervisor() :: :ok | {:error, term()}
Starts the MCP supervisor (idempotent) and detaches it from the caller.
The Hermes stack is VM-global and must outlive the process that happened
to trigger it; see MCP.Client.Default for the unlink rationale.