Skip to content

Add MCP 2026 stateless HTTP headers#179

Closed
leehack wants to merge 1 commit into
spec/2026-07-28-rcfrom
spec/2026-stateless-http-headers
Closed

Add MCP 2026 stateless HTTP headers#179
leehack wants to merge 1 commit into
spec/2026-07-28-rcfrom
spec/2026-stateless-http-headers

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented May 31, 2026

Summary

  • add stateless Streamable HTTP header validation for MCP-Protocol-Version, Mcp-Method, Mcp-Name, and present Mcp-Param-* headers
  • make the Streamable HTTP client mirror 2026 request metadata into standard HTTP headers
  • allow StreamableMcpServer to route 2026 stateless POST requests without an Mcp-Session-Id, while preserving legacy unknown-session behavior
  • keep GET/DELETE on the 2026 stateless path as 405 Method Not Allowed through the transport

Stack

Base: #178 (spec/2026-07-28-rc)

This is the second PR in the MCP 2026-07-28 RC stack for #177.

Notes

This PR focuses on the standard Streamable HTTP stateless/header behavior. Full tool-schema-driven x-mcp-header discovery/filtering for client-emitted Mcp-Param-* headers can land as a separate follow-up if we want that isolated for review.

Validation

  • dart analyze
  • dart test test/server/streamable_https_test.dart test/client/streamable_https_test.dart test/server/streamable_mcp_server_test.dart test/mcp_2026_07_28_test.dart
  • dart test -j 1

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

❌ Patch coverage is 89.84772% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.32%. Comparing base (4a81430) to head (b1bad7e).

Files with missing lines Patch % Lines
lib/src/server/streamable_https.dart 85.45% 16 Missing ⚠️
lib/src/server/streamable_mcp_server.dart 91.83% 4 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                   @@
##           spec/2026-07-28-rc     #179      +/-   ##
======================================================
+ Coverage               85.20%   85.32%   +0.11%     
======================================================
  Files                      45       45              
  Lines                    7579     7770     +191     
======================================================
+ Hits                     6458     6630     +172     
- Misses                   1121     1140      +19     
Flag Coverage Δ
unittests 85.32% <89.84%> (+0.11%) ⬆️

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 leehack force-pushed the spec/2026-stateless-http-headers branch from 5e69d19 to b1bad7e Compare May 31, 2026 17:09
@leehack leehack marked this pull request as ready for review June 1, 2026 08:56
@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 #267 (MCP 2026 feature foundation); 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