Interface ServerEngine
- All Superinterfaces:
AutoCloseable,TachyonServer
Engine SPI for MCP server internals. Extends the user-facing
TachyonServer with the full
set of methods needed by transport, dispatch, registries, and session management.
Not a stability contract. This interface lives in an internal
package for a reason: it may change without notice across minor versions. Only code that ships
inside the tachyon-core jar — transport handlers, dispatch plumbing, registry
implementations — should depend on it. External code that reaches for ServerEngine is
opting into a breakage-prone dependency.
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendEvent(SessionEvent event) Appends an event to the session log.voidbroadcastNotification(String method, Object params) Sends a notification to all active sessions.booleancompletePendingRequest(@Nullable RequestId requestId, String resultJson) Completes a pending client request with the given result JSON.createSession(String sessionId) Creates and registers a new session with the given ID.executor()Returns the executor used for handler dispatch.@Nullable StringextensionForMethod(String method) Returns the extension ID that owns the given method, ornullif none.booleanextensionRequiresMeta(String extensionId) Returnstrueif the given extension requires the meta envelope for its methods.booleanfailPendingRequest(@Nullable RequestId requestId, String message) Fails a pending client request with the given error message.@Nullable RpcMethodHandlergetHandler(String method) Returns the handler for a method, ornullif not registered.@Nullable LoggingLevelgetLoggingLevel(String sessionId) Returns the logging level for a session, ornullif not set.getSession(String sessionId) Returns the session with the given ID, if present.booleanReturnstruewhen running in stateless mode (no session persistence).longReturns and increments the event ID counter.voidnotifyTaskStatus(TaskEntry entry) Maps and sends a task status notification.voidregisterHandler(RpcMethodHandler handler) Registers a method handler keyed by its own method name.voidregisterHandler(String method, RpcMethodHandler handler) Registers a method handler with an explicit method name.voidregisterPendingRequest(RequestId requestId, CompletableFuture<String> future) Registers a pending request with a timeout.voidremoveSession(String sessionId) Removes and closes the session with the given ID.Replays session events after the given sequence number.Resolves effective capabilities based on configuration and registered features.Returns the protocol response mapper for the default MCP version.voidsendNotification(Session session, String method, @Nullable Object params, @Nullable OutboundSseStream stream) Sends a notification to the given session, optionally via a bound outbound SSE stream.voidsendNotification(Session session, String method, Object params) Sends a notification to the given session.sendRequest(Session session, String method, Object params) Sends a request to the client and returns a future that completes with the response.sendRequest(Session session, String method, Object params, @Nullable OutboundSseStream stream) Sends a request to the client, optionally via a bound outbound SSE stream, and returns a future.SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> Returns the configured session id generator.voidsetLoggingLevel(String sessionId, LoggingLevel level) Sets the logging level for a session.static @Nullable SseEventtoSseEvent(SessionEvent event) Converts a session event to an SSE event, or returnsnullfor non-transport events.static StringwireEventId(long sseEventId, @Nullable String streamKey) Formats an SSE wire event id: the global counter value, suffixed with#<streamKey>.Methods inherited from interface dev.tachyonmcp.core.server.TachyonServer
close, completions, config, extensions, host, notifications, port, prompts, resources, start, tasks, tools
-
Method Details
-
responseMapper
ProtocolResponseMapper responseMapper()Returns the protocol response mapper for the default MCP version. -
isStateless
boolean isStateless()Returnstruewhen running in stateless mode (no session persistence). -
sessionIdGenerator
SessionIdGenerator<? super io.netty.handler.codec.http.HttpRequest> sessionIdGenerator()Returns the configured session id generator. -
setLoggingLevel
Sets the logging level for a session. -
getLoggingLevel
Returns the logging level for a session, ornullif not set. -
resolveCapabilities
ServerCapabilities resolveCapabilities()Resolves effective capabilities based on configuration and registered features. -
broadcastNotification
Sends a notification to all active sessions. -
registerHandler
Registers a method handler keyed by its own method name. -
registerHandler
Registers a method handler with an explicit method name. -
getHandler
Returns the handler for a method, ornullif not registered. -
extensionForMethod
Returns the extension ID that owns the given method, ornullif none. -
extensionRequiresMeta
Returnstrueif the given extension requires the meta envelope for its methods. -
createSession
Creates and registers a new session with the given ID. -
getSession
Returns the session with the given ID, if present. -
removeSession
Removes and closes the session with the given ID. -
sendNotification
Sends a notification to the given session. -
sendNotification
void sendNotification(Session session, String method, @Nullable Object params, @Nullable OutboundSseStream stream) Sends a notification to the given session, optionally via a bound outbound SSE stream. -
executor
ExecutorService executor()Returns the executor used for handler dispatch. -
tasksRegistry
TaskRegistry tasksRegistry() -
notifyTaskStatus
Maps and sends a task status notification. -
sendRequest
Sends a request to the client and returns a future that completes with the response. -
sendRequest
CompletableFuture<String> sendRequest(Session session, String method, Object params, @Nullable OutboundSseStream stream) Sends a request to the client, optionally via a bound outbound SSE stream, and returns a future. -
completePendingRequest
Completes a pending client request with the given result JSON.nullrequestId is a no-op. -
failPendingRequest
Fails a pending client request with the given error message.nullrequestId is a no-op. -
registerPendingRequest
Registers a pending request with a timeout. -
appendEvent
Appends an event to the session log. -
replay
Replays session events after the given sequence number. -
nextEventId
long nextEventId()Returns and increments the event ID counter. -
wireEventId
Formats an SSE wire event id: the global counter value, suffixed with#<streamKey>. -
toSseEvent
Converts a session event to an SSE event, or returnsnullfor non-transport events.
-