Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

The bug in InMemoryEventStore break SSE stream resumability

Open Beginner friendly
#943 4 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@Genmin is already working on this.

Since Apr 29, 2026.

  • #1978 by @Genmin — open
  • #1984 by @Genmin — open

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
Domain
api, backend

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

bug fix proposed P2 ready for work

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:

  1. Create a tool with at least 2 elicitation requests.
  2. Call the tool.
  3. 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

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.

More from modelcontextprotocol/typescript-sdk

All issues in modelcontextprotocol/typescript-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.