The bug in InMemoryEventStore break SSE stream resumability
Maintainers usually reply within 1 day
@Genmin is already working on this.
Since Apr 29, 2026.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- typescript
Research direction
Start in src/examples/shared/inMemoryEventStore.ts and compare generateEventId, getStreamIdFromEventId, and replayEventsAfter with the stream handling in src/server/streamableHttp.ts. Reproduce the two-elicitation reconnect scenario, then verify that the Last-Event-ID is parsed consistently and previously emitted events are returned when the SSE stream resumes.
Written by the indexing model from the issue text.
Description
Describe the bug
The standalong sse stream Id is coded to _GET_stream and the current InMemoryEventStore generate event Ids in the format -
${streamId}-${Date.now()}_${Math.random().toString(36).substring(2, 10)}
The replayEventsAfter(...) is called when client try to re-connect and resume the stream which further calls getStreamIdFromEventId(...) -
// Extract the stream ID from the event ID
const streamId = this.getStreamIdFromEventId(lastEventId);
if (!streamId) {
return '';
}
The issue is that getStreamIdFromEventId(...) will always return an empty string as the streamId due to the current eventId format and the code will return from this if check.
To Reproduce
Steps to reproduce the behavior:
- Create a tool with at least 2 elicitation requests.
- Call the tool.
- Try to reconnect with SSE stream - nothing will be returned.
Expected behavior
MCP client should be able to re-connect to SSE stream.
Fix
The fix could be to use a different delimiter than underscore when combining streamId with rest of the eventId.
Used dash("-") in below sample fix -
/**
* Generates a unique event ID for a given stream ID
*/
private generateEventId(streamId: string): string {
---> return `${streamId}**-**${Date.now()}_${Math.random().toString(36).substring(2, 10)}`;
}
/**
* Extracts the stream ID from an event ID
*/
private getStreamIdFromEventId(eventId: string): string {
---> const parts = eventId.split('**-**');
return parts.length > 0 ? parts[0] : '';
}
- Dominant language
- TypeScript
- Stars
- 13.5k
- Forks
- 2.3k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 54
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from modelcontextprotocol/typescript-sdk
-
v1 v2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelcontextprotocol/typescript-sdk#2946 ·
Maintainers usually reply within 1 day
-
[v2] URI template reserved expansions encode existing %HH sequences againPossibly taken @takagibit18 claimed this 3 days ago. Openv1 v2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/typescript-sdk#2920 · 1 comment ·
Maintainers usually reply within 1 day
-
[v2] URI template strict expansions leave !'()* unencodedPossibly taken @takagibit18 claimed this 3 days ago. Openv1 v2
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/typescript-sdk#2919 · 1 comment ·
Maintainers usually reply within 1 day
-
Malformed params on spec request methods return -32603 Internal error instead of -32602 Invalid paramsPossibly taken A pull request linked to this issue is open or already merged. Openv1 v2
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/typescript-sdk#2916 · 3 comments ·
Maintainers usually reply within 1 day
-
Unconditional `prompt=consent` (when `offline_access` in scope) blocks OAuth in Entra tenants with user consent disabled + admin consent grantedPossibly taken @dasjideepak claimed this 9 days ago. Openv1 v2
Difficulty 1/5 Under an hour Newbie friendliness 90/100
modelcontextprotocol/typescript-sdk#2867 · 1 comment ·
Maintainers usually reply within 1 day
All issues in modelcontextprotocol/typescript-sdk
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug:new
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
callstackincubator/simlock#350 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openwatersio/maritime-zones#33 ·
Maintainers usually reply within 1 day
-
Booking email verification fails for plus aliases with impersonation protection enabledPossibly taken @kankadev claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
calcom/cal.diy#30293 · 1 comment ·
Maintainers usually reply within 5 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
AOSSIE-Org/DebateAI#611 ·
Maintainers usually reply within 3 days