start_server.sh•1.09 kB
#!/bin/bash
# Navigate to app directory
cd /app
# Display startup message
echo "Starting Kali MCP Server..."
echo "Server will be available at ${MCP_HOST:-127.0.0.1}:${MCP_PORT:-8000}"
# Debug: Check virtual environment
echo "Debugging virtual environment..."
ls -la venv/bin/ || echo "❌ venv/bin directory not found"
# Check if virtual environment exists and dependencies are installed
if [ -f "venv/bin/python" ]; then
echo "✓ Virtual environment found"
echo "Checking Python dependencies..."
./venv/bin/python -c "import fastmcp, pydantic; print('✓ Dependencies available')" || {
echo "❌ Dependencies missing, installing..."
# Use python -m pip instead of direct pip call
./venv/bin/python -m pip install -r requirements.txt || {
echo "❌ Failed to install dependencies"
exit 1
}
}
else
echo "❌ Virtual environment not found, this should not happen in Docker"
exit 1
fi
# Start the MCP server using virtual environment
echo "Launching MCP server..."
./venv/bin/python kali_mcp_server/server.py