Skip to content

feat: Add HTTP proxy support for enterprise environments

Description

This merge request adds automatic HTTP/HTTPS proxy support to the Indico MCP Server, enabling it to work seamlessly in corporate and research environments that require proxy access for external HTTP requests.

Changes Made

  • Enhanced HTTP Client Configuration: Updated IndicoAPI class constructor to detect and configure HTTP/HTTPS proxy agents automatically
  • Proxy Agent Integration: Added https-proxy-agent and http-proxy-agent dependencies for robust proxy handling
  • Environment Variable Detection: Automatic detection of HTTP_PROXY, HTTPS_PROXY, http_proxy, and https_proxy environment variables
  • Backward Compatibility: Maintains full functionality in non-proxy environments
  • Documentation: Updated README.md with proxy configuration section and usage examples
  • Debug Logging: Added proxy status logging to help with troubleshooting connectivity issues

Technical Implementation

The proxy support is implemented through:

  1. Automatic Detection: The server checks for standard proxy environment variables at startup
  2. Agent Configuration: When a proxy is detected, appropriate proxy agents are configured for axios HTTP client
  3. Fallback Behavior: If no proxy is configured, the server operates normally without proxy agents
  4. Universal Compatibility: Works with both HTTP and HTTPS proxies, supporting mixed environments

Use Cases

This enhancement specifically addresses:

  • CERN Environment: Where proxy access is required for external HTTP requests
  • Corporate Networks: Enterprise environments with mandatory proxy configurations
  • Research Institutions: Academic networks that route traffic through proxy servers
  • Firewall Restrictions: Environments where direct internet access is blocked

Testing

The implementation has been tested with:

  • Direct internet connection (no proxy)
  • HTTP proxy configuration
  • HTTPS proxy configuration
  • Mixed proxy environment variables
  • CERN network environment
  • All MCP tools functionality with proxy

Breaking Changes

None. This is a backward-compatible enhancement that doesn't affect existing installations.

Dependencies Added

  • https-proxy-agent: ^7.0.6 - HTTPS proxy support
  • http-proxy-agent: ^7.0.2 - HTTP proxy support

Both dependencies are mature, well-maintained packages with minimal footprint.

Documentation Updates

  • Added "Proxy Support" section to README.md
  • Documented environment variables for proxy configuration
  • Included examples for common proxy scenarios
  • Added troubleshooting notes for proxy-related issues

This change ensures the Indico MCP Server can be deployed in any network environment while maintaining optimal performance and reliability.

Merge request reports

Loading