Skip to content

AAK-MCP-CONFIG-MALFORMED-001: MCP server entry has a field of the wrong type

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

What it detects

An mcpServers entry declares a field whose type does not match the MCP client schema -- most often args as a scalar instead of a list of strings. Clients disagree about what to do with it: some coerce, some ignore the field, some refuse to start the server. A config that one client launches and another silently drops is a security fact, not a cosmetic one, because the reviewed configuration and the running configuration stop being the same thing. AAK's own composition pass crashed on "args": 42 (issue #743), which is how this was found: the scan reported a clean project because the scanner that would have objected died before it could.

How to fix

Give the field the type the MCP schema defines: args must be a list of strings (["--port", "8080"], not 8080). Validate agent configs in CI so a client-specific coercion never decides what runs.

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

agent-audit-kit scan . --rules AAK-MCP-CONFIG-MALFORMED-001

Limitations

Checks the JSON type of args, command, env and url on each entry of an mcpServers object, or of the servers object in VS Code's .vscode/mcp.json. A config whose mcpServers is an array, a server entry that is a bare string, and a wrong-typed headersHelper are skipped without a finding.

References

No external references are recorded for this rule.


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