Skip to content

Commit dac5c54

Browse files
zeko.zhangtzolov
zeko.zhang
authored andcommitted
Fix issue, SSE connection will terminate after 30 seconds (DEFAULT).
1 parent c69cc18 commit dac5c54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

mcp-spring/mcp-spring-webmvc/src/main/java/io/modelcontextprotocol/server/transport/WebMvcSseServerTransport.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
package io.modelcontextprotocol.server.transport;
66

77
import java.io.IOException;
8+
import java.time.Duration;
89
import java.util.UUID;
910
import java.util.concurrent.ConcurrentHashMap;
1011
import java.util.function.Function;
@@ -228,7 +229,7 @@ private ServerResponse handleSseConnection(ServerRequest request) {
228229
logger.error("Failed to poll event from session queue: {}", e.getMessage());
229230
sseBuilder.error(e);
230231
}
231-
});
232+
}, Duration.ZERO);
232233
}
233234
catch (Exception e) {
234235
logger.error("Failed to send initial endpoint event to session {}: {}", sessionId, e.getMessage());

0 commit comments

Comments
 (0)