Skip to content

2026 Streamable HTTP rejects whitespace-padded Mcp-Name values #3763

Open

Description

@DMomplaisir

Description

The 2026 Streamable HTTP header validation rejects a valid Mcp-Name when its value has leading or trailing HTTP optional whitespace. Header field values are subject to HTTP whitespace normalization; a client or intermediary that sends Mcp-Name: tools/call is rejected with JSON-RPC error -32020, although the trimmed value names the registered method.

This also fails the official conformance case sep-2243 (header validation).

Reproduction

Send a valid 2026 request with:

  • MCP-Protocol-Version: 2026-07-28
  • Mcp-Method: tools/call
  • Mcp-Name: tools/call
  • a valid tools/call JSON-RPC body

On mcp 2.3.0, the SDK returns -32020 rather than accepting the header value after HTTP whitespace handling.

Expected

Normalize permitted surrounding HTTP whitespace before comparing the header value, while continuing to reject values that differ after normalization.

Environment

Python SDK 2.3.0; reproduced by the MCP conformance suite's sep-2243 header-validation case.

Activity

  1. added
    bugSomething isn't working
    v2Affects the v2 line (2.x on main)
    spec-2026-07-28Concerns the SDK's implementation of the 2026-07-28 MCP spec revision
    on Oct 25, 2026
  2. aritejhg commented on Oct 26, 2026

    @aritejhg

    Thanks for the focused reproduction. I’d normalize only permitted HTTP optional whitespace around Mcp-Name before comparing it with the registered method, then add regression coverage for leading and trailing whitespace while keeping mismatched values rejected. I used Codex to help review the issue and will review and own any change. Does that match the intended spec handling, and would it be okay for me to take this once assigned?

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingspec-2026-07-28Concerns the SDK's implementation of the 2026-07-28 MCP spec revisionv2Affects the v2 line (2.x on main)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions