Add comprehensive one-command setup.sh script that handles:
- Prerequisites validation (Python 3, Git)
- Virtual environment creation and dependency installation
- Ollama installation and model download (llama3.1, nomic-embed-text)
- Redis installation and startup
- Directory and database initialization
- Frontend npm dependencies
- Clear progress output and next steps
Fix critical database path issues:
- Use absolute path calculation in config.py to ensure consistency
- Export SQLITE_DB_PATH environment variable in startup scripts
- Prevents database separation between app and MCP server
Fix document metadata field naming:
- Change metadata field from 'source' to 'filename' in MCP ingest
- Ensures consistency with existing document format
- Fixes document visibility issue in API endpoints
Update startup scripts to support environment-based database configuration.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
49 lines
1.4 KiB
Bash
Executable file
49 lines
1.4 KiB
Bash
Executable file
#!/bin/bash
|
|
# Start the MCP server natively on macOS with Metal GPU acceleration
|
|
|
|
echo "🚀 Starting Claude OS MCP Server (Native, no Docker)"
|
|
echo "=================================================="
|
|
echo ""
|
|
echo "System Info:"
|
|
echo " - CPU Cores: $(sysctl -n hw.ncpu)"
|
|
echo " - RAM: $(sysctl -n hw.memsize | awk '{print $0/1024/1024/1024 " GB"}')"
|
|
echo " - Ollama: $(which ollama)"
|
|
echo ""
|
|
|
|
# Get the project directory
|
|
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
# Check if Ollama is running
|
|
if ! curl -s http://localhost:11434/api/tags &> /dev/null; then
|
|
echo "❌ Ollama is not running!"
|
|
echo "Start Ollama with: brew services start ollama"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Ollama is running"
|
|
echo ""
|
|
|
|
# Activate venv
|
|
source "$PROJECT_DIR/venv/bin/activate"
|
|
|
|
# Check PostgreSQL connection
|
|
echo "Checking PostgreSQL connection..."
|
|
if ! psql -h localhost -U $USER -d codeforge -c "SELECT 1" &> /dev/null; then
|
|
echo "⚠️ Warning: Could not connect to PostgreSQL"
|
|
echo " Make sure PostgreSQL is running and accessible"
|
|
fi
|
|
|
|
echo ""
|
|
echo "Starting MCP Server..."
|
|
echo "📡 MCP Server will be available at: http://localhost:8051"
|
|
echo ""
|
|
echo "Press Ctrl+C to stop the server"
|
|
echo ""
|
|
|
|
# Run the server from the project root with correct database path
|
|
export SQLITE_DB_PATH="$PROJECT_DIR/data/claude-os.db"
|
|
echo "Database: $SQLITE_DB_PATH"
|
|
echo ""
|
|
|
|
cd "$PROJECT_DIR/mcp_server"
|
|
python3 server.py
|