Skip to content

Feature/issue 24 wire alignment - #37

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

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

Conversation

@jpsiddharth2008

@jpsiddharth2008 jpsiddharth2008 commented Sep 17, 2026 •

Copy link
Copy Markdown
Collaborator

Purpose

Complete the remaining MCP 2026 wire alignment for issue #24, preserving official MCP ownership of /mcp and legacy compatibility.

PRs #36 and #91 are now merged. This branch includes current develop at 0d51ee4; it no longer depends on an open PR #36 branch.

Changes relative to develop

  • Require the modern HTTP protocol-version header and retain header/body consistency validation through the official MCP path.
  • Apply retired-method policy to negotiated modern requests, including auto-era requests using MCP 2026, while retaining legacy behavior.
  • Add normal top-level resultType annotations across tool/resource/prompt results, preserving application metadata and special result types.
  • Consolidate discovery construction, preserve upstream's namespaced server information and cache hints, and retain the additional discovery metadata coverage.
  • Remove obsolete sessionless-initialize wrappers, unused method-contract tables and duplicate validators.
  • Keep modern task methods hidden and avoid advertising the incomplete 2026 task extension.

Latest conflict resolution

Merged current develop with a normal merge commit, preserving history. The two conflicting files were resolved by keeping both prompt result stamping and upstream ping-handler registration, and retaining separate HTTP tests for tools-list success and modern ping rejection. Upstream visibility, stdio, widget registry, OAuth and CLI/template changes remain intact.

Verification on c5b0427

MCP 2.3.0. Complete collection: 1,252 tests. Focused wire, task, factory, HTTP ownership and stdio regression selection: 204 passed.

Local environment Full-suite result Coverage
Linux/WSL Python 3.10.21 1,252 passed 87.17%
Linux/WSL Python 3.11.16 1,252 passed 87.15%
Linux/WSL Python 3.12.14 1,252 passed 87.15%
Windows Python 3.12.14 1,234 passed, 1 failed, 17 existing skips 84.99%

Linux runs include native QuickJS 1.19.4. Windows skips are the existing optional QuickJS checks (16) and symlink capability check (1). No new skips, exclusions, deselections or xfail markers were added.

The Windows failure is test_discovery_dcr_404_when_disabled_or_missing_client_id, raising WinError 10053. The exact same test/error reproduced on unchanged 0d51ee4 in the same Python/MCP environment (33 passed, 1 failed for the baseline OAuth module). OAuth source and tests are unchanged. The full Windows run is not claimed green.

Hosted CI passed on Python 3.10, 3.11 and 3.12 for this exact head: run 41664166895.

python -m pytest tests --collect-only -o addopts= -q
python -m pytest tests --cov=nitrostack --cov-report=term --timeout=60 --tb=short -o addopts= -q
git diff upstream/develop --check

@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 force-pushed the feature/issue-24-wire-alignment branch from 0cc7d68 to 166bb15 Compare November 2, 2026 12:25
@manish-wekan

Copy link
Copy Markdown
Collaborator

Re-checked after c5b0427 (develop merged in): no conflicts with develop @ 0d51ee4, full suite 1252 passed locally, CI green on 3.10–3.12.

What this PR still adds on top of develop (verified with a TestClient probe):

  • server/discover without headers → -32020 (400 on modern; develop returns -32022/200).
  • Drops ping from MODERN_METHOD_CONTRACTS and removes the dead build_sessionless_initialize_result / handle_sessionless_initialize path.
  • Removes the unused jsonrpc helpers and adds tests/test_mcp24_wire_alignment.py.

Requested before merge:

  1. Remove docs/pr37-review-verification.md and docs/issue24-wire-alignment.md — review logs (incl. a local stash SHA), not project docs.
  2. Optional while here: remove the Refresh #24 (MCP 2026 wire alignment): body is partly outdated and has no implementation: Issue #78 #91 leftovers in core/app.py — the duplicated if self.protocol_era in ("auto","modern") and is_task: block (L1688/L1699; the -32021 branch between them is unreachable) and the unused _stamp_discover_meta().

Please relink this PR to #27 (#24 is being closed as superseded); the remaining items there are tracked in #27.

~sent from claude-code

@manish-wekan

Copy link
Copy Markdown
Collaborator

Your code commit 2bb5dfa landed on develop via #108 (cherry-picked with your authorship, conflicts resolved the same way as your c5b0427), together with the rest of #27. This PR's only remaining diff is the two review-log docs, so it can be closed — thanks!

~sent from claude-code

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

3 participants