Class McpMrtrConfig

java.lang.Object
org.apache.juneau.rest.server.mcp.v20260728.McpMrtrConfig

public class McpMrtrConfig extends Object
Binding-owned MRTR (Multi-Round-Trip Request) configuration for a v2 McpRevision.

Mirrors McpCacheConfig's exact placement precedent (spec Open item #2): MRTR is as 2026-07-28-only as cache hints, so its configuration lives here, on the v2 adapter, never on the revision-neutral McpServerConfig.

Mutable during setup, effectively immutable once published. This is a builder-less mutable-setup bean: its fluent setters exist to configure it during construction, but a binding must fully configure it before handing it to a McpRevision and must never mutate it afterward. The dispatcher reads the codec/TTL/max-rounds on every request with no synchronization, so a post-publication mutation is a data race; treat a published instance as read-only.

Defaults: AeadRequestStateCodec (a fresh instance per McpMrtrConfig), a 5-minute requestState TTL, a max-rounds cap of 10, a per-process InMemoryReplayCache (single-use tokens; see setReplayCache(ReplayCache)), and a Clock.systemUTC() clock for stamping and checking token expiry (see setClock(Clock)). Operators inject a shared/rotating-key RequestStateCodec here for multi-instance or restart-durable resumption.

Trust model:

  • requestState is a bearer token for its principal. Anyone holding a sealed requestState and authenticated as the same principal can resume the paused operation until it expires. It must be transported only over authenticated TLS and never logged (it is opaque ciphertext, but logging it hands a replayable credential to anyone with log access). See RequestStateCodec.
  • Single-use by default. The default InMemoryReplayCache rejects a second submission of the same token within its TTL; it is per-process only, so cross-node single-use requires a shared ReplayCache (see setReplayCache(ReplayCache)). Passing null disables the check, and a handler must then write idempotent resume side effects.