-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathentrypoint.sh
More file actions
executable file
·33 lines (28 loc) · 938 Bytes
/
entrypoint.sh
File metadata and controls
executable file
·33 lines (28 loc) · 938 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 -euo pipefail
# Validate required environment variables before starting the server
required_vars=(
UNRAID_API_URL
UNRAID_API_KEY
)
# UNRAID_MCP_BEARER_TOKEN is only required for HTTP-based transports with auth enabled
_transport="${UNRAID_MCP_TRANSPORT:-streamable-http}"
_disable_auth="${UNRAID_MCP_DISABLE_HTTP_AUTH:-false}"
if [[ "$_transport" != "stdio" && "$_disable_auth" != "true" && "$_disable_auth" != "1" && "$_disable_auth" != "yes" ]]; then
required_vars+=(UNRAID_MCP_BEARER_TOKEN)
fi
missing=()
for var in "${required_vars[@]}"; do
if [ -z "${!var:-}" ]; then
missing+=("$var")
fi
done
if [ "${#missing[@]}" -gt 0 ]; then
echo "entrypoint: ERROR — required environment variables not set:" >&2
for v in "${missing[@]}"; do
echo " $v" >&2
done
exit 1
fi
# Hand off to server — exec replaces this process so signals are forwarded correctly
exec unraid-mcp-server "$@"