Skip to content

Commit 2402f02

Browse files
authored
Merge branch 'main' into add-chdb-mcp
2 parents 36c1ff2 + 6cb8eaa commit 2402f02

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

mcp_clickhouse/mcp_env.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class ClickHouseConfig:
2828
CLICKHOUSE_CONNECT_TIMEOUT: Connection timeout in seconds (default: 30)
2929
CLICKHOUSE_SEND_RECEIVE_TIMEOUT: Send/receive timeout in seconds (default: 300)
3030
CLICKHOUSE_DATABASE: Default database to use (default: None)
31+
CLICKHOUSE_PROXY_PATH: Path to be added to the host URL. For instance, for servers behind an HTTP proxy (default: None)
3132
CLICKHOUSE_ENABLED: Enable ClickHouse server (default: true)
3233
"""
3334

@@ -106,6 +107,10 @@ def send_receive_timeout(self) -> int:
106107
Default: 300 (ClickHouse default)
107108
"""
108109
return int(os.getenv("CLICKHOUSE_SEND_RECEIVE_TIMEOUT", "300"))
110+
111+
@property
112+
def proxy_path(self) -> str:
113+
return os.getenv("CLICKHOUSE_PROXY_PATH")
109114

110115
def get_client_config(self) -> dict:
111116
"""Get the configuration dictionary for clickhouse_connect client.
@@ -128,6 +133,9 @@ def get_client_config(self) -> dict:
128133
# Add optional database if set
129134
if self.database:
130135
config["database"] = self.database
136+
137+
if self.proxy_path:
138+
config["proxy_path"] = self.proxy_path
131139

132140
return config
133141

0 commit comments

Comments
 (0)