Class McpResponseWriter
java.lang.Object
dev.tachyonmcp.core.transport.netty.McpResponseWriter
-
Method Summary
Modifier and TypeMethodDescriptionstatic io.netty.channel.ChannelFuturesendInternalError(io.netty.channel.ChannelHandlerContext ctx, RequestId id, @Nullable String origin, ProtocolResponseMapper mapper) Writes a JSON-RPC internal-error response and closes the connection, for a dispatch failure that occurred after a POST-SSE stream had already started (so the normal response path can no longer send a result).static io.netty.channel.ChannelFuturesendJsonResponse(io.netty.channel.ChannelHandlerContext ctx, byte[] body, io.netty.handler.codec.http.HttpResponseStatus status, boolean close, @Nullable String sessionId, @Nullable String origin) static io.netty.channel.ChannelFuturesendJsonResponse(io.netty.channel.ChannelHandlerContext ctx, byte[] body, io.netty.handler.codec.http.HttpResponseStatus status, @Nullable String sessionId, @Nullable String origin) static io.netty.channel.ChannelFuturesendJsonResponse(io.netty.channel.ChannelHandlerContext ctx, byte[] body, @Nullable String sessionId, @Nullable String origin) static voidsendOptions(io.netty.channel.ChannelHandlerContext ctx, @Nullable String origin)
-
Method Details
-
sendOptions
-
sendJsonResponse
-
sendJsonResponse
-
sendJsonResponse
-
sendInternalError
public static io.netty.channel.ChannelFuture sendInternalError(io.netty.channel.ChannelHandlerContext ctx, RequestId id, @Nullable String origin, ProtocolResponseMapper mapper) Writes a JSON-RPC internal-error response and closes the connection, for a dispatch failure that occurred after a POST-SSE stream had already started (so the normal response path can no longer send a result).- Parameters:
ctx- the channel to write the response onid- the id of the request that failedorigin- the request'sOriginheader value, echoed via CORS headers, ornullmapper- the protocol response mapper used to encode the error- Returns:
- the future for the write
-