Skip to content

VirusTotal Client factory should trust_env #142

@erichutchins

Description

@erichutchins

Attempting to use the GTI MCP from behind a proxy and I had to modify server/gti/gti_mcp/server.py to trust the environment variables.

def _vt_client_factory(unused_ctx) -> vt.Client:
  api_key = os.getenv("VT_APIKEY")
  if not api_key:
    raise ValueError("VT_APIKEY environment variable is required")
  return vt.Client(api_key, trust_env=True)  # explicitly set trust_env to inherit HTTPS_PROXY

https://virustotal.github.io/vt-py/api/client.html

trust_env (bool) – Get proxies information from HTTP_PROXY/
HTTPS_PROXY environment variables if the parameter is True (False 
by default).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions