[BUG] NO_PROXY from managed-settings.json not injected into MCP subprocess environment
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Since 2.1.113, NO_PROXY from managed-settings.json is not injected into MCP subprocess env. MCP servers that need to bypass the proxy fail to connect because the subprocess routes through the proxy without respecting the configured exclusions.
2.1.121 changelog says "Fixed NO_PROXY not being respected for all HTTP clients when set via managed-settings.json under the native build" but it seems the fix does not cover MCP subprocess spawning.
If I run claude mcp list with NO_PROXY set in managed-settings.json the MCP server fails to connect. If I set NO_PROXY in the environment, the MCP connection succeeds.
To confirm the bug, I wrapped an MCP server command to dump the subprocess environment:
claude mcp add test -- bash -c 'env | grep -i proxy > /tmp/mcp-env.txt; <original command>'
The resulting env dump shows HTTP_PROXY and HTTPS_PROXY are injected from managed-settings.json, but NO_PROXY is absent despite being configured there.
What Should Happen?
MCP server connections should succeed and not go through the configured HTTP_PROXY address.
Error Messages/Logs
server1: my-mcp-proxy --server https://internal-server-1.example.com - ✗ Failed to connect
server2: my-mcp-proxy --server https://internal-server-2.example.com - ✗ Failed to connect
server3: my-mcp-proxy --server https://internal-server-3.example.com - ✗ Failed to connect
test-env: bash -c env | grep -i proxy > /tmp/mcp-env.txt; my-mcp-proxy --server https://internal-server-1.example.com - ✗ Failed to connect
Steps to Reproduce
- Configure managed-settings.json with
HTTPS_PROXYandNO_PROXYunder the env key - Add a test MCP that dumps its env:
claude mcp add test-env -- bash -c 'env | grep -i proxy > /tmp/mcp-env.txt; sleep 5'
- Run
claude mcp listto trigger the subprocess - Check /tmp/mcp-env.txt — HTTP_PROXY and HTTPS_PROXY are present, NO_PROXY is missing
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.112
Claude Code Version
2.1.131
Platform
Google Vertex AI
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗