createmcps.com

MCP-SEC-006

Schema depth and subschema count stay within safe bounds

Implementations SHOULD apply reasonable bounds, such as a maximum schema depth, a cap on the total number of subschemas, or a per-validation time budget, to prevent a malicious schema from acting as a Denial-of-Service vector.spec anchor

How to fix this

Keep advertised schemas shallow and bounded in subschema count. The specification asks for reasonable limits without naming a number, because a deeply nested schema is a denial-of-service vector against whatever validates it.

How the validator checks this

Probe P2.1, against a streamable-http server on the modern protocol. What it reports:

pass
Schemas stay within the bounds this validator applies: depth … of …, … subschemas of
warn
…. The specification asks for "reasonable bounds" without naming a number, so these are this validator's limits, not a spec threshold.

Quoted from the probe that runs this check, so it cannot drift from what the validator actually reports.

This rule is checked deterministically: a fail here is a certain violation, not an inference.

Checked in the same request as MCP-HDR-008, MCP-HDR-009, MCP-RES-003, MCP-RES-006, MCP-RES-007, MCP-ERR-003, MCP-ERR-004, MCP-ERR-005, MCP-ERR-008, MCP-CAC-001, MCP-CAC-002, MCP-CAC-003, MCP-CAC-004, MCP-CAC-005, MCP-SCH-001, MCP-SCH-002, MCP-SCH-003, MCP-SCH-004, MCP-SCH-005, MCP-SCH-006, MCP-SCH-007, MCP-SEC-004, MCP-SEC-005, MCP-DEP-005.

Check your own server against this rule

The validator makes real protocol requests and reports this rule as pass, warn or fail alongside the other 78. Validate a server or read how the check works.

Other Security posture rules

  • MCP-SEC-001Invalid Origin header returns HTTP 403
  • MCP-SEC-002Endpoint is HTTPS with a valid, unexpired certificate chain
  • MCP-SEC-003Error messages do not echo request headers or credentials
  • MCP-SEC-004icons[].src is https: or data:, same-origin, no unsafe scheme
  • MCP-SEC-005No $ref in tool schemas resolves to a network URI
  • MCP-SEC-007Server does not reflect the Authorization header into responses