Skip to content

Feature/issue 23 http factory - #36

Open
jpsiddharth2008 wants to merge 2 commits into
nitrocloudofficial:mainfrom
jpsiddharth2008:feature/issue-23-http-factory
Open

jpsiddharth2008 wants to merge 2 commits into
nitrocloudofficial:mainfrom
jpsiddharth2008:feature/issue-23-http-factory

Conversation

@jpsiddharth2008

@jpsiddharth2008 jpsiddharth2008 commented Sep 15, 2026

Copy link
Copy Markdown

What this does

  • After [mcp-2026] Remove JSON-RPC sidecar; one /mcp owner (official mcp 2.x) #22 removed the JSON-RPC sidecar, the official mcp SDK became the sole owner of /mcp, but four era-dependent behaviors were left disagreeing between the two engines that used to share it.
  • resources.subscribe now comes from one source (protocol_era != "modern") shared by NitroStackMcpServer.get_capabilities(), server/discover, and the real _subscribe_resource handler — previously get_capabilities() hardcoded True and discover hardcoded False, both wrong for at least one era.
  • /json/version now reports protocol_version_for_era(protocol_era) instead of a hardcoded 2025-06-18.
  • CORS is down to one implementation point — Starlette's CORSMiddleware in build_http_app — and it now actually reads MCP_CORS_ALLOWED_ORIGINS instead of hardcoding allow_origins=["*"].
  • stdio.py's modern era loop no longer imports the private mcp.server.runner._serve_modern_stream; rebuilt from public mcp.server.runner APIs (JSONRPCDispatcher, modern_on_request, Connection, ServerRunner, NotifyOnlyOutbound, aclose_shielded).
  • Depends on [mcp-2026] Remove JSON-RPC sidecar; one /mcp owner #34 (branched from it; merge [mcp-2026] Remove JSON-RPC sidecar; one /mcp owner #34 first).

Test plan

  • pytest tests/test_transport_http.py tests/test_lifecycle_http.py tests/test_mcp20_stdio.py tests/test_transports.py -q — the issue's own verify command → 31 passed
  • pytest tests/test_mcp23_http_factory.py tests/test_mcp22_official_http_owner.py -v — new tests covering the issue's 5-point checklist, plus [mcp-2026] Remove JSON-RPC sidecar; one /mcp owner #34's regression tests → 15 passed
  • Full suite → 561 passed, 0 failed (excluded items independently confirmed pre-existing on [mcp-2026] Remove JSON-RPC sidecar; one /mcp owner #34's base or flaky Windows socket tests, not regressions from this branch)
  • Manual: boot examples/calculator_server.py with NITRO_MCP_PROTOCOL_VERSION=modern|auto|legacy and confirm GET /json/version and server/discover's resources.subscribe track the chosen era

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants