Skip to content

fix(rmcp): enforce strict stateless initialization errors - #4

Open
jmagar wants to merge 1 commit into
mainfrom
codex/strict-stateless-initialize-http
Open

jmagar wants to merge 1 commit into
mainfrom
codex/strict-stateless-initialize-http

Conversation

@jmagar

@jmagar jmagar commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Follow-up to #3, found while reviewing Labby PR dinglebear-ai/labby#650. Limit the fix to the opt-in strict stateless HTTP path; relaxed stateless and stateful legacy initialization remain compatible.

  • Require the protocol-version header on strict initialize requests.
  • Validate modern Mcp-Method on strict initialization without changing legacy exemptions elsewhere.
  • Map strict terminal protocol errors to the existing modern HTTP status codes.
  • Preserve the parsed JSON-RPC request ID and HeaderMismatch envelope for malformed protocol headers.

Only the HTTP transport implementation and its focused protocol-version tests change. Labby consumes the immutable branch commit; this PR does not modify modelcontextprotocol/rust-sdk upstream.

Validation

The all-features configuration enables local and skips these non-local tests. The executed feature set was client,transport-streamable-http-server,transport-streamable-http-client-reqwest,reqwest; no zero-test run is counted as evidence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant