ExMCP.ACP.AdapterTransport (ex_mcp v1.3.0)

Copy Markdown View Source

ExMCP.Transport implementation that delegates to an AdapterBridge.

This lets ACP.Client use adapted (non-native) agents identically to native ACP agents:

{:ok, client} = ACP.Client.start_link(
  transport_mod: AdapterTransport,
  adapter: Adapters.ClaudeSDK,
  adapter_opts: [model: "sonnet"]
)

The transport starts an AdapterBridge on connect, which in turn launches the agent subprocess and handles protocol translation.

Native event metadata

With the :native_events option, every ACP message the adapter derives from a native agent line carries _meta.ex_mcp.native with the adapter name and a per-connection sequence number:

  • :off (default) - no native block; the wire shape is unchanged
  • :summary - adapter name and sequence only
  • :raw - also embeds the decoded native event under event (or the unparsed line under raw); this can make updates much larger and the retained data counts toward the client's :max_update_queue_bytes

For session/update the block sits on the update's _meta; for other agent-to-client requests it sits on params._meta; for responses on result._meta.