-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Describe the bug
While reviewing the source code, I noticed that the close method is never actually called, which means res.end is never triggered:
https://github.com/modelcontextprotocol/typescript-sdk/blob/main/src/server/sse.ts
In multiple places, it seems like onclose is called directly when close should be used instead, to ensure proper cleanup.
To Reproduce
I created a minimal reproduction here:
https://github.com/nichtsam/transport-issue
Steps to reproduce the behavior:
npm run startnpx @modelcontextprotocol/inspector- connect to
http://localhost:3001/sse - disconnect
Expected behavior
res.end should be called via the close method to cleanly terminate the SSE connection.
TranquilMarmot