Skip to content

Commit e51455a

Browse files
authored
Merge pull request #235 from GitHubSecurityLab/anticomputer/proxy-env-passthrough
Inherit proxy env vars in MCP server subprocesses
2 parents b71c2e0 + 87683e2 commit e51455a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/seclab_taskflow_agent/mcp_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import hashlib
2121
import json
2222
import logging
23+
import os
2324
import shutil
2425
from typing import Any
2526

@@ -175,6 +176,12 @@ def mcp_client_params(
175176
logging.critical(e)
176177
logging.info("Assuming toolbox has default configuration available")
177178
del env[k]
179+
# Inherit proxy env vars from parent so HTTP clients
180+
# work correctly inside network-isolated environments (AWF)
181+
for proxy_var in ("HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY",
182+
"http_proxy", "https_proxy", "no_proxy"):
183+
if proxy_var not in env and proxy_var in os.environ:
184+
env[proxy_var] = os.environ[proxy_var]
178185
logging.debug(f"Tool call environment: {env}")
179186
if args:
180187
for i, v in enumerate(args):

0 commit comments

Comments
 (0)