Class McpClient.Builder

java.lang.Object
org.apache.juneau.rest.client.mcp.AbstractMcpClient.Builder<McpClient.Builder>
org.apache.juneau.rest.client.mcp.v20260728.McpClient.Builder
Enclosing class:
McpClient

Fluent builder for McpClient.
Since:
10.0.0
  • Constructor Details

  • Method Details

    • clientCapabilities

      Sets the client capabilities stamped into every request's params._meta.clientCapabilities.
      Parameters:
      value - The client capabilities. Must not be null.
      Returns:
      This object.
    • clientInfo

      Sets the client identity stamped into every request's params._meta.clientInfo.
      Parameters:
      value - The client identity. Can be null to omit clientInfo from every request.
      Returns:
      This object.
    • traceFieldsSupplier

      Sets the per-call supplier of W3C trace-context fields (traceparent/tracestate/ baggage) stamped into every request's params._meta.
      Parameters:
      value - The supplier, invoked once per call. Can be null (no trace-context fields are stamped). A supplier that returns null for a given call is treated the same as returning an empty map for that call.
      Returns:
      This object.
    • responseCache

      Sets the opt-in response cache used to serve repeat identical calls without a round trip.

      A cached result instance may be handed back as-is (not re-marshaled) to more than one caller when the same cache key hits more than once; callers must not mutate a returned result if they cannot guarantee exclusive ownership of it.

      Parameters:
      value - The response cache, or null (the default) to disable caching entirely.
      Returns:
      This object.
    • build

      public McpClient build()
      Builds the client.
      Returns:
      A new McpClient. Never null.