Class StreamableHttpMcpTransport.Builder
java.lang.Object
dev.langchain4j.mcp.client.transport.http.StreamableHttpMcpTransport.Builder
- Enclosing class:
StreamableHttpMcpTransport
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()customHeaders(Map<String, String> customHeaders) The request headers of the MCP server.An optionalExecutorthat will be used for executing requests and handling responses.logger(org.slf4j.Logger logger) Sets a customLoggerto be used for traffic logging (both requests and responses).logRequests(boolean logRequests) Whether to log all requests that are sent over this transport.logResponses(boolean logResponses) Whether to log all responses received over this transport.The connection timeout (applied on the http client level).The URL of the MCP server.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
url
The URL of the MCP server. -
customHeaders
The request headers of the MCP server. -
timeout
The connection timeout (applied on the http client level). Application-level timeouts are handled by the MCP client itself. -
logRequests
Whether to log all requests that are sent over this transport. -
logResponses
Whether to log all responses received over this transport. -
logger
Sets a customLoggerto be used for traffic logging (both requests and responses). This logger will be used for both regular HTTP responses and Server-Sent Events (SSE) traffic. If not specified, a default logger will be used.- Parameters:
logger- an alternateLoggerto be used instead of the default one provided by Langchain4J for traffic logging.- Returns:
this.
-
executor
An optionalExecutorthat will be used for executing requests and handling responses. -
build
-