You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apply the request body limit regardless of HTTP method
RequestBodyLimitMiddleware only inspected POST requests, but some of the
routes it wraps accept other methods whose handlers read the body as well
(OPTIONS on the token, registration and revocation endpoints, HEAD on the
authorization endpoint). Enforce the limit for every HTTP request.
Also take the limit back out of cors_middleware, which returns to plain
CORS wrapping, and compose the CORS and body-limit wrappers explicitly
where the OAuth routes are declared.
Copy file name to clipboardExpand all lines: docs/run/index.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,7 +67,7 @@ Each transport has its own keyword arguments, all on `run()`:
67
67
*`streamable_http_path`: where the MCP endpoint lives. Default `/mcp`.
68
68
*`json_response=True`: answer each POST with a single JSON body instead of an SSE stream. That body has room for the response and nothing else, so a tool that calls back into the client mid-request (`ctx.elicit()`, sampling) raises `NoBackChannelError` on this leg, and notifications tied to the in-flight call (progress from `ctx.report_progress()`, per-call log messages) are dropped; the standalone `GET` stream still carries unrelated ones.
69
69
*`stateless_http=True`: a fresh transport per request, no session tracking.
70
-
*`max_request_body_size`: largest accepted POST body in bytes. Defaults to 4 MiB; larger requests
70
+
*`max_request_body_size`: largest accepted request body in bytes. Defaults to 4 MiB; larger requests
71
71
receive HTTP 413 before parsing or session creation. Raise it only when legitimate MCP messages
72
72
exceed that size.
73
73
*`event_store`, `retry_interval`, `transport_security`: resumability and DNS-rebinding protection. They can wait, until you deploy somewhere other than localhost; **[Deploy & scale](deploy.md)** covers `transport_security`.
0 commit comments