[v1.x] Apply the request body limit to the SSE and OAuth endpoints (#3344)

This commit is contained in:
Max 2026-08-21 17:02:59 +01:00 • committed by GitHub
commit 4dc224fab2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1253,7 +1253,7 @@ The FastMCP server instance accessible via `ctx.fastmcp` provides access to serv
- `host` and `port` - Server network configuration
- `mount_path`, `sse_path`, `streamable_http_path` - Transport paths
- `stateless_http` - Whether the server operates in stateless mode
- `max_request_body_size` - Maximum Streamable HTTP POST body size in bytes
- `max_request_body_size` - Maximum HTTP request body size in bytes (Streamable HTTP and SSE)
- And other configuration options
```python
@ -1418,9 +1418,9 @@ Note that `uv run mcp run` or `uv run mcp dev` only supports server using FastMC
> **Note**: Streamable HTTP transport is the recommended transport for production deployments. Use `stateless_http=True` and `json_response=True` for optimal scalability.
Streamable HTTP POST bodies are limited to 4 MiB by default. Larger requests receive HTTP 413
before parsing or session creation. If your server intentionally accepts larger MCP messages,
configure the smallest suitable byte limit:
HTTP request bodies (Streamable HTTP and SSE) are limited to 4 MiB by default. Larger requests
receive HTTP 413 before parsing or session creation. If your server intentionally accepts larger MCP
messages, configure the smallest suitable byte limit:
```python
mcp = FastMCP("Large messages", max_request_body_size=8 * 1024 * 1024)