[v1.x] Apply the request body limit to the SSE and OAuth endpoints (#3344)
This commit is contained in:
parent
ae3338f6b3
commit
4dc224fab2
1 changed files with 426 additions and 161 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue