Skip to content

Feature/issue 24 wire alignment - #37

Open
jpsiddharth2008 wants to merge 10 commits into
nitrocloudofficial:developfrom
jpsiddharth2008:feature/issue-24-wire-alignment
Open

jpsiddharth2008 wants to merge 10 commits into
nitrocloudofficial:developfrom
jpsiddharth2008:feature/issue-24-wire-alignment

Conversation

@jpsiddharth2008

@jpsiddharth2008 jpsiddharth2008 commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #24. PR #34 is merged; PR #36 remains a dependency and should merge first.

Purpose

Align modern MCP wire behavior while retaining official MCP ownership of /mcp.
This update publishes the previously local issue-specific implementation and
rebases the stack onto current develop (63ecd92). The PR targets develop.

Changes

  • Retire ping in auto/modern through MCP's public ping hook, preserving legacy ping.
  • Define and publicly export -32021 with its message and regression test;
    NitroStack task-capability enforcement remains deferred to the tasks issue.
  • Include _meta.serverInfo in the shared discovery builder and preserve cache
    metadata and compatibility fields where allowed by the wire version.
  • Use native top-level resultType fields for ordinary tool/resource/prompt
    results, preserving existing metadata and specialized result types.
  • Reject modern HTTP POSTs missing the protocol-version header without reading
    or replaying the body. Official MCP owns method/name/header validation and routing.
  • Reject retired methods for explicitly modern requests, including in auto mode.
    Preserve legacy-compatible auto initialization and requests.
  • Stop advertising the unimplemented 2026 tasks extension.
  • Remove unused initialize helpers, the obsolete static method table and duplicate
    method/name validators. Replace their test consumers with real HTTP coverage.
  • Retain PR fix: unify HTTP factory and migrate tests to official MCP transport #36's migrated tests and single Starlette CORS layer during rebase.

Post-rebase verification

Complete collection: 954 tests, including 99 issue #24 wire cases.
MCP 2.2.0. No exclusions or new skips/xfail markers:

Environment Result Coverage
Linux/WSL Python 3.10.21 954 passed 86.32%
Linux/WSL Python 3.11.16 954 passed 86.30%
Linux/WSL Python 3.12.14 954 passed 86.30%
Windows Python 3.12.14, first run 953 passed, 1 socket failure 86.30%
Windows Python 3.12.14, complete repeat 952 passed, 2 socket failures 86.30%

Windows hit the unchanged localhost OAuth discovery test with WinError 10053.
The complete repeat failed in both unchanged live OAuth discovery socket tests.
This intermittent error was also reproduced on the unchanged foundation during
the earlier investigation. Exact results are recorded in
docs/pr37-review-verification.md; Windows is not claimed green. No socket test
was excluded or changed.

A fresh archive of current develop 63ecd92 reproduced both errors under the
same Windows Python/MCP environment: 72 passed, 2 failed across the OAuth
and SecretValue modules. This comparison is included in the verification report.

git diff --check passes. The table above records local MCP 2.2.0 runs.

Hosted CI: all checks passed

GitHub Actions run 40693461563
passed on the rebased head 0cc7d68, using MCP 2.3.0:

Linux CI job Result Coverage
Python 3.10 954 passed 86.36%
Python 3.11 954 passed 86.36%
Python 3.12 954 passed 86.30%

No new runtime dependencies, version changes, OAuth-client or spillover changes
are included.

python -m pytest tests --collect-only -o addopts= -q
python -m pytest tests --cov=nitrostack --cov-report=term-missing --timeout=60 --tb=short -o addopts= -q

See docs/issue24-wire-alignment.md for the architecture and coverage mapping,
and docs/pr37-review-verification.md for exact results and dependency history.

@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 the PR #37 locally and these are the results:

  • The targeted tests pass (46 passed across the two test runs).
  • However, the full test suite fails during collection because existing tests still import modules and functions removed by this PR:
    • 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

Please update or remove the affected tests as appropriate and rerun the full test suite.

@jpsiddharth2008
jpsiddharth2008 changed the base branch from main to develop October 28, 2026 12:59

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.

[mcp-2026] Align 2026 wire: drop ping, add -32021, discover _meta, MUST headers

2 participants