Skip to content

mcp: streamable server requires Mcp-Method on notifications, which the 2026-07-28 spec does not #1503

Closed

Description

@toledompm

Checklist

  • I searched the existing issues, and this has not been reported before.
  • This is a real problem that I ran into myself, using the latest release of the SDK.
  • I ran into it in a production system, not in a toy example, a benchmark, or an automated or AI-driven scan of the code.
  • I (a human) examined the relevant SDK code, and wrote or reviewed every line of this report. It is not unreviewed AI output.
  • This report is brief and concise, and sticks to the facts needed to understand the problem.

What happened?

A stateless Streamable HTTP server rejects client notifications that omit Mcp-Method with 400 / -32020 "missing required Mcp-Method header". Claude Code 2.1.316 to 2.1.318 sends notifications on protocol 2026-07-28 with MCP-Protocol-Version but without Mcp-Method.

The 2026-07-28 spec requires Mcp-Method for "All requests" and says "header requirements for notification POSTs are not defined by this revision" (https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http). The TypeScript SDK accepts these with 202 (https://ts.sdk.modelcontextprotocol.io/v2/migration/support-2026-07-28).

validateMcpHeaders applies the presence check to every *jsonrpc.Request, notifications included.

Expected: notifications pass without Mcp-Method, while a header that is present must still match the body. #1215 made the same exemption for the _meta check.

I'd like to try to fix this :). The patch skips only the presence check for notifications and keeps the mismatch check, with unit and HTTP-level tests.

Drafted with AI assistance; I reviewed the report and the SDK code.

How to reproduce

Stateless StreamableHTTPHandler, then:

POST /mcp
MCP-Protocol-Version: 2026-07-28
Content-Type: application/json
Accept: application/json, text/event-stream

{"jsonrpc":"2.0","method":"notifications/cancelled","params":{"requestId":7}}

Response: 400 {"jsonrpc":"2.0","error":{"code":-32020,"message":"missing required Mcp-Method header"}}

Where did you hit this?

An internal platform API that serves MCP tools to Claude Code over stateless Streamable HTTP.

Go MCP SDK version

Go MCP SDK version: v1.7.0 in production; same code on v1.8.0 and main

Go version

go1.26 (golang:1.26-alpine build image; go.mod requires 1.26.1)

Logs

the 400 body above

Activity

  1. added theissue type on Nov 5, 2026
  2. guglielmo-san commented on Nov 5, 2026

    @guglielmo-san
    Contributor

    @toledompm Issue assigned to you, feel free to send the PR

  3. added a commit that references this issue on Nov 6, 2026
    caa354d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions