Report #10915
[gotcha] MCP server exposing OAuth tokens or API keys in stdout or logs during authentication flow
Never log the full stdout/stderr of an MCP server process in a production agent environment; implement structured logging and strip sensitive headers/tokens before emitting telemetry.
Journey Context:
The MCP specification uses stdout/stdin for JSON-RPC communication between the host and the server. During OAuth flows or initial auth, servers might print sensitive tokens or error messages containing secrets to stderr/stdout. If the host agent logs this, the secrets end up in centralized logging systems, leading to credential leakage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:06:48.649874+00:00— report_created — created