SEP-2243: HTTP Standardization — rust-sdk implementation
Spec PR: modelcontextprotocol/modelcontextprotocol#2243
Track: Specification · Stage: final · Priority: P0
Needs code changes: Yes (Medium) — non-breaking (gated by protocol version)
Summary
Incorporates standard HTTP features into the HTTP transport so internet "middle boxes" (proxies,
gateways, load balancers) can process MCP traffic for routing, tracing, and prioritization. All
changes are gated by protocol version, so they are non-breaking. A reference implementation exists
on the C# SDK.
Why this needs code changes in rust-sdk
The SDK already centralizes its HTTP header constants in
crates/rmcp/src/transport/common/http_header.rs: today that's just HEADER_SESSION_ID
(Mcp-Session-Id), HEADER_LAST_EVENT_ID, HEADER_MCP_PROTOCOL_VERSION, and the
text/event-stream / application/json MIME constants, plus a validate_custom_header allow-list.
The server tower (streamable_http_server/tower.rs) and server_side_http.rs build/parse these,
and the client (streamable_http_client.rs) sets them on outgoing requests. Adopting the
standardized header set means adding new constants here and emitting/honoring them on both sides.
The good news: there's a single chokepoint (http_header.rs + the allow-list) for header
definitions, so additions are localized.
Proposed work
Affected areas
transport/common/http_header.rs (new constants + allow-list), transport/common/server_side_http.rs,
transport/streamable_http_client.rs, transport/streamable_http_server/tower.rs.
Notes / risks
- Coordinate with SEP-414 (OpenTelemetry trace context) — tracing headers may overlap.
SEP-2243: HTTP Standardization — rust-sdk implementation
Spec PR: modelcontextprotocol/modelcontextprotocol#2243
Track: Specification · Stage: final · Priority: P0
Needs code changes: Yes (Medium) — non-breaking (gated by protocol version)
Summary
Incorporates standard HTTP features into the HTTP transport so internet "middle boxes" (proxies,
gateways, load balancers) can process MCP traffic for routing, tracing, and prioritization. All
changes are gated by protocol version, so they are non-breaking. A reference implementation exists
on the C# SDK.
Why this needs code changes in rust-sdk
The SDK already centralizes its HTTP header constants in
crates/rmcp/src/transport/common/http_header.rs: today that's justHEADER_SESSION_ID(
Mcp-Session-Id),HEADER_LAST_EVENT_ID,HEADER_MCP_PROTOCOL_VERSION, and thetext/event-stream/application/jsonMIME constants, plus avalidate_custom_headerallow-list.The server tower (
streamable_http_server/tower.rs) andserver_side_http.rsbuild/parse these,and the client (
streamable_http_client.rs) sets them on outgoing requests. Adopting thestandardized header set means adding new constants here and emitting/honoring them on both sides.
The good news: there's a single chokepoint (
http_header.rs+ the allow-list) for headerdefinitions, so additions are localized.
Proposed work
http_header.rs(mirroring the existingHEADER_*pattern).validate_custom_headerallow-list so the new headers pass through the middleware (the existing comment showsHEADER_MCP_PROTOCOL_VERSIONis already special-cased there).streamable_http_client.rs, server instreamable_http_server/tower.rs/server_side_http.rs.ProtocolVersion::V_2026_07_28so older peers are unaffected (the protocol version is already available per-request intower.rs).Affected areas
transport/common/http_header.rs(new constants + allow-list),transport/common/server_side_http.rs,transport/streamable_http_client.rs,transport/streamable_http_server/tower.rs.Notes / risks