Package com.tnsai.mcp.client
Class McpClient.Builder
java.lang.Object
com.tnsai.mcp.client.McpClient.Builder
- Enclosing class:
McpClient
Builder for creating McpClient instances.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the McpClient instance.clientName(String clientName) Sets the client name for initialization.clientVersion(String clientVersion) Sets the client version for initialization.requestTimeout(Duration timeout) Sets the request timeout.Sets the initial roots to advertise to the server.Sets the handler for server-initiated sampling requests.transport(McpTransport transport) Sets the transport to use.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
transport
Sets the transport to use.- Parameters:
transport- the transport- Returns:
- this builder
-
clientName
Sets the client name for initialization.- Parameters:
clientName- the client name- Returns:
- this builder
-
clientVersion
Sets the client version for initialization.- Parameters:
clientVersion- the client version- Returns:
- this builder
-
requestTimeout
Sets the request timeout.- Parameters:
timeout- the timeout duration- Returns:
- this builder
-
roots
Sets the initial roots to advertise to the server.- Parameters:
roots- the list of roots- Returns:
- this builder
-
samplingRequestHandler
Sets the handler for server-initiated sampling requests.- Parameters:
handler- the sampling request handler- Returns:
- this builder
-
build
Builds the McpClient instance.- Returns:
- a new McpClient
-