Repository navigation
Inherit proxy env vars in MCP server subprocesses - #235
Merged
Merged
Conversation
When toolbox YAML specifies an explicit env block, the MCP SDK creates a subprocess with only those vars plus HOME/PATH/etc. HTTP_PROXY/HTTPS_PROXY from the parent are lost, breaking HTTPS inside network-isolated environments (e.g. AWF) where all traffic must route through a proxy. Inherit proxy-related env vars (HTTP_PROXY, HTTPS_PROXY, NO_PROXY and lowercase variants) from the parent process into MCP server subprocess environments.
anticomputer
requested review from
JarLob,
Kwstubbs,
kevinbackhouse,
m-y-mo,
p- and
sylwia-budzynska
as code owners
May 6, 2026 16:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When toolbox YAML specifies an explicit
envblock, the subprocess gets only those vars (plus HOME/PATH from the MCP SDK defaults).HTTP_PROXY/HTTPS_PROXYfrom the parent are lost.This breaks HTTPS inside network-isolated environments like AWF, where all traffic must route through a Squid proxy. The MCP file viewer and other servers fail with
[SSL] record layer failurebecause Python tries direct connections that hit iptables DNAT instead of using the proxy.Fix: inherit proxy-related env vars from the parent process into MCP server subprocess environments when they're not already set by the toolbox config.