Class McpStreamableServerInfo.Builder
java.lang.Object
com.github.thought2code.mcp.annotated.server.McpServerInfo.Builder<McpStreamableServerInfo.Builder>
com.github.thought2code.mcp.annotated.server.McpStreamableServerInfo.Builder
- Enclosing class:
- McpStreamableServerInfo
public static class McpStreamableServerInfo.Builder
extends McpServerInfo.Builder<McpStreamableServerInfo.Builder>
The builder class for
McpStreamableServerInfo.- See Also:
-
Field Summary
Fields inherited from class com.github.thought2code.mcp.annotated.server.McpServerInfo.Builder
capabilities, changeNotification, instructions, name, requestTimeout, version -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a newMcpStreamableServerInfoinstance with the specified builder.contextExtractor(io.modelcontextprotocol.server.McpTransportContextExtractor<jakarta.servlet.http.HttpServletRequest> contextExtractor) Sets the extractor to extract the transport context from the HTTP request.disallowDelete(boolean disallowDelete) Sets whether to disallow http delete requests.keepAliveInterval(Duration keepAliveInterval) Sets the interval to send keep-alive messages.mcpEndpoint(String mcpEndpoint) Sets the endpoint of the MCP server to send messages.port(int port) Sets the port of the MCP HTTP server.protected McpStreamableServerInfo.Builderself()Returns the self reference of the builder, which is used to chain the method calls.Methods inherited from class com.github.thought2code.mcp.annotated.server.McpServerInfo.Builder
capabilities, changeNotification, instructions, name, requestTimeout, version
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
self
Returns the self reference of the builder, which is used to chain the method calls.- Overrides:
selfin classMcpServerInfo.Builder<McpStreamableServerInfo.Builder>- Returns:
- the self reference of the builder
-
build
Builds a newMcpStreamableServerInfoinstance with the specified builder.- Overrides:
buildin classMcpServerInfo.Builder<McpStreamableServerInfo.Builder>- Returns:
- a new
McpStreamableServerInfoinstance
-
port
Sets the port of the MCP HTTP server.- Parameters:
port- the port of the MCP HTTP server- Returns:
- the self reference of the builder
-
mcpEndpoint
Sets the endpoint of the MCP server to send messages.- Parameters:
mcpEndpoint- the endpoint of the MCP server to send messages- Returns:
- the self reference of the builder
-
disallowDelete
Sets whether to disallow http delete requests.- Parameters:
disallowDelete- whether to disallow http delete requests- Returns:
- the self reference of the builder
-
contextExtractor
public McpStreamableServerInfo.Builder contextExtractor(io.modelcontextprotocol.server.McpTransportContextExtractor<jakarta.servlet.http.HttpServletRequest> contextExtractor) Sets the extractor to extract the transport context from the HTTP request.- Parameters:
contextExtractor- the extractor to extract the transport context from the HTTP request- Returns:
- the self reference of the builder
-
keepAliveInterval
Sets the interval to send keep-alive messages.- Parameters:
keepAliveInterval- the interval to send keep-alive messages- Returns:
- the self reference of the builder
-