From d9749faa5780716bf279c209960fb2f9188e3835 Mon Sep 17 00:00:00 2001 From: victoriamreese Date: Fri, 13 Feb 2026 14:17:13 -0600 Subject: [PATCH 1/2] feat: add setting to configure mcp host --- backend/onyx/configs/app_configs.py | 1 + backend/onyx/mcp_server_main.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backend/onyx/configs/app_configs.py b/backend/onyx/configs/app_configs.py index ae414d1c8c64..886c0e7cd898 100644 --- a/backend/onyx/configs/app_configs.py +++ b/backend/onyx/configs/app_configs.py @@ -977,6 +977,7 @@ def get_current_tz_offset() -> int: # MCP Server Configs ##### MCP_SERVER_ENABLED = os.environ.get("MCP_SERVER_ENABLED", "").lower() == "true" +MCP_SERVER_HOST = os.environ.get("MCP_SERVER_HOST", "0.0.0.0") MCP_SERVER_PORT = int(os.environ.get("MCP_SERVER_PORT") or 8090) # CORS origins for MCP clients (comma-separated) diff --git a/backend/onyx/mcp_server_main.py b/backend/onyx/mcp_server_main.py index bef3c35738c6..55014fc3766a 100644 --- a/backend/onyx/mcp_server_main.py +++ b/backend/onyx/mcp_server_main.py @@ -3,6 +3,7 @@ import uvicorn from onyx.configs.app_configs import MCP_SERVER_ENABLED +from onyx.configs.app_configs import MCP_SERVER_HOST from onyx.configs.app_configs import MCP_SERVER_PORT from onyx.utils.logger import setup_logger @@ -15,13 +16,13 @@ def main() -> None: logger.info("MCP server is disabled (MCP_SERVER_ENABLED=false)") return - logger.info(f"Starting MCP server on 0.0.0.0:{MCP_SERVER_PORT}") + logger.info(f"Starting MCP server on {MCP_SERVER_HOST}:{MCP_SERVER_PORT}") from onyx.mcp_server.api import mcp_app uvicorn.run( mcp_app, - host="0.0.0.0", + host=MCP_SERVER_HOST, port=MCP_SERVER_PORT, log_config=None, ) From cca3b152d5ea240f4e990d114a414ee80c38b7fc Mon Sep 17 00:00:00 2001 From: victoriamreese Date: Fri, 13 Feb 2026 14:29:39 -0600 Subject: [PATCH 2/2] chore(helm): mcp server host config via env var --- deployment/helm/charts/onyx/Chart.yaml | 2 +- .../helm/charts/onyx/templates/mcp-server-deployment.yaml | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/deployment/helm/charts/onyx/Chart.yaml b/deployment/helm/charts/onyx/Chart.yaml index c750fb1f34c7..2ce6e4d316af 100644 --- a/deployment/helm/charts/onyx/Chart.yaml +++ b/deployment/helm/charts/onyx/Chart.yaml @@ -5,7 +5,7 @@ home: https://www.onyx.app/ sources: - "https://github.com/onyx-dot-app/onyx" type: application -version: 0.4.27 +version: 0.4.28 appVersion: latest annotations: category: Productivity diff --git a/deployment/helm/charts/onyx/templates/mcp-server-deployment.yaml b/deployment/helm/charts/onyx/templates/mcp-server-deployment.yaml index a4ef563e5d7d..bd831e004b02 100644 --- a/deployment/helm/charts/onyx/templates/mcp-server-deployment.yaml +++ b/deployment/helm/charts/onyx/templates/mcp-server-deployment.yaml @@ -88,6 +88,8 @@ spec: value: "true" - name: MCP_SERVER_PORT value: "{{ .Values.mcpServer.containerPorts.server }}" + - name: MCP_SERVER_HOST + value: "{{ .Values.global.host }}" {{- if .Values.mcpServer.corsOrigins }} - name: MCP_SERVER_CORS_ORIGINS value: "{{ .Values.mcpServer.corsOrigins }}"