21 lines
834 B
Bash
21 lines
834 B
Bash
#!/bin/sh
|
|||
|
|
set -eu
|
||
|
|
|
||
|
|
# mcpo's --api-key is a CLI flag, not something it reads from its own
|
||
|
|
# environment, but the actual value must come from the container's
|
||
|
|
# environment rather than being baked into the image. This script builds
|
||
|
|
# the mcpo command line at container start so that can happen.
|
||
|
|
#
|
||
|
|
# webfetch-mcp reads SEARXNG_BASE / DEBUG / DETAILED_LOG from its own
|
||
|
|
# process environment. No passthrough is needed here: mcpo builds the
|
||
|
|
# spawned child's environment as {**os.environ, **extra}, so anything set
|
||
|
|
# on this container's environment reaches webfetch-mcp automatically.
|
||
|
|
|
||
|
|
PORT="${MCPO_PORT:-8000}"
|
||
|
|
|
||
|
|
if [ -n "${MCPO_API_KEY:-}" ]; then
|
||
|
|
exec mcpo --host 0.0.0.0 --port "$PORT" --api-key "$MCPO_API_KEY" -- node /app/webfetch-mcp/server.mjs
|
||
|
|
else
|
||
|
|
exec mcpo --host 0.0.0.0 --port "$PORT" -- node /app/webfetch-mcp/server.mjs
|
||
|
|
fi
|