ExMCP.Client.Subscription (ex_mcp v1.0.0-rc.8)

Copy Markdown View Source

A client-owned MCP 2026-07-28 subscription stream.

Use open/3 with an immutable notification filter. The call returns only after the server's notifications/subscriptions/acknowledged message. Events are delivered to the subscribing process as:

{:ex_mcp_subscription, subscription, method, params}

If a transport reconnects, the process re-opens the desired filter with a fresh JSON-RPC request ID and emits a resynchronization notification.

Summary

Types

Functions

cancel(ref, reason \\ nil)

@spec cancel(ExMCP.Client.Subscription.Ref.t(), String.t() | nil) :: :ok

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

current(ref)

@spec current(ExMCP.Client.Subscription.Ref.t()) ::
  {:ok, ExMCP.Client.Subscription.Ref.t()} | {:error, atom()}

open(client, filter, opts \\ [])

@spec open(GenServer.server(), map(), keyword()) ::
  {:ok, ExMCP.Client.Subscription.Ref.t()} | {:error, term()}

status(ref)

@spec status(ExMCP.Client.Subscription.Ref.t()) :: map()