feat(core): honor HTTPS_PROXY/HTTP_PROXY/NO_PROXY in the Node transport#1590
Conversation
|
@claude review |
|
Claude finished @cliffhall's task in 3m 37s —— View job Code Review
Nice, focused change. The lazy-import design is clean, the actionable error is a good touch, 🔴 1. Node engine floor is misstated — undici 8.5.0 actually requires
|
|
Thanks for the thorough review. Addressed in the latest push: 🔴 1. Node engine floor — Fixed. You're right: the installed 🟠 2. Web backend self-declared dependency — Considered and intentionally not adding Nits — Added the one-line comment on the SSE path noting that a caller-supplied @claude review |
|
Claude finished @cliffhall's task in 1m 15s —— View job Re-review
Thanks for the thorough follow-up — the responses are all sound. Verification results below. ✅ 1. Node engine floor — resolved, with one leftoverThe floor is now consistently One thing slipped through, though: the root // package-lock.json:38-40
"engines": {
"node": ">=22.7.5"
}
✅ 2. Web dependency — rationale acceptedThe reasoning holds: the web backend ships inside the root ✅ 3. SSE nit — addressedThe comment at Only item 1's lockfile leftover is worth a commit before merge; everything else LGTM. 👍 |
|
Good catch on the stale lockfile. Fixed in @claude review |
|
Claude finished @cliffhall's task in 26s —— View job Re-review
Verified — the last leftover from the prior review is resolved. ✅ Commit // package-lock.json:38-40
"engines": {
"node": ">=22.19.0"
}which matches The Node floor is now consistent across all five touch-points: Everything from the earlier rounds (engine floor reconciliation, the intentional single-sourced |
|
📋 Smoke test & AGENTS.md audit for this PR: #1563 (comment) (posted on the linked issue #1563). |
…ase change; tree unchanged)
Closes #1563
Summary
Makes the Node transport factory (
core/mcp/node/transport.ts) honor the standardHTTPS_PROXY/HTTP_PROXY/NO_PROXYenvironment variables so the CLI and web backend can reach remote MCP servers from behind corporate proxies with zero new flags. Wave 1 of the PR #1510 decomposition (tracking issue #1579).Changes
core/mcp/node/transport.ts: addsreadProxyEnv()(checksHTTPS_PROXY/https_proxy/HTTP_PROXY/http_proxyin undici's precedence) andwithProxyDispatcher(), which wraps the base fetch so outbound requests carry an undiciEnvHttpProxyAgentdispatcher (covers both schemes and respectsNO_PROXY).createTransportNodenow wraps itsbaseFetchthrough it.undiciis imported dynamically only when a proxy var is set, so non-proxy callers (TUI, web backend) pay nothing. If a proxy is configured butundicican't be loaded, the wrapper throws an actionable error instead of silently ignoring the env var.undici@^8.5.0to the repo-rootpackage.json(sharedcore/resolution + web integration tests) and toclients/cli/package.json(the CLI ships proxy support at runtime). undici 8 requires Node>= 22.7.5, which matches the inspector's supported floor.clients/web/src/test/integration/mcp/node/transport.test.tswith proxy coverage —readProxyEnvprecedence/empty-string handling,withProxyDispatcherpassthrough when unset, dispatcher injection + lazy singleton reuse,createTransportNodewrapping, and the actionable error when undici is unavailable.Testing
clients/webtest:integration: 106 passed (transport suite).clients/webtest:coverage(unit + integration): 3242 passed;transport.tsat 100% lines/statements/functions, 93.61% branches — clears the ≥90% per-file gate.validate:webpasses (unit flake inuseServers.test.tsxunder parallel load reproduces on the base branch and passes in isolation; unrelated to this change).🤖 Generated with Claude Code
https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX