modelcontextprotocol / modelcontextprotocol/typescript-sdk

sse timeout set dont work & always close after 5mins

Open
#876 5 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.