Skip to content

fix: unify HTTP factory and migrate tests to official MCP transport - #36

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

jpsiddharth2008 wants to merge 7 commits into
nitrocloudofficial:developfrom
jpsiddharth2008:feature/issue-23-http-factory

Conversation

@jpsiddharth2008

@jpsiddharth2008 jpsiddharth2008 commented Sep 15, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Closes #23. Depends on #34; merge #34 first.

Complete the HTTP factory migration after removal of the duplicate JSON-RPC
sidecar. Official MCP 2.x remains the sole owner of /mcp; NitroStack supplies
the application handlers, transport configuration, CORS, and era policy.

This update also addresses the review identifying four test-collection errors
and two additional full-suite failures.

Changes

  • Migrated tests of deleted dispatch/replay classes and ping helpers to requests
    through the official MCP HTTP application. Kept pure parser, header, CORS,
    SSE, protocol-contract, and response-echo coverage.
  • Kept the test-module importability registry enabled. All registered modules
    now import successfully; no sidecar compatibility shims were restored.
  • Merged current upstream develop normally. This includes the existing
    supported-version expectation fix for 2025-11-25; no protocol dates or era
    aliases were added or removed by this update.
  • Applied one subscription-support predicate to discover, server capabilities,
    and subscription handlers: legacy compatibility remains enabled; auto and
    modern advertise false and reject subscribe/unsubscribe requests.
  • Configured each server's era before transport startup, including additional
    server instances and stdio capability negotiation.
  • Applied initialization/version policy through public MCP Server.middleware
    on already-parsed request contexts. No JSON-RPC body parsing, buffering, or
    response generation was added to ASGI middleware. Compatible headerless
    requests retain the SDK's implicit legacy fallback.
  • Retained one HTTP factory and CORS layer, configured origin allowlists,
    era-driven /json/version, session-manager selection, health/slash handling,
    and public stdio runner APIs.
  • Added AST and behavioral stdio regressions for private imports, modern calls,
    legacy initialization, notifications, and initialization rejection.

Verification

MCP version tested: 2.2.0.

Hosted CI: all checks passed

Python SDK Test Suite run 40511981383
completed successfully on final head 71e47f1:

Linux CI job Tests Coverage
Python 3.10 809 passed 86.20%
Python 3.11 809 passed 86.18%
Python 3.12 809 passed 86.11%

No skipped tests, xfails, ignored files, or deselections were used.

Local cross-platform verification

Environment Full suite Coverage
Windows, Python 3.12.14 807 passed 86.02%
Ubuntu/WSL, Python 3.10.21 807 passed 86.04%
Ubuntu/WSL, Python 3.11.16 807 passed 86.02%
Ubuntu/WSL, Python 3.12.14 807 passed 86.02%

These are complete runs with no ignored files, deselections, skips, or xfails.
Two pre-existing pure utility checks were subsequently restored and passed
separately on all four runtimes. Final collection is 809 tests, with no
collection errors; the completed hosted matrix above ran all 809 together.

python -m pytest tests --collect-only -q
python -m pytest tests/test_transport_http.py tests/test_lifecycle_http.py tests/test_mcp20_stdio.py tests/test_transports.py -q
python -m pytest tests --cov=nitrostack --cov-report=term-missing --timeout=60

See docs/pr36-review-verification.md for baseline commit IDs, the migration
map, exact validation results, and the distinction between the local Linux
matrix and hosted CI status.

@Shreyavemana Shreyavemana left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested PR #36 locally.

  • The issue verification tests pass (46 passed).
  • However, the full test suite fails: four test files fail during collection because of removed modules/functions, and two additional tests fail after excluding them:
    • test_mcp20_blueprint.py — missing nitrostack.transports.dispatch
    • test_mcp20_deprecated.py — missing nitrostack.transports.dispatch
    • test_mcp20_jsonrpc_wire.py — missing nitrostack.transports.dispatch
    • test_mcp20_stateless_http.py — cannot import build_ping_response

(Additional failed test after removing the above ones)

  • test_mcp20_test_modules_importable
  • test_supported_versions_per_era

Please address the remaining test failures and rerun the full test suite.

@jpsiddharth2008 jpsiddharth2008 changed the title Feature/issue 23 http factory fix: unify HTTP factory and migrate tests to official MCP transport Oct 27, 2026

This branch has not been deployed

No deployments
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.

3 participants