Skip to content

Commit beacd6e

Browse files
authored
remove max message size (#1105)
1 parent e033621 commit beacd6e

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

src/mcp/server/streamable_http.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@
4646

4747
logger = logging.getLogger(__name__)
4848

49-
# Maximum size for incoming messages
50-
MAXIMUM_MESSAGE_SIZE = 4 * 1024 * 1024 # 4MB
5149

5250
# Header names
5351
MCP_SESSION_ID_HEADER = "mcp-session-id"
@@ -329,13 +327,6 @@ async def _handle_post_request(self, scope: Scope, request: Request, receive: Re
329327

330328
# Parse the body - only read it once
331329
body = await request.body()
332-
if len(body) > MAXIMUM_MESSAGE_SIZE:
333-
response = self._create_error_response(
334-
"Payload Too Large: Message exceeds maximum size",
335-
HTTPStatus.REQUEST_ENTITY_TOO_LARGE,
336-
)
337-
await response(scope, receive, send)
338-
return
339330

340331
try:
341332
raw_message = json.loads(body)

0 commit comments

Comments
 (0)