diff --git a/mcp_clickhouse/mcp_env.py b/mcp_clickhouse/mcp_env.py index 29f1996..e264b81 100644 --- a/mcp_clickhouse/mcp_env.py +++ b/mcp_clickhouse/mcp_env.py @@ -28,6 +28,7 @@ class ClickHouseConfig: CLICKHOUSE_CONNECT_TIMEOUT: Connection timeout in seconds (default: 30) CLICKHOUSE_SEND_RECEIVE_TIMEOUT: Send/receive timeout in seconds (default: 300) CLICKHOUSE_DATABASE: Default database to use (default: None) + CLICKHOUSE_PROXY_PATH: Path to be added to the host URL. For instance, for servers behind an HTTP proxy (default: None) """ def __init__(self): @@ -96,6 +97,10 @@ def send_receive_timeout(self) -> int: Default: 300 (ClickHouse default) """ return int(os.getenv("CLICKHOUSE_SEND_RECEIVE_TIMEOUT", "300")) + + @property + def proxy_path(self) -> str: + return os.getenv("CLICKHOUSE_PROXY_PATH") def get_client_config(self) -> dict: """Get the configuration dictionary for clickhouse_connect client. @@ -118,6 +123,9 @@ def get_client_config(self) -> dict: # Add optional database if set if self.database: config["database"] = self.database + + if self.proxy_path: + config["proxy_path"] = self.proxy_path return config