ConduitMcp.Client.ServerInfo (ConduitMCP v0.11.0)

Copy Markdown View Source

A server's self-reported Implementation (serverInfo).

Legacy servers return it in the initialize result; modern servers put it in _meta["io.modelcontextprotocol/serverInfo"] of their results. The spec says it is self-reported and SHOULD NOT drive behaviour or security, so it is display data only: hub naming and policy never read it.

raw keeps the whole string-keyed wire map, including keys this struct does not lift into fields (such as icons).

Summary

Functions

Builds a ServerInfo from a wire Implementation map.

Types

t()

@type t() :: %ConduitMcp.Client.ServerInfo{
  description: String.t() | nil,
  name: String.t(),
  raw: map(),
  title: String.t() | nil,
  version: String.t() | nil,
  website_url: String.t() | nil
}

Functions

from_wire(map)

@spec from_wire(term()) :: {:ok, t()} | {:error, ConduitMcp.Client.Error.t()}

Builds a ServerInfo from a wire Implementation map.

name must be a string. version is required by the schema, but some servers omit it, so a missing or non-string version reads as nil.

iex> {:ok, info} = ConduitMcp.Client.ServerInfo.from_wire(%{"name" => "srv", "version" => "1.0"})
iex> {info.name, info.version}
{"srv", "1.0"}