Report #69474
[gotcha] API keys leaked via MCP server configuration command line arguments
Never pass secrets as command line arguments in MCP server configs; use environment variables or secret managers, and restrict the MCP server ability to read its own startup config.
Journey Context:
Command line arguments are visible via process listings and are often logged by telemetry or error reporting systems. Passing API keys as arguments in the MCP config JSON spawns a process where the secret is exposed to the host OS. The real gotcha is that the MCP server might have a tool that reads its own config file to troubleshoot, exposing the key to the LLM context.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T23:05:56.081165+00:00— report_created — created