Skip to content

simple-streamablehttp-stateless example will not return data if id=0 #1218

Closed

Description

@howardjohn

Initial Checks

Description

I ran the simple-streamablehttp-stateless example, then connected via curl.

If I send:

curl localhost:3000/mcp/ --json '{"jsonrpc":"2.0","id":0,"method":"tools/call","params":{"_meta":{"progressToken":0},"name":"start-notification-stream","arguments":{"interval":0.1,"count":5,"caller":""}}}' -H "Accept: application/json, text/event-stream"

it does NOT work; there are no notifications sent.

If I send (changing only the id):

curl localhost:3000/mcp/ --json '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"_meta":{"progressToken":0},"name":"start-notification-stream","arguments":{"interval":0.1,"count":5,"caller":""}}}' -H "Accept: application/json, text/event-stream"

I do get notifications.

If I run the same example in the typescript SDK, it works with both id.

Log:

Sending notification 1/5 from caller:
2025-07-30 13:14:04,335 - root - DEBUG - Request stream _GET_stream not found
                                for message. Still processing message as the client
                                might reconnect and replay.
Sending notification 2/5 from caller:
2025-07-30 13:14:04,435 - root - DEBUG - Request stream _GET_stream not found
                                for message. Still processing message as the client
                                might reconnect and replay.
Sending notification 3/5 from caller:
2025-07-30 13:14:04,536 - root - DEBUG - Request stream _GET_stream not found
                                for message. Still processing message as the client
                                might reconnect and replay.
Sending notification 4/5 from caller:
2025-07-30 13:14:04,637 - root - DEBUG - Request stream _GET_stream not found
                                for message. Still processing message as the client
                                might reconnect and replay.
Sending notification 5/5 from caller:
2025-07-30 13:14:04,737 - root - DEBUG - Request stream _GET_stream not found
                                for message. Still processing message as the client
                                might reconnect and replay.

Example Code

Python & MCP Python SDK

latest

Activity

  1. added
    bug
    needs confirmation
    ready for work
    P2
    on Sep 26, 2025
  2. removed
    needs confirmation
    on Oct 6, 2025
  3. Br1an67 commented on Mar 1, 2026

    @Br1an67

    I'd like to work on this. The root cause is a falsy check (if related_request_id) in BaseSession.send_notification that treats integer 0 as False, dropping the metadata and misrouting notifications to the GET stream.

    PR: #2187

  4. maxisbey commented on Jul 29, 2026

    @maxisbey
    Contributor

    Thanks for the report. Closing this as it's been fixed in v2, which is now released (see #2838). If you still run into this on v2, feel free to reopen.

    AI Disclaimer

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

    P2bugready for work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions