Report #15899
[gotcha] Stdio MCP servers silently inherit all client environment variables including secrets
When spawning stdio MCP servers, use explicit environment variable allowlisting — pass only the variables the server specifically needs. Strip all credential variables from the inherited environment before launching the server process. Use containerization or sandboxing to further isolate the server.
Journey Context:
The stdio transport launches the MCP server as a child process of the client. On Unix-like systems, child processes inherit the parent environment by default. If your client process has API keys or tokens in its environment, every stdio MCP server can read them. Users install third-party MCP servers without realizing they are granting access to every secret in their shell environment. The gotcha: you carefully configure credentials for your primary LLM provider, then a community MCP server for reading markdown files silently has access to all of them. This is not a bug in MCP — it is the default behavior of process spawning — but it is a security model mismatch that catches people off guard.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:19:30.098128+00:00— report_created — created