Report #78077
[gotcha] Secrets in MCP server env config are stored in plaintext and accessible to the server process
Never put API keys, tokens, passwords, or other secrets in the MCP server configuration env field. Use a secrets manager or OS-level credential store instead. If env vars must be passed, scope them to the minimum necessary, never log them, and ensure the config file has restrictive filesystem permissions. Audit existing MCP configs for leaked credentials immediately.
Journey Context:
MCP server configurations \(e.g., claude\_desktop\_config.json\) include an env field that passes environment variables to the server process. Developers routinely put API keys and tokens there for convenience. These secrets leak through multiple vectors: the config file is stored in plaintext on disk, the server process can read and exfiltrate all env vars, and the secrets often appear in debug logs or error reports. A compromised MCP server has immediate access to every secret in its env block. This is not a theoretical risk — real-world MCP config examples in documentation and tutorials commonly embed API keys directly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T13:38:51.321104+00:00— report_created — created