fix(http): create a server instance per request in stateless HTTP mode - #121
Merged
rbuchmayer-pplx merged 1 commit intoJul 27, 2026
Conversation
rbuchmayer-pplx
force-pushed
the
fix-http-stateless-transport
branch
2 times, most recently
from
July 23, 2026 04:32
cae26b3 to
81557ad
Compare
rbuchmayer-pplx
marked this pull request as ready for review
July 23, 2026 19:31
akshay-pplx
approved these changes
Jul 23, 2026
The stateless streamable HTTP path reused a single McpServer across requests, but a Protocol instance only supports one transport. The second POST in any session failed with "Already connected to a transport" (HTTP 500), which breaks initialize -> tools/list for every client. Follow the SDK's stateless pattern: build a fresh server + transport pair per request and close both when the response closes.
rbuchmayer-pplx
force-pushed
the
fix-http-stateless-transport
branch
from
July 27, 2026 16:12
81557ad to
9ca242e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stateless HTTP mode reuses one McpServer across requests, but a Protocol instance only supports one transport, so the second POST in any session 500s with "Already connected to a transport". MCP init is itself a POST, so every HTTP client breaks on its first real request (
npm run start:httpand Docker HTTP mode)./healthtestFixes #117.