A 413 response can occur before the MCP SDK checks its request-body limit. In an Express setup, JSON-parsing middleware may read and reject the body first; the SDK’s byte cap applies only when the SDK reads the request stream itself. A separate SDK limit caps the number of JSON-RPC messages in a batch. These controls act at different stages, so changing one does not necessarily change the other.
What the two limits control
| Limit | Controls | When it applies |
|---|---|---|
| Request-body size | Bytes in the HTTP request body. The MCP TypeScript SDK changelog lists a 4 MiB default for requests whose body the SDK reads itself. | When the SDK owns reading the request stream. If a caller provides an already parsed body, the SDK’s bounded read is skipped. Official SDK changelog |
| JSON-RPC batch size | Number of JSON-RPC messages in a batch. The SDK changelog lists a maximum of 100 messages. | Batch validation still applies when the body is pre-parsed; it is independent of the byte limit. Official SDK changelog |
These are different dimensions: a request can be under the byte limit but contain too many batch entries, or exceed the byte limit while containing only a few large messages. The limits are configuration and validation values, not performance measurements.
Why Express can return 413 before the SDK limit matters
In a middleware path where express.json() parses the request before it reaches the MCP transport, Express reads the bytes first. If its parser rejects the body, the transport never gets a parsed request to validate, and changing the SDK’s body-size setting cannot override that earlier refusal.
Imran Siddique’s September 25, 2026 article reports this behavior for its documented 1.x Express path and describes the SDK’s 1.30.1 implementation as using a 4 MiB body cap and a 100-message batch cap. The article also reports different response shapes and logging visibility depending on which layer rejects the request; those observations belong to its stated test setup, not an independently reproduced test. Siddique’s article
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →#1 Best Overall
The official SDK changelog corroborates the distinction between SDK-owned bounded reads and pre-parsed bodies, but it is on the current main branch and includes later changes. It does not, by itself, verify every detail of the published 1.30.1 package. Check the exact installed package and adapter before relying on version-specific behavior.
Check which component handles the body
- Identify the installed SDK generation and version. Distinguish the 1.x monolithic SDK from the v2 split packages, and note whether the application uses the official Express adapter or custom middleware.
- Trace middleware order. Determine whether
express.json()runs before the MCP transport. If it does, find the parser limit configured for that middleware and the error handler that receives parser failures. - Find the SDK body-limit setting. Set it for requests the SDK reads itself. It cannot raise an upstream parser’s limit when the parser has already consumed or rejected the body.
- Configure the Express parser using the installed adapter’s option. Current official Express adapter source exposes
jsonLimit, passed toexpress.json({ limit }), and documents Express’s built-in default as100kb. Adapter options have evolved, so do not assume that current option exists in every older setup. Current Express adapter source - Align and test both controls. Choose limits that suit the expected request size, then exercise a body-size rejection and a batch-count rejection separately. Record the HTTP status, response content type and payload, and which middleware or transport logs the refusal.
Diagnose a rejection by its enforcement point
| What to inspect | Likely implication |
|---|---|
| Express parser limit and middleware order | If parsing happens before transport handling and the body crosses that parser limit, Express can refuse it before the SDK’s body reader runs. |
| SDK body limit and whether the body is pre-parsed | The SDK’s bounded body read applies when it reads the stream itself; a caller-provided parsed body bypasses that read limit. |
| Batch entry count | A body within its byte allowance can still fail batch validation if it exceeds the SDK’s message-count cap. |
| Response and logs | The rejecting layer determines which error handler and monitoring hooks see the failure. Compare status, content type, payload, and application logs rather than assuming every refusal is a JSON-RPC error. |
| Exact SDK and adapter version | Options and implementation details can differ between releases; current branch documentation is not proof of behavior in every historical package. |
Practical takeaway for a 413 below the SDK setting
When a request appears smaller than the configured SDK maximum but receives HTTP 413, inspect the Express JSON parser and middleware order first. The SDK setting is not the effective ceiling if an upstream parser rejects the body earlier. Separately check batch length: raising a byte limit will not change the maximum number of JSON-RPC messages accepted.
Quick Recap
Best Value
- Used Book in Good Condition
Rank #3
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




