Repository navigation
4.0.2 fixes a socket leak on the HTTP transport (#682): an MCP client that dropped its connection without DELETE left a socket in CLOSE_WAIT, and they piled up until the server stopped answering. It moves the MCP Kotlin SDK to 0.16.0, adds SSE heartbeats and MCP_SESSION_IDLE_TIMEOUT_MINUTES. There is no migration, so a rollback to 4.0.1 is safe.
Added
MCP_SESSION_IDLE_TIMEOUT_MINUTESsets how long an HTTP MCP session may go without a request (default120). After that, the MCP SDK closes the session within a few seconds, its next request is404, and the client re-initializes. An openGETstream does not count as activity. A blank, zero, negative or non-integer value fails startup naming the variable.
Changed
-
The MCP Kotlin SDK is 0.16.0 (was 0.13.0). What HTTP clients see:
- an idle session ends after 2 hours instead of 24;
- a
GETto/mcpwithoutMcp-Session-Idis400; - a new session while 10,000 are open is
503; - a
POSTwithout a session id that is notinitializeno longer leaves a session behind.
stdio is unchanged.
Fixed
- HTTP
/mcpno longer leaks sockets inCLOSE_WAIT(#682). A client that dropped its connection withoutDELETEleft its session'sGETstream waiting forever. The server never closed the socket, so these piled up until the server stopped answering. Now a stream is cancelled as soon as its client disconnects, and every/mcpSSE stream sends a: heartbeatcomment every 30 seconds, so a peer that vanished without closing is noticed on the next write. /api/v1/eventsreleases a subscriber as soon as its client disconnects, and sends the same 30-second: heartbeatcomment.