Streamable HTTP server: keep alive on, 30 minutes by default

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
This commit is contained in:
Daniel Garnier-Moiroux 2026-09-16 14:21:48 +02:00 • committed by Daniel Garnier-Moiroux
commit 9948eecbb7

View file

@ -996,7 +996,7 @@ public class HttpServletStreamableServerTransportProvider extends HttpServlet
private McpTransportContextExtractor<HttpServletRequest> contextExtractor = (
serverRequest) -> McpTransportContext.EMPTY;
private Duration keepAliveInterval;
private Duration keepAliveInterval = Duration.ofMinutes(30);
private ServerHttpHeaderValidator httpHeaderValidator = ServerHttpHeaderValidator.NOOP;
@ -1055,7 +1055,7 @@ public class HttpServletStreamableServerTransportProvider extends HttpServlet
* Sets the keep-alive interval for the transport. If set, a keep-alive scheduler
* will be activated to periodically ping active sessions.
* @param keepAliveInterval The interval for keep-alive pings. If null, no
* keep-alive will be scheduled.
* keep-alive will be scheduled. Defaults to 30 minutes.
* @return this builder instance
*/
public Builder keepAliveInterval(Duration keepAliveInterval) {