Skip to content

MCP client doesn't not initialize new session when getting 404 session not found #1676

@david-nominal

Description

@david-nominal

Initial Checks

Description

Per https://modelcontextprotocol.io/specification/2025-11-25/basic/transports#session-management

When a client receives HTTP 404 in response to a request containing an MCP-Session-Id, it MUST start a new session by sending a new InitializeRequest without a session ID attached.

This is not the case with the python client. It just sends a session terminated error in streamable_http.py

Example Code

Python & MCP Python SDK

mcp: 1.22.0
python: 3.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Moderate issues affecting some users, edge cases, potentially valuable featurebugSomething isn't workingready for workEnough information for someone to start working on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions