Feature/issue 24 wire alignment - #37
Open
jpsiddharth2008 wants to merge 2 commits into
Open
jpsiddharth2008 wants to merge 2 commits into
jpsiddharth2008 wants to merge 2 commits into
Conversation
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 #24
Builds on #34 (#22) and #36 (#23) — this branch is stacked on top of
feature/issue-23-http-factory, since neither has merged todevelopyet. Please merge those first.Summary
pingis retired forauto/modern(onlylegacykeeps it) — the officialmcpSDK answerspingby default on every era unless explicitly told not to; NitroStack now opts out viaNitroStackMcpServer.set_protocol_era().-32021(MISSING_REQUIRED_CLIENT_CAPABILITY) toJsonRpcErrorCode— unused until the Tasks issue wires a live path for it, per [mcp-2026] Align 2026 wire: drop ping, add -32021, discover _meta, MUST headers #24's own acceptance criteria.server/discover's result_metanow carriesserverInfo, in addition to the existing top-level copy (kept forauto/legacy back-compat).resultTypeis now stamped ontools/list,tools/call,resources/list,resources/templates/list,resources/read,prompts/list,prompts/get— not onlydiscover/task-create/MRTR as before.build_sessionless_initialize_result,handle_sessionless_initialize(both copies),discover_handler/initialize_handlerattributes onNitroStackMcpServer, the old optional-header validators injsonrpc.py, and the unusedMethodContract/MODERN_METHOD_CONTRACTSmachinery inmethod_contract.py(kept only the still-usedDEPRECATED_MODERN_METHODS/rejects_deprecated_method).mcpSDK already fully implements SEP-2243 MUST-header validation itself (mcp.shared.inbound.classify_inbound_request), triggered automatically whenever a client sends anMCP-Protocol-Versionheader the 2025 handshake doesn't recognize — independent of NitroStack's ownprotocol_era. I initially built a duplicate NitroStack-level validator per the issue's literal wording, then found this and removed it rather than ship a second implementation of the same ladder (exactly the anti-pattern [mcp-2026] Remove JSON-RPC sidecar; one /mcp owner (official mcp 2.x) #22/[mcp-2026] Unify HTTP factory: CORS once, subscribe flag, public stdio APIs #23 already removed). The new tests prove the SDK's existing behavior instead of re-testing NitroStack code that no longer exists.Test plan
pytest tests/test_mcp24_wire_alignment.py tests/test_mcp23_http_factory.py tests/test_mcp22_official_http_owner.py tests/test_transport_http.py tests/test_lifecycle_http.py tests/test_mcp20_stdio.py tests/test_transports.py— new tests covering the issue's full "Test / verify" table, plus every existing mcp-2026 regression file → 58 passedexamples/calculator_server.pyand a scaffoldedpython-pizzazproject over HTTP, confirmed/mcp/health,tools/list, and widget metadata all work end-to-endNote for reviewers
Filed a separate follow-up investigation (not part of this PR):
server/discoverreturns "method not found" when called via the plain 2025-shaped stateless dispatch path with noMCP-Protocol-Versionheader — root cause is the official SDK's own spec-version gate (_methods.validate_client_request) rejecting NitroStack's extension method at the default negotiated version. Confirmed unrelated to this PR's changes; needs its own fix in the sidecar-free architecture.