modelcontextprotocol / modelcontextprotocol/typescript-sdk
Streamable HTTP: JSON-response-mode stream mappings never complete their lifecycle
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13.4k
- Forks
- 2.2k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 4
Description
With enableJsonResponse: true on a stateful transport, send() resolves the pending Response via resolveJson but never runs the mapping's cleanup, so every completed POST leaks one _streamMapping entry until close(). Conversely, cleanup only deletes the entry without settling the promise, so close() during an in-flight JSON-mode POST leaves the HTTP request hanging.
Pre-existing on both main and v1.x. Split out from the review discussion on #2547.
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 stateful transport's send(), resolveJson, cleanup, and close paths, following _streamMapping for enableJsonResponse requests. Reproduce both a completed POST and close during an in-flight POST, then add coverage showing completed mappings are removed and closed requests settle.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100