# `ExMCP.Server.Subscriptions.Adapter`
[🔗](https://github.com/azmaveth/ex_mcp/blob/v1.4.0/lib/ex_mcp/server/subscriptions/adapter.ex#L1)

Storage contract for modern MCP subscription registrations.

The bundled ETS adapter is node-local. Clustered HTTP deployments can use
`ExMCP.Server.Subscriptions.PubSub`, which combines node-local listener
storage with cluster publication fan-out, or provide their own adapter.

The optional callbacks let an adapter broadcast an untargeted publication
and translate a cluster message back into a local publication. Storage
callbacks are still serialized by the owning subscription registry.

# `adapter_state`

```elixir
@type adapter_state() :: term()
```

# `all`

```elixir
@callback all(adapter_state()) ::
  {[ExMCP.Server.Subscriptions.Entry.t()], adapter_state()}
```

# `broadcast`
*optional* 

```elixir
@callback broadcast(String.t(), map(), pid() | nil, adapter_state()) ::
  {:ok, adapter_state()} | {:error, term(), adapter_state()}
```

# `delete`

```elixir
@callback delete(String.t(), adapter_state()) :: {:ok, adapter_state()}
```

# `handle_info`
*optional* 

```elixir
@callback handle_info(term(), adapter_state()) ::
  {:publish, String.t(), map(), pid() | nil, adapter_state()}
  | {:noreply, adapter_state()}
  | :unhandled
```

# `init`

```elixir
@callback init(keyword()) :: {:ok, adapter_state()} | {:error, term()}
```

# `put`

```elixir
@callback put(ExMCP.Server.Subscriptions.Entry.t(), adapter_state()) ::
  {:ok, adapter_state()} | {:error, term(), adapter_state()}
```

---

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