Symptom
A Streamable HTTP request that fails validation early raises ClosedResourceError from the message router. The report says this starts in v1.12.0 and shows up on a bad Accept header.
Evidence what you'll see
- The notes in the issue are against v1.14.0 with
anyio==4.10.0. The router loop isasync for write_stream_readeraround line 831 ofstreamable_http.py. - The environment block says
python==3.12.0.
Why it happens
The message router keeps reading after the request task has already closed the stream, so a fast failure races the router's next read.
Affected versions
MCP Python SDK from v1.12.0, the write-up is against v1.14.0, anyio==4.10.0, Python 3.12.0. The linked issue does not name an operating system.
Fix steps
0 of 1 done
Your check marks stay in this browser only.
How to check it worked
- A request rejected for its
Acceptheader does not raiseClosedResourceErrorfrom the message router.
If it still fails
- The linked issue does not describe
ClosedResourceErroron v1.23.2. A client that never sendsAcceptstill fails validation; it should not take the router down with it.
Sources and credit
Summarized in our own words from these public reports. Credit goes to their authors.
Provided as is, without warranty. Try changes in a non-production environment and back up first. Security-related steps: verify against the official docs. Terms · Request removal or attribution change
Hit an error we don't cover? Submit it