Anubis.Transport.Behaviour behaviour (anubis_mcp v0.17.0)
Defines the behavior that all transport implementations must follow.
Summary
Callbacks
Returns the list of MCP protocol versions supported by this transport.
Types
@type message() :: String.t()
The JSON-RPC message encoded
@type reason() :: term() | Anubis.MCP.Error.t()
@type t() :: GenServer.server()
Callbacks
@callback send_message(t(), message(), [opt]) :: :ok | {:error, reason()} when opt: {:timeout, pos_integer()}
@callback start_link(keyword()) :: GenServer.on_start()
@callback supported_protocol_versions() :: [String.t()] | :all
Returns the list of MCP protocol versions supported by this transport.
Examples
iex> MyTransport.supported_protocol_versions()
["2024-11-05", "2025-03-26"]