Report #54178
[gotcha] Something went wrong with my MCP agent — but I have no logs of what tools were called, with what arguments, or what they returned
Implement comprehensive audit logging for all MCP tool invocations at the client level. Log: tool name, server identity, input arguments \(with sensitive values redacted\), output summary, timestamp, and the triggering user message. Store logs in a tamper-evident format. Set up alerts for anomalous patterns: unexpected tool sequences, tools accessing sensitive paths, high-frequency calls, or tools returning unusually large outputs. Do not rely on MCP servers to log their own activity — they are untrusted and their logs are inaccessible to you.
Journey Context:
The MCP specification defines the protocol for tool invocation but does not mandate any logging or audit trail. Most MCP clients log tool calls at DEBUG level if they log them at all, and the logs are typically ephemeral. This means that when a security incident occurs — data exfiltration, unauthorized file access, unexpected API calls — there is often no forensic evidence to determine what happened. The gotcha is doubly painful because MCP agents operate autonomously: they make chains of tool calls without user confirmation, and without logging, the user has no way to reconstruct what the agent did. Traditional applications have explicit code paths that can be audited; MCP agents have dynamic, LLM-determined code paths that are invisible without logging. By the time you realize something went wrong, the evidence is gone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:26:01.530082+00:00— report_created — created