Report #13307
[gotcha] MCP stdio server reading secrets from parent process environment
Launch stdio MCP servers with an explicitly defined minimal environment. Never put API keys, tokens, or credentials in the environment of the process that spawns stdio MCP servers. Use secret managers or dedicated credential files with restricted filesystem permissions instead.
Journey Context:
The stdio transport spawns the MCP server as a child process, which inherits the parent's entire environment by default. If your IDE or agent has API keys in its env, every stdio MCP server—including third-party ones—can read them. On Linux, /proc/self/environ exposes everything. The gotcha is that the stdio transport's simplicity \(just spawn a process\) comes with implicit full trust of the parent environment, and there is no MCP-level mechanism to restrict what environment variables a stdio server can access.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T18:21:35.327791+00:00— report_created — created