Per-MCP-server GenServer. Owns one Client and the cached tool catalog.
Lifecycle:
init/1registers in the Registry and sends itself:boot.handle_info(:boot, ...)starts theClient, runstools/list, caches tools.- Status transitions:
:starting→:ready(success) or:degraded(failure).
Linked to its Client: if the Client crashes, this process also crashes so the
Supervisor can restart both.
Summary
Functions
Forward a tool call to the underlying client. Returns {:ok, result_map} or {:error, reason}.
Returns a specification to start this module under a supervisor.
Return {:ok, client_pid} when ready, {:error, reason} otherwise.
Return metadata map for list_servers/0.
Return cached tools. {:ok, [tool_map]} when ready, {:error, reason} otherwise.
Start and link a server process registered under cfg.name.
Functions
@spec call_tool(GenServer.server(), String.t(), map(), non_neg_integer()) :: {:ok, map()} | {:error, term()}
Forward a tool call to the underlying client. Returns {:ok, result_map} or {:error, reason}.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_client(GenServer.server()) :: {:ok, pid()} | {:error, term()}
Return {:ok, client_pid} when ready, {:error, reason} otherwise.
@spec info(GenServer.server()) :: {:ok, map()}
Return metadata map for list_servers/0.
@spec list_tools(GenServer.server()) :: {:ok, [map()]} | {:error, term()}
Return cached tools. {:ok, [tool_map]} when ready, {:error, reason} otherwise.
@spec start_link(ExAthena.Mcp.Config.Server.t()) :: GenServer.on_start()
Start and link a server process registered under cfg.name.