Skip to content

Commit cd284ca

Browse files
docs(server): document the keepAliveInterval transport option
1 parent 94125e7 commit cd284ca

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

docs/server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const transport = new NodeStreamableHTTPServerTransport({
4848
await server.connect(transport);
4949
```
5050

51-
**Options:** Set `sessionIdGenerator` to a function (shown above) for stateful sessions. Set it to `undefined` for stateless mode (simpler, but does not support resumability). Set `enableJsonResponse: true` to return plain JSON instead of SSE streams.
51+
**Options:** Set `sessionIdGenerator` to a function (shown above) for stateful sessions. Set it to `undefined` for stateless mode (simpler, but does not support resumability). Set `enableJsonResponse: true` to return plain JSON instead of SSE streams. Set `keepAliveInterval` (milliseconds) to write periodic SSE keepalive comments on open streams, so proxies and load balancers do not drop idle connections during long-running requests.
5252

5353
For a complete server with sessions, logging, and CORS mounted on Express, see [`simpleStreamableHttp.ts`](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/examples/server/src/simpleStreamableHttp.ts).
5454

0 commit comments

Comments
 (0)