Skip to content

Draft server: validate body/header protocolVersion mismatch and no-op stray Mcp-Session-Id #1654

Description

@halter73

Follow-up from #1610 (draft 2026-07-28 sessionless/stateless work). Two small server-side validation gaps that were punted:

1. HeaderMismatch (-32001) protocolVersion validation

The server does not currently compare the HTTP MCP-Protocol-Version header against the per-request _meta io.modelcontextprotocol/protocolVersion value (SEP-2567). When they disagree it should reject with a HeaderMismatch (-32001) error rather than silently trusting one.

2. Stray Mcp-Session-Id on draft requests

A draft (sessionless) request that nonetheless carries an Mcp-Session-Id header currently returns 400. Per the spec the session header is meaningless in sessionless mode and should be ignored (no-op), not rejected.

Notes

Both are server-side; add RawHttpConformanceTests-style regression coverage.

cc #1610

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions