Skip to content

add the NO_PROXY env variable feature to avoid proxy calling MCP servers listening on localhost #3340

@biagiomaf

Description

@biagiomaf

What happened?

I am using gemini-cli behind my company proxy that works only for internet websites and doesn't work for the local network or localhost. I put the proxy url in the http_proxy and https_proxy enviroment variables in my .bat, It is ok only for the tools that go to the internet, unfortunately for the MCP servers that are listening on localhost or 127.0.0.1 those MCP servers don't work because there is no way to exclude localhost and 127.0.0.1 from the proxy. I use many nodejs apps and they all use the env variable NO_PROXY to exclude some address, that doesnt work for gemini-cli. So how can I use my MCP servers if I am behind a company proxy?

What did you expect to happen?

setting NO_PROXY=localhost I expected gemini-cli working with MCP server or services on the localhost even if I am behind a proxy to navigate internet.

Client information

Details
$ gemini /about
 About Gemini CLI                                   │
│                                                    │
│ CLI Version       0.1.9                            │
│ Git Commit        34935d6                          │
│ Model             gemini-2.5-pro                   │
│ Sandbox           no sandbox                       │
│ OS                win32                            │
│ Auth Method       OAuth

Login information

No response

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p2Important but can be addressed in a future release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions