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

Copy Markdown View Source

Seals and verifies opaque MCP multi-round-trip request state.

State is encoded as bounded JSON and authenticated with AES-256-GCM. The key ring is runtime configuration; ExMCP never provides or persists a fallback secret.

Summary

Types

error()

@type error() ::
  :request_state_not_configured
  | :invalid_request_state_configuration
  | :invalid_request_state
  | :request_state_expired
  | :request_state_not_yet_valid
  | :request_state_key_revoked
  | :request_state_key_unknown
  | :request_state_too_large
  | :request_state_binding_mismatch
  | :input_response_ids_mismatch
  | :request_state_not_json

Functions

seal(application_state, binding, opts \\ [])

@spec seal(term(), map(), keyword()) :: {:ok, String.t()} | {:error, error()}

unseal(token, context, params, input_responses, opts \\ [])

@spec unseal(String.t(), ExMCP.Server.RequestContext.t(), map(), map(), keyword()) ::
  {:ok, map()} | {:error, error()}

validate_configuration(opts \\ [])

@spec validate_configuration(keyword()) :: :ok | {:error, error()}

Validates that an active 256-bit key is present in the runtime key ring.