Skip to content

AAK-MCP-004: Excessive number of MCP servers declared

Severity
HIGH
Category
MCP Configuration (mcp-config)
Scanner
agent_audit_kit/scanners/mcp_config.py
Auto-fixable
No.
SARIF name
ExcessiveMcpServers

What it detects

More than 10 MCP servers in a single config. Large tool surface increases attack surface.

How to fix

Remove the servers this project does not use until each server map, mcpServers or VS Code's servers, lists 10 or fewer. The rule counts each map on its own and fires above 10.

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

agent-audit-kit scan . --rules AAK-MCP-004

Limitations

Counts the entries of one server map (mcpServers, or servers in VS Code's .vscode/mcp.json) in one config file and fires above 10. Servers split across files are not added up: six in .vscode/mcp.json and six in the .mcp.json beside it, which VS Code's agent host loads together, pass.

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-004.md: the page then shows that text, with the registry reference appended under it.