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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the client.Sets the client capabilities stamped into every request'sparams._meta.clientCapabilities.clientInfo(Implementation value) Sets the client identity stamped into every request'sparams._meta.clientInfo.responseCache(McpResponseCache value) Sets the opt-in response cache used to serve repeat identical calls without a round trip.traceFieldsSupplier(Supplier<Map<String, String>> value) Sets the per-call supplier of W3C trace-context fields (traceparent/tracestate/baggage) stamped into every request'sparams._meta.Methods inherited from class org.apache.juneau.rest.client.mcp.AbstractMcpClient.Builder
endpoint, interceptor, self, transport
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
clientCapabilities
Sets the client capabilities stamped into every request'sparams._meta.clientCapabilities.- Parameters:
value- The client capabilities. Must not benull .- Returns:
- This object.
-
clientInfo
Sets the client identity stamped into every request'sparams._meta.clientInfo.- Parameters:
value- The client identity. Can benull to omitclientInfofrom every request.- Returns:
- This object.
-
traceFieldsSupplier
Sets the per-call supplier of W3C trace-context fields (traceparent/tracestate/baggage) stamped into every request'sparams._meta.- Parameters:
value- The supplier, invoked once per call. Can benull (no trace-context fields are stamped). A supplier that returnsnull 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, ornull (the default) to disable caching entirely.- Returns:
- This object.
-
build
Builds the client.- Returns:
- A new
McpClient. Nevernull .
-