# `AshAi.Mcp.Client.Connection`
[🔗](https://github.com/ash-project/ash_ai/blob/v1.5.6/lib/ash_ai/mcp/client/connection.ex#L5)

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.

# `t`

```elixir
@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()]
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
