Skip to content

[Server] Parallel elicitations on one session get each other's answers #56

Description

@chr-hertel

Two tool calls on one session that both elicit get elicitation/create with the same request id (1000). The client answers both, the answers overwrite each other in _mcp.responses.1000 and one call resumes with the other call's answer. The other one fails with -32603 ("Transport returned an unexpected payload; expected a Response or Error message.").

On top, an elicitation is sent on another call's SSE stream - all streams drain one session-wide outgoing queue.

Happens on every runtime (php -S, FPM, Apache, FrankenPHP classic & worker, LB + Redis), on main and v0.8.1. One elicitation per session across parallel sessions is fine.

bin/up.sh fpm worker
cd harness && uv run gauntlet run -t fpm,worker -s concurrency.parallel-elicitation

Cause:

modelcontextprotocol#556 made each stream poll only its own awaited id - correct, but doesn't help once two streams await the same id.

Options: ids that can't collide across processes (random or per stream), and per-stream outgoing queues - or writing server requests inline like modelcontextprotocol#535 does for responses.

Activity

  1. chr-hertel commented on Oct 10, 2026

    @chr-hertel
    OwnerAuthor

    Confirmed with the TS (1.32.1, 2.3.1) and Python (2.3.0) SDK clients on every runtime, for sampling and roots/list as well. With 2 calls, one elicitation is never sent at all and both calls return the same answer: node clients/interop/ts/repro/parallel-elicitation.mjs http://127.0.0.1:8102/ 2. The -32603 comes from the SSE loop resuming the fiber with null once its pending entry vanished (https://github.com/modelcontextprotocol/php-sdk/blob/9591ad292788f717e8785b282edc2292850a98d4/src/Server/Transport/StreamableHttpTransport.php#L293-L298), which ClientGateway then rejects as unexpected payload.

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 working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions