Skip to content

AAK-MCP-TOOLS-LIST-UNBOUNDED-001: MCP tool catalogue built from an upstream response with no cap

Severity
MEDIUM
Category
MCP Configuration (mcp-config)
Scanner
agent_audit_kit/scanners/mcp_tools_list_unbounded.py
Auto-fixable
No.
SARIF name
McpToolsListUnbounded

What it detects

An MCP client or aggregator assembles its tool catalogue from what upstream servers return, with no bound on the number of tools or the size of a schema. The size of the allocation is then chosen by whoever controls the upstream, not by this process. Distinct from an unbounded request body: that value arrives from the caller, this one arrives from the server being aggregated, and a body-size limit does not touch it.

How to fix

Cap the number of tools accepted from any single upstream and reject oversized descriptions and schemas before building the catalogue.

To confirm the finding is gone, report only this rule:

agent-audit-kit scan . --rules AAK-MCP-TOOLS-LIST-UNBOUNDED-001

Limitations

Detects the absence of any bound in the same file as the catalogue builder. A cap enforced in a wrapper or by the transport layer is not seen, and a slice, a length check, a max_* constant or a break in the loop all clear the finding.

References


All rules. This page is generated from the rule registry when the documentation is built; to change it, change the rule in agent_audit_kit/rules/builtin.py. To give the rule a hand-written write-up, add docs/rules/AAK-MCP-TOOLS-LIST-UNBOUNDED-001.md: the page then shows that text, with the registry reference appended under it.