ExMCP.Server.Subscriptions (ex_mcp v1.0.0-rc.8)

Copy Markdown View Source

Registry and publication coordinator for MCP 2026-07-28 subscriptions.

Registrations contain no credential material. Each listener is isolated in a monitored process with an acknowledgment-first, bounded queue. The default adapter is node-local; clustered deployments can configure another adapter.

Summary

Types

registry()

@type registry() :: GenServer.server()

Functions

cancel(transport_ref, subscription_id, opts \\ [])

@spec cancel(pid(), ExMCP.Types.request_id(), keyword()) :: :ok

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(transport_ref, subscription_id, reason \\ :server_closed, opts \\ [])

@spec close(pid(), ExMCP.Types.request_id(), atom(), keyword()) ::
  :ok | {:error, :not_found}

delivered(listener)

@spec delivered(pid()) :: :ok

entries(opts \\ [])

listen(subscription_id, requested_filter, transport_ref, opts \\ [])

@spec listen(ExMCP.Types.request_id(), map(), pid(), keyword()) ::
  {:ok, ExMCP.Server.Subscriptions.Entry.t()} | {:error, term()}

publish(method, params \\ %{}, opts \\ [])

@spec publish(String.t(), map(), keyword()) :: %{
  subscribers: non_neg_integer(),
  enqueued: non_neg_integer(),
  coalesced: non_neg_integer(),
  closed: non_neg_integer()
}

remove_transport(transport_ref, opts \\ [])

@spec remove_transport(
  pid(),
  keyword()
) :: :ok

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()