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
If you were mutating these via `mcp.settings` after construction (e.g., `mcp.settings.port = 9000`), pass them to `run()` / `sse_app()` / `streamable_http_app()` instead — these fields no longer exist on `Settings`. The `debug` and `log_level` parameters remain on the constructor.
677
678
679
+
### Streamable HTTP request bodies are limited to 4 MiB
680
+
681
+
V2 applies a 4 MiB default limit to Streamable HTTP POST bodies and returns HTTP 413 before parsing
682
+
the JSON or creating a session when that limit is exceeded.
683
+
684
+
Most servers need no migration. If your application intentionally accepts larger MCP messages,
685
+
set an explicit byte limit on `run()` or `streamable_http_app()`:
The limit must be positive and applies to both legacy session-based requests and V2's modern
692
+
single-exchange requests. Keep the smallest value your application actually needs.
693
+
678
694
### Streamable HTTP: lifespan now entered once at manager startup
679
695
680
696
When serving streamable HTTP (stateful or `stateless_http=True`), the server's `lifespan` context manager is now entered once when `StreamableHTTPSessionManager.run()` starts, and the resulting state is shared across all sessions and requests. Previously each session (stateful) or each request (stateless) entered and exited `lifespan` independently.
Copy file name to clipboardExpand all lines: docs/run/index.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,9 @@ 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 with plain JSON instead of an SSE stream.
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
71
+
receive HTTP 413 before parsing or session creation. Raise it only when legitimate MCP messages
72
+
exceed that size.
70
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