AshAi.Mcp.Client.Connection (ash_ai v1.5.6)

Copy Markdown View Source

A server and the protocol details AshAi.Mcp.Client.connect/1 settled on.

  • era is :modern for revisions that carry their version on every request (2026-07-28 on) and :legacy for the initialize-based revisions.
  • session_id is the legacy Mcp-Session-Id, or nil.
  • server_info, capabilities, and instructions come from server/discover or initialize, when the client made one of those requests.

Holds no process or socket; Req pools the HTTP connections underneath.

Summary

Types

t()

@type t() :: %AshAi.Mcp.Client.Connection{
  capabilities: map(),
  era: :modern | :legacy,
  instructions: String.t() | nil,
  protocol_version: String.t(),
  server: AshAi.Mcp.Client.Server.t(),
  server_info: map() | nil,
  session_id: String.t() | nil,
  supported_versions: [String.t()]
}