docs/spec/proxy-security.md:39 specs MAX_REQUEST_BYTES = 10 * 1024 * 1024 # 10MB.
Both implementations enforce 1MB:
scripts/mock_upstream.py, MAX_REQUEST_BYTES = 1_000_000
src/cmcp_runtime/mcp/server.py, _DEFAULT_MAX_REQUEST_BYTES = 1_000_000, used as the max_request_bytes default on MCPServer.__init__
An order of magnitude apart, and nothing in the repo records which one is intended. I raised this on #562 while implementing MAX_STRING_LENGTH and deliberately didn't pick a side, but #562 was closed as completed by #570, so the question isn't tracked anywhere now. Opening this so it isn't lost.
The two readings lead opposite ways:
- 1MB was a deliberate tightening, and the spec is stale. Fix the document.
- 1MB is drift, and implementations should be raised toward 10MB. Fix the code, and note that widening a DoS bound is not a change to make quietly.
I don't have evidence for either. The spec is Draft v0.1 and its git history doesn't say where 10MB came from.
Two things that depend on the answer, so it's worth settling rather than leaving:
MAX_STRING_LENGTH is now derived from whatever body cap is enforced (#570, and #572 makes the spec say so), which removes the dead-code hazard at either value. So this doesn't block that. But the derived cap moves with the body cap, and a jump from 1MB to 10MB moves the per-string cap from 500KB to 5MB, which is a real change in what the gateway accepts rather than a documentation cleanup.
MAX_JSON_NESTING_DEPTH and MAX_PARSE_TIME_MS are still unimplemented. Whoever implements them will size them against a body cap, and picking against the wrong one bakes the mismatch in further.
Happy to send whichever patch the answer implies. I don't think it's a contributor's call to make.
docs/spec/proxy-security.md:39specsMAX_REQUEST_BYTES = 10 * 1024 * 1024 # 10MB.Both implementations enforce 1MB:
scripts/mock_upstream.py,MAX_REQUEST_BYTES = 1_000_000src/cmcp_runtime/mcp/server.py,_DEFAULT_MAX_REQUEST_BYTES = 1_000_000, used as themax_request_bytesdefault onMCPServer.__init__An order of magnitude apart, and nothing in the repo records which one is intended. I raised this on #562 while implementing
MAX_STRING_LENGTHand deliberately didn't pick a side, but #562 was closed as completed by #570, so the question isn't tracked anywhere now. Opening this so it isn't lost.The two readings lead opposite ways:
I don't have evidence for either. The spec is Draft v0.1 and its git history doesn't say where 10MB came from.
Two things that depend on the answer, so it's worth settling rather than leaving:
MAX_STRING_LENGTHis now derived from whatever body cap is enforced (#570, and #572 makes the spec say so), which removes the dead-code hazard at either value. So this doesn't block that. But the derived cap moves with the body cap, and a jump from 1MB to 10MB moves the per-string cap from 500KB to 5MB, which is a real change in what the gateway accepts rather than a documentation cleanup.MAX_JSON_NESTING_DEPTHandMAX_PARSE_TIME_MSare still unimplemented. Whoever implements them will size them against a body cap, and picking against the wrong one bakes the mismatch in further.Happy to send whichever patch the answer implies. I don't think it's a contributor's call to make.