Class NetworkConfig.Builder
java.lang.Object
dev.tachyonmcp.core.server.config.NetworkConfig.Builder
- Enclosing class:
NetworkConfig
Builder for
NetworkConfig.-
Method Summary
Modifier and TypeMethodDescriptionaddress(SocketAddress addr) Sets the bind address and port from aSocketAddress.allowedHeaders(String... headers) Sets additional allowed CORS headers.allowedOrigins(String... origins) Sets the CORS allowed origins.allowNullOrigin(boolean allow) Sets whether to allowOrigin: null.allowPrivateNetworks(boolean allow) Sets whether to allow private network CORS.build()Builds theNetworkConfig.endpointPath(String endpointPath) Sets the HTTP path for MCP endpoints.heartbeatInterval(Duration heartbeatInterval) Sets the SSE heartbeat interval for silent listening streams.Sets the bind address.ioEngine(NettyIoEngine ioEngine) Sets the Netty I/O engine; defaults toNettyIoEngine.AUTO.maxContentLength(int bytes) Sets the maximum HTTP body size in bytes (must be positive).port(int port) Sets the listen port.readerIdleTimeout(Duration timeout) Sets the reader idle timeout.writerIdleTimeout(Duration timeout) Sets the writer idle timeout.
-
Method Details
-
host
Sets the bind address. Mutually exclusive withaddress(java.net.SocketAddress). -
port
Sets the listen port. Mutually exclusive withaddress(java.net.SocketAddress). -
address
-
endpointPath
Sets the HTTP path for MCP endpoints. -
readerIdleTimeout
Sets the reader idle timeout. -
writerIdleTimeout
Sets the writer idle timeout. -
maxContentLength
Sets the maximum HTTP body size in bytes (must be positive). -
allowedOrigins
Sets the CORS allowed origins. -
allowNullOrigin
Sets whether to allowOrigin: null. -
allowPrivateNetworks
Sets whether to allow private network CORS. -
allowedHeaders
Sets additional allowed CORS headers. -
ioEngine
Sets the Netty I/O engine; defaults toNettyIoEngine.AUTO. -
heartbeatInterval
Sets the SSE heartbeat interval for silent listening streams.<= 0(Duration.ZEROor negative) disables heartbeats. Default is 15s. Must be below the session TTL (default 30s) to keep a listening client alive out of the box. -
build
Builds theNetworkConfig.
-