In this article
Test the enabled server factory at the structural boundary and observe that schema and handler code never run for excess input; package version alone is insufficient.
The November 15 Qwen Code v0.27.4 release enables the MCP tool-input element ceiling on owned servers as part of a dependency security repair. Upgrading the SDK alone would leave that upstream option disabled. The boundary counts object members and array elements together, rather than limiting only character length. It should stop an excessive structure before schema parsing or tool execution while allowing ordinary useful inputs afterward.
Count containers’ entries with one explicit rule
Build harmless inputs around the implementation’s 100,000-element ceiling. The documented example includes the object member itself as well as its array elements, so a root object holding 99,999 array entries reaches the boundary. Adding one more entry exceeds it. Compute the expected count independently and preserve the exact fixture. Counting only the array length would produce an off-by-one acceptance test that certifies a different policy from the one the server actually applies.
Refusal must precede expensive downstream work
Instrument an owned schema parser and inert handler with distinct counters. Submit an excessive input and assert both remain untouched, then send a small valid input and observe each normal invocation. An error returned after handler entry is too late to establish this boundary. Keep the test schema permissive enough that the structural check, rather than an unrelated validation rule, is what determines the excessive case’s outcome.
A long scalar is a different resource shape
Use a long harmless string as a control beside the many-element tree. The implementation’s regression plan deliberately distinguishes character count from structural element count. Do not present this ceiling as a complete byte, decompression or execution-time budget. Applications may need those separate policies for their own tools. A successful long-string call establishes that the structural guard is not accidentally rejecting by string length, not that arbitrary giant content is safe or free to process.
Both construction paths must enable the option
Exercise the owned server factories used by the application and inspect their effective option, then repeat a healthy call after every refused excessive input. This checks configuration activation and process recovery rather than library presence. A useful adoption record contains exact element arithmetic, pre-handler refusal, scalar controls, enabled factory identity and subsequent usefulness. It describes one delivered structural guard with clear scope instead of claiming a universal denial-of-service defense for every third-party MCP server.
Sources
Related reading
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.