Package dev.tachyonmcp.core.server
Interface ServerBuilder
public interface ServerBuilder
Configures and builds a
TachyonServer; call TachyonServer.start() to bind its transport.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Constructs the configured server without starting its transport, then executes the configured feature-registration callbacks.Builds the immutable server configuration.capabilities(Consumer<CapabilitiesConfig.Builder> configurer) Configures advertised MCP capabilities.executor(ExecutorService executor) Sets a caller-owned thread-per-task executor.extension(ServerExtension extension) Registers a server extension.Sets the bind host.info(Consumer<ServerIdentity.Builder> configurer) Configures server identity.json(Consumer<JsonConfig.Builder> configurer) Configures JSON serialization and validation.monitoring(Consumer<MonitoringConfig.Builder> configurer) Configures monitoring.Sets the server name.network(Consumer<NetworkConfig.Builder> configurer) Configures the network transport.pipelineCustomizer(@Nullable Consumer<io.netty.channel.ChannelPipeline> customizer) Customizes each Netty channel pipeline.port(int port) Sets the listen port.runtime(Consumer<RuntimeConfig.Builder> configurer) Configures handler execution.session(Consumer<SessionConfig.Builder> configurer) Configures session lifecycle and persistence.threadFactory(ThreadFactory threadFactory) Sets the thread factory used by the server-owned thread-per-task executor.Sets the server version.withCompletions(Consumer<Completions> registrar) Registers completions through the server's completion façade at the end ofbuild().withPrompts(Consumer<Prompts> registrar) Registers prompts through the server's prompt façade at the end ofbuild().withResources(Consumer<Resources> registrar) Registers resources through the server's resource façade at the end ofbuild().Registers tools through the server's tool façade at the end ofbuild().
-
Method Details
-
info
Configures server identity. -
capabilities
Configures advertised MCP capabilities. -
session
Configures session lifecycle and persistence. -
network
Configures the network transport. -
runtime
Configures handler execution. -
monitoring
Configures monitoring. -
json
Configures JSON serialization and validation. -
name
Sets the server name. -
port
Sets the listen port. -
version
Sets the server version. -
host
Sets the bind host. -
withTools
Registers tools through the server's tool façade at the end ofbuild(). -
withResources
Registers resources through the server's resource façade at the end ofbuild(). -
withPrompts
Registers prompts through the server's prompt façade at the end ofbuild(). -
withCompletions
Registers completions through the server's completion façade at the end ofbuild(). -
extension
Registers a server extension. -
executor
Sets a caller-owned thread-per-task executor. The caller must close the executor after the server is closed.build()rejects bounded executors with anIllegalArgumentException. -
threadFactory
Sets the thread factory used by the server-owned thread-per-task executor. -
pipelineCustomizer
@ExperimentalApi ServerBuilder pipelineCustomizer(@Nullable Consumer<io.netty.channel.ChannelPipeline> customizer) Customizes each Netty channel pipeline. -
build
TachyonServer build()Constructs the configured server without starting its transport, then executes the configured feature-registration callbacks.- Throws:
IllegalArgumentException- if the configured executor is bounded
-
buildConfig
ServerConfig buildConfig()Builds the immutable server configuration.
-