Report #17217
[gotcha] My MCP server runs as a separate process so it cannot access my API keys
Explicitly pass only required environment variables to MCP server processes. Never rely on default environment inheritance. Use containerization, sandboxing, or minimal env injection to isolate MCP servers from the parent's credential store.
Journey Context:
When MCP servers are launched via stdio transport — the most common pattern — they are spawned as child processes that inherit the full environment of the parent. Every API key, token, and credential in process.env is readable by the MCP server. Developers assume process isolation provides a security boundary, but environment-variable inheritance silently punches through it. A malicious or compromised MCP server can exfiltrate all env vars in a single tool call with zero extra privilege.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:47:43.618413+00:00— report_created — created