Context7 MCP ignores HTTP_PROXY/HTTPS_PROXY — any proxy workaround?
I run the Context7 MCP server (
@upstash/context7-mcp) in an environment where all outbound traffic must go through an HTTP proxy. Setting theHTTP_PROXYandHTTPS_PROXYenvironment variables has no effect, and searches fail withTypeError: fetch failedandconnect ECONNREFUSED 76.76.21.21:443. Is there an official way to configure a proxy, or a workaround until support is added?Originally asked on GitHub: https://github.com/upstash/context7/issues/250
5 answers
Status: proxy support is now implemented in the project source; on 2025-08-21 the maintainer said the new package version would be released soon. When the issue was filed there was no official proxy option: setting
HTTP_PROXY/HTTPS_PROXYhad no effect and searches failed withTypeError: fetch failedandconnect ECONNREFUSED 76.76.21.21:443(orENETUNREACHwhen run viabun x).Confirmed workaround from the thread:
- Clone the repository, build it locally, and start the server with
bun run dist/index.js. One user confirmed this made the server readHTTPS_PROXYand route requests through the proxy. This was the only confirmed working approach.
Unconfirmed suggestion from the thread:
- Run
bunx --bun @upstash/context7-mcp. The suggestion was based on Bun's docs, which state that executables marked with a#!/usr/bin/env nodeshebang are run via a Node process unless--bunis passed. Plainbun x @upstash/context7-mcpdid run under Node and failed withENETUNREACH. The thread does not confirm whether--bunworked.
Once the new release is out, upgrading
@upstash/context7-mcpis the intended fix. General advice: setHTTP_PROXYandHTTPS_PROXYin the environment that launches the MCP server so the process inherits them. If your proxy requires credentials, note that these variables can contain them and may appear in process listings or logs.Did this work for you?- Clone the repository, build it locally, and start the server with
What @clemux tried on GitHub (Worked)
Cloned the project, built it locally, and started the server with
bun run dist/index.js; the server then readHTTPS_PROXYand routed requests through the proxy.Source: https://github.com/upstash/context7/issues/250#issuecomment-2950173325 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Didn't work)
Set
HTTP_PROXYandHTTPS_PROXYenvironment variables; requests still went direct and failed withECONNREFUSEDto 76.76.21.21:443.Source: https://github.com/upstash/context7/issues/250 (opens external site)
Did this work for you?What @clemux tried on GitHub (Didn't work)
Ran the published package with
bun x @upstash/context7-mcp; it still executed under the Node runtime and failed withENETUNREACHto 76.76.21.21:443.Source: https://github.com/upstash/context7/issues/250#issuecomment-2950173325 (opens external site)
Did this work for you?What @spelunker tried on GitHub (Outcome unclear)
Suggested
bunx --bun @upstash/context7-mcpto force Bun's runtime instead of the Node process Bun would otherwise spawn; the thread does not confirm whether this worked.Source: https://github.com/upstash/context7/issues/250#issuecomment-3047223900 (opens external site)
Did this work for you?
Related questions
- How do I add a library's generated llms.txt / llms-full.txt file to Context7?
- Does Context7 support documentation versioning like Next.js 13 vs 14?
- Does the context7 MCP server support SSE or Streamable HTTP transport?
- Does Context7 validate user-submitted repository docs against malicious content?
- Context7 MCP: "Documentation not found or not finalized" error in Claude Code — fix?