Skip to content

Add Streamable HTTP request body limits - #3095

Merged
Kludex merged 2 commits into
mainfrom
agent/add-streamable-http-request-limit
Jul 16, 2026
Merged

Add Streamable HTTP request body limits#3095
Kludex merged 2 commits into
mainfrom
agent/add-streamable-http-request-limit

Address request body limit review feedback

54b0cc4
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 15, 2026 in 9m 39s

Code review found 2 important issues

Found 5 candidates, confirmed 3. See review comments for details.

Details

Severity Count
🔴 Important 2
🟡 Nit 0
🟣 Pre-existing 1
Severity File:Line Issue
🟣 Pre-existing src/mcp/server/streamable_http_manager.py:374-375 SSE transport POST endpoint still has no request-body size limit (pre-existing)

Annotations

Check notice on line 375 in src/mcp/server/streamable_http_manager.py

See this annotation in the file changed.

@claude claude / Claude Code Review

SSE transport POST endpoint still has no request-body size limit (pre-existing)

Pre-existing issue, not introduced by this PR: the legacy SSE transport's POST endpoint (`SseServerTransport.handle_post_message`, `src/mcp/server/sse.py:243`) still buffers the entire request body unbounded via `await request.body()` — the same DoS vector this PR closes for Streamable HTTP. Since the new `RequestBodyLimitMiddleware` is a generic ASGI wrapper, applying it to the SSE message endpoint would be a natural one-line follow-up (or the docs could note explicitly that the limit covers St