Skip to content

Harden Streamable HTTP response headers#201

Closed
leehack wants to merge 1 commit into
spec/2026-client-result-type-validationfrom
spec/2026-streamable-http-response-headers
Closed

Harden Streamable HTTP response headers#201
leehack wants to merge 1 commit into
spec/2026-client-result-type-validationfrom
spec/2026-streamable-http-response-headers

Conversation

@leehack
Copy link
Copy Markdown
Owner

@leehack leehack commented May 31, 2026

Summary

  • add the draft-recommended X-Accel-Buffering: no header to Streamable HTTP SSE responses
  • centralize SSE response headers across GET, replay, and stateless raw socket responses
  • mark JSON-RPC error response bodies as application/json and cover the header behavior in transport tests

Spec reference: https://modelcontextprotocol.io/specification/draft/basic/transports

Validation

  • dart format .
  • dart analyze
  • dart test test/server/streamable_https_test.dart --name "X-Accel|response headers|stateless non-POST|routes a server-originated|GET Last-Event-ID|rejects server requests on response streams|validates required protocol header"
  • dart test test/server/streamable_https_test.dart
  • dart test
  • dart pub global run coverage:test_with_coverage
  • git diff --check

@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.39%. Comparing base (e5843fe) to head (3ad4e83).

Additional details and impacted files
@@                             Coverage Diff                             @@
##           spec/2026-client-result-type-validation     #201      +/-   ##
===========================================================================
+ Coverage                                    86.79%   87.39%   +0.59%     
===========================================================================
  Files                                           46       46              
  Lines                                         8749     8686      -63     
===========================================================================
- Hits                                          7594     7591       -3     
+ Misses                                        1155     1095      -60     
Flag Coverage Δ
unittests 87.39% <100.00%> (+0.59%) ⬆️

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-streamable-http-response-headers branch from 315353f to 3ad4e83 Compare May 31, 2026 21:28
@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 #268 (MCP 2026 transport enforcement); 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