modelcontextprotocol / modelcontextprotocol/typescript-sdk
sse timeout set dont work & always close after 5mins
Open
Nobody has claimed this yet.
bug
fix proposed
improves spec compliance
P2
ready for work
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
Describe the bug
always res.on('close') tigger when 5mins after.
To Reproduce
app.get('/sse', async (req, res) => {
// Create SSE transport for legacy clients
const transport = new SSEServerTransport('/messages', res);
transports.sse[transport.sessionId] = transport;
res.on("close", () => {
delete transports.sse[transport.sessionId];
});
await server.connect(transport);
});
Expected behavior
to set a bigger timeout
callTool(xx,undefined, {timeout: 20mins})
but dont work
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the SSEServerTransport entry point and trace how the connection close and timeout are handled for the reproduced /sse route. Check how the callTool timeout option is passed, then reproduce the five-minute disconnect and verify that a larger timeout keeps the SSE connection open as expected.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100