Conversation
This was referenced Sep 15, 2026
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.
Closes #22
Problem
The SDK had two possible owners for the MCP HTTP endpoint:
Both paths could process requests such as ping, initialize, tools/list, and tools/call. This could produce different protocol responses, session behaviour, headers, and error handling depending on which path handled the request.
The duplicate sidecar also contained its own ping helper and transport exports, which were no longer needed once the official MCP SDK became the owner of the HTTP lifecycle.
Proposed solution
Make the official MCP SDK the only owner of
/mcp.The application should:
Implementation details
Modified
nitrostack/core/app.pyRemoved the
wrap_stateless_transport(...)wrapper fromget_combined_app().The method now returns the HTTP app created by
build_http_app()directly. A comment explains that the official MCP SDK owns the complete Streamable HTTP request lifecycle and that a second dispatcher must not be introduced.Deleted
nitrostack/transports/middleware.pyThis file implemented the duplicate stateless transport wrapper around the official MCP app. It was deleted because the official SDK now owns request validation, dispatch, protocol handling, and response generation.
Deleted
nitrostack/transports/dispatch.pyThis file implemented the duplicate JSON-RPC sidecar dispatcher and its request interception logic. It was deleted because maintaining a second dispatcher could cause the sidecar and official SDK to disagree.
Modified
nitrostack/protocol/jsonrpc.pyRemoved the standalone
build_ping_response()helper. Ping requests are now handled by the official MCP SDK.Modified
nitrostack/__init__.pyRemoved public exports for:
wrap_stateless_transportStatelessIngressPipelineThese symbols belonged to the deleted sidecar implementation.
Modified
nitrostack/protocol/__init__.pyRemoved the obsolete
build_ping_responseexport.Modified
nitrostack/transports/__init__.pyRemoved exports for the deleted sidecar classes and helpers, including:
DispatchStageIngressContextStatelessIngressPipelineStatelessTransportMiddlewarewrap_stateless_transportis_task_wire_interceptionThe module now exposes only the remaining official transport helpers.
Modified
nitrostack/transports/http.pyUpdated the middleware documentation to state that it only normalises transport headers and does not perform JSON-RPC dispatch.
Added
tests/test_mcp22_official_http_owner.pyAdded focused regression tests proving that:
/mcp/healthremains available.Mcp-Session-Id.-32601method-not-found error.Verification
pytest -q tests/test_mcp22_official_http_owner.py— 5 tests passed.git diff --checkpassed.Result
The
/mcpendpoint now has one clear owner: the official MCP SDK Streamable HTTP implementation. This removes conflicting request paths, keeps protocol behaviour consistent, and makes future MCP 2026 changes safer to maintain.