Anubis.Protocol
(anubis_mcp v1.0.0)
Copy Markdown
MCP protocol version management.
Provides version validation, negotiation, feature detection, and transport
compatibility checking. Delegates version-specific logic to modules under
Anubis.Protocol.* via Anubis.Protocol.Registry.
Adding a new protocol version
- Create a new module under
lib/anubis/protocol/implementingAnubis.Protocol.Behaviour - Register it in
Anubis.Protocol.Registry
Summary
Functions
Returns transport modules that support a protocol version.
Returns the fallback protocol version for compatibility.
Returns the set of features supported by a protocol version.
Returns the protocol module for a given version string.
Returns the latest supported protocol version.
Negotiates protocol version between client and server versions.
Returns all supported protocol versions.
Checks if a feature is supported by a protocol version.
Validates client configuration for protocol compatibility.
Validates if a transport is compatible with a protocol version.
Validates if a protocol version is supported.
Types
Functions
Returns transport modules that support a protocol version.
@spec fallback_version() :: version()
Returns the fallback protocol version for compatibility.
Returns the set of features supported by a protocol version.
Delegates to the version module's supported_features/0 callback.
Returns the protocol module for a given version string.
Examples
iex> Anubis.Protocol.get_module("2025-06-18")
{:ok, Anubis.Protocol.V2025_06_18}
@spec latest_version() :: version()
Returns the latest supported protocol version.
@spec negotiate_version(version(), version()) :: {:ok, version()} | {:error, Anubis.MCP.Error.t()}
Negotiates protocol version between client and server versions.
Returns the best compatible version or an error if incompatible.
@spec supported_versions() :: [version()]
Returns all supported protocol versions.
Checks if a feature is supported by a protocol version.
@spec validate_client_config(version(), module(), map()) :: :ok | {:error, Anubis.MCP.Error.t()}
Validates client configuration for protocol compatibility.
This function checks if the client configuration is compatible with the specified protocol version, including transport and capabilities.
@spec validate_transport(version(), module()) :: :ok | {:error, Anubis.MCP.Error.t()}
Validates if a transport is compatible with a protocol version.
@spec validate_version(version()) :: :ok | {:error, Anubis.MCP.Error.t()}
Validates if a protocol version is supported.