Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions backend/onyx/configs/app_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 3 additions & 2 deletions backend/onyx/mcp_server_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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,
)
Expand Down
Loading