Skip to content

Prefer nested metadata for stateless routing#246

Closed
leehack wants to merge 2 commits into
spec/prefer-nested-request-metafrom
spec/stateless-body-nested-meta
Closed

Prefer nested metadata for stateless routing#246
leehack wants to merge 2 commits into
spec/prefer-nested-request-metafrom
spec/stateless-body-nested-meta

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented Jun 1, 2026

Summary

  • prefer params._meta over top-level _meta when detecting stateless protocol versions from raw Streamable MCP request bodies
  • keep top-level metadata as a fallback for compatibility when nested metadata is absent
  • add a transport-level regression for conflicting top-level and nested protocol metadata

Spec notes

  • The current stable schema (2025-11-25) defines request metadata under request params.
  • The draft 2026-07-28 schema requires request metadata under params._meta for stateless requests.
  • This aligns the Streamable MCP routing detector with the JSON-RPC parser precedence from the previous stacked PR.

Sources:

Verification

  • dart format lib/src/server/streamable_mcp_server.dart test/server/streamable_mcp_server_test.dart
  • dart test test/server/streamable_mcp_server_test.dart
  • dart analyze
  • dart test
  • (cd packages/mcp_dart_cli && dart analyze && dart test)
  • git diff --check

@codecov
Copy link
Copy Markdown

codecov Bot commented Jun 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.47%. Comparing base (463167d) to head (2cefe79).

Additional details and impacted files
@@                         Coverage Diff                         @@
##           spec/prefer-nested-request-meta     #246      +/-   ##
===================================================================
+ Coverage                            88.45%   88.47%   +0.02%     
===================================================================
  Files                                   47       47              
  Lines                                 9335     9335              
===================================================================
+ Hits                                  8257     8259       +2     
+ Misses                                1078     1076       -2     
Flag Coverage Δ
unittests 88.47% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leehack
Copy link
Copy Markdown
Owner Author

leehack commented Jun 1, 2026

Closing this draft micro PR because the RC spec work has been consolidated into a smaller reviewable stack. This change is preserved in #270 (JSON-RPC metadata hardening); the consolidated tip is tree-identical to the previous micro-stack tip.

@leehack leehack closed this Jun 1, 2026
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.

1 participant