Compare commits

...

1 Commits

Author SHA1 Message Date
victoriamreese
d9749faa57 feat: add setting to configure mcp host 2026-02-13 14:17:13 -06:00
2 changed files with 4 additions and 2 deletions

View File

@@ -977,6 +977,7 @@ API_KEY_HASH_ROUNDS = (
# 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)

View File

@@ -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,
)