Class McpServerInfo.Builder<T extends McpServerInfo.Builder<T>>
java.lang.Object
com.github.thought2code.mcp.annotated.server.McpServerInfo.Builder<T>
- Type Parameters:
T- the type of the builder
- Direct Known Subclasses:
McpSseServerInfo.Builder,McpStreamableServerInfo.Builder
- Enclosing class:
- McpServerInfo
The builder class for
McpServerInfo.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected McpServerCapabilitiesThe capabilities of the MCP server.protected McpServerChangeNotificationThe change notification of the MCP server.protected StringThe instructions of the MCP server.protected StringThe name of the MCP server.protected DurationThe request timeout of the MCP server.protected StringThe version of the MCP server. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a new instance ofMcpServerInfowith the specified configuration.capabilities(McpServerCapabilities capabilities) Sets the capabilities of the MCP server.changeNotification(McpServerChangeNotification changeNotification) Sets the change notification of the MCP server.instructions(String instructions) Sets the instructions of the MCP server.Sets the name of the MCP server.requestTimeout(Duration requestTimeout) Sets the request timeout of the MCP server.protected Tself()Returns the self reference of the builder, which is used to chain the method calls and ensure the subclasses ofMcpServerInfocan also inherit the builder methods with parameterized type.Sets the version of the MCP server.
-
Field Details
-
name
The name of the MCP server. Default value is"mcp-server". -
version
The version of the MCP server. Default value is"1.0.0". -
instructions
The instructions of the MCP server. Default value isStringHelper.EMPTY. -
requestTimeout
The request timeout of the MCP server. Default value is20seconds. -
capabilities
The capabilities of the MCP server. Default value isMcpServerCapabilities.getDefault(). -
changeNotification
The change notification of the MCP server. Default value isMcpServerChangeNotification.getDefault().
-
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
self
Returns the self reference of the builder, which is used to chain the method calls and ensure the subclasses ofMcpServerInfocan also inherit the builder methods with parameterized type.- Returns:
- the self reference of the builder
-
build
Builds a new instance ofMcpServerInfowith the specified configuration.- Returns:
- a new instance of
McpServerInfo
-
name
Sets the name of the MCP server.- Parameters:
name- the name of the MCP server- Returns:
- the self reference of the builder
-
version
Sets the version of the MCP server.- Parameters:
version- the version of the MCP server- Returns:
- the self reference of the builder
-
instructions
Sets the instructions of the MCP server.- Parameters:
instructions- the instructions of the MCP server- Returns:
- the self reference of the builder
-
requestTimeout
Sets the request timeout of the MCP server.- Parameters:
requestTimeout- the request timeout of the MCP server- Returns:
- the self reference of the builder
-
capabilities
Sets the capabilities of the MCP server.- Parameters:
capabilities- the capabilities of the MCP server- Returns:
- the self reference of the builder
-
changeNotification
Sets the change notification of the MCP server.- Parameters:
changeNotification- the change notification of the MCP server- Returns:
- the self reference of the builder
-