-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·33 lines (30 loc) · 933 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·33 lines (30 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -e
# Environment variables with defaults
CML_URL=${CML_URL:-https://cml.host.internal}
CML_MCP_TRANSPORT=${CML_MCP_TRANSPORT:-stdio}
CML_MCP_BIND=${CML_MCP_BIND:-0.0.0.0}
CML_MCP_PORT=${CML_MCP_PORT:-9000}
DEBUG=${DEBUG:-false}
# Export for Python to pick up
export CML_URL
export CML_MCP_TRANSPORT
export CML_MCP_BIND
export CML_MCP_PORT
export DEBUG
if [ "$CML_MCP_TRANSPORT" = "stdio" ]; then
# stdio mode requires credentials in environment
if [ -z "$CML_USERNAME" ] || [ -z "$CML_PASSWORD" ]; then
echo "ERROR: CML_USERNAME and CML_PASSWORD must be set for stdio transport."
echo " In HTTP mode, credentials are provided via X-Authorization header."
exit 1
fi
exec cml-mcp
else
# HTTP mode - credentials provided per-request via headers
exec uvicorn cml_mcp.server:app \
--host "${CML_MCP_BIND}" \
--port "${CML_MCP_PORT}" \
--workers 1 \
--access-log
fi