Skip to content

AAK-MCP-DEPRECATED-003: Use of deprecated logging capability (logging/setLevel)

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

What it detects

Server or client code declares or exercises the logging capability — the logging/setLevel request, the notifications/message log notification, or the SDK aliases (set_level, SetLevelRequest, LoggingMessageNotification, LoggingLevel). The ratified MCP 2026-07-28 spec deprecates logging (SEP-2577) under the 12-month deprecation policy (SEP-2596). Protocol-level log-level control was redundant with host-side observability and is on the removal path.

How to fix

Migrate before removal: emit logs to stderr or an OpenTelemetry exporter and control verbosity out-of-band, rather than advertising the logging capability / handling logging/setLevel. Deprecated 2026-07-28; plan to remove ahead of the ~mid-2027 window.

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

agent-audit-kit scan . --rules AAK-MCP-DEPRECATED-003

Limitations

In .py, .ts, .tsx, .js, .jsx, .mjs, .cjs, .rs, .java and .kt sources it looks for logging/setLevel, SetLevelRequest (or SetLevelRequestSchema), LoggingMessageNotification and LoggingLevel, and, in a file that also contains modelcontextprotocol, FastMCP, McpServer, @mcp., mcp.server, from mcp, import mcp (each as whole words), ServerCapabilities or mcpServers, for ServerCapabilities( with logging= before its first ), or a capabilities: { ... } literal that names logging before its first closing brace. In JSON, any capabilities object or list that lists logging counts, wherever the key sits, in .mcp.json and any *.mcp.json at any depth, and mcp.json, claude_desktop_config.json, package.json and the per-editor mcp.json files (.cursor, .vscode, .windsurf, .amazonq, .roo, .kiro) directly under the project root. In sources, sending log notifications through the SDK (server.sendLoggingMessage({...}), await ctx.info(...)), a capabilities literal with a nested object ahead of logging, and one in a file that names no MCP SDK are not matched; neither is a capabilities object in config/servers.json.

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