Skip to content

Commit c1cc11c

Browse files
committed
Streamable HTTP server: keep alive on, 30 minutes by default
Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
1 parent 3f6ce3e commit c1cc11c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎mcp-core/src/main/java/io/modelcontextprotocol/server/transport/HttpServletStreamableServerTransportProvider.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ public static class Builder {
996996
private McpTransportContextExtractor<HttpServletRequest> contextExtractor = (
997997
serverRequest) -> McpTransportContext.EMPTY;
998998

999-
private Duration keepAliveInterval;
999+
private Duration keepAliveInterval = Duration.ofMinutes(30);
10001000

10011001
private ServerHttpHeaderValidator httpHeaderValidator = ServerHttpHeaderValidator.NOOP;
10021002

@@ -1055,7 +1055,7 @@ public Builder contextExtractor(McpTransportContextExtractor<HttpServletRequest>
10551055
* Sets the keep-alive interval for the transport. If set, a keep-alive scheduler
10561056
* will be activated to periodically ping active sessions.
10571057
* @param keepAliveInterval The interval for keep-alive pings. If null, no
1058-
* keep-alive will be scheduled.
1058+
* keep-alive will be scheduled. Defaults to 30 minutes.
10591059
* @return this builder instance
10601060
*/
10611061
public Builder keepAliveInterval(Duration keepAliveInterval) {

0 commit comments

Comments
 (0)