codeMcp / scripts /start.sh
sarveshpatel's picture
Update scripts/start.sh
ab84d3f verified
raw
history blame contribute delete
763 Bytes
#!/bin/bash
set -e
# Ensure uv is in PATH
export PATH="/root/.local/bin:$PATH"
echo "Starting MCP Code Executor on Hugging Face Spaces..."
echo "Environment Type: ${ENV_TYPE:-venv-uv}"
echo "Code Storage Dir: ${CODE_STORAGE_DIR:-/app/code_storage}"
echo "Workers: ${WORKERS:-4}"
echo "Max Concurrent Executions: ${MAX_CONCURRENT_EXECUTIONS:-20}"
# Ensure code storage directory exists
mkdir -p "${CODE_STORAGE_DIR:-/app/code_storage}"
# Start uvicorn with optimal settings for HF Spaces
exec uvicorn app.main:app \
--host 0.0.0.0 \
--port 7860 \
--workers "${WORKERS:-4}" \
--loop uvloop \
--http httptools \
--limit-concurrency "${MAX_CONCURRENT_EXECUTIONS:-20}" \
--timeout-keep-alive 65 \
--access-log \
--log-level info