claude-os/start_mcp_server.sh
Bob Roberts 53295444de Major refactor: Native Ollama setup + MCP integration
Features:
- Fixed Ollama configuration for native (localhost) instead of Docker
- Increased LLM timeout from 30s to 120s for quality answers
- Implemented KB slug system for clean MCP endpoint URLs
- Added multiple knowledge base support with type metadata
- Integrated MCP server with FastAPI (port 8051)
- React frontend with KB management UI
- PostgreSQL + pgvector for vector embeddings

Performance:
- 33-56% faster than Docker setup with native Ollama
- Direct Metal GPU acceleration on Apple Silicon
- Optimized RAG engine with caching
- ~40s response time for comprehensive answers

Documentation:
- Complete native setup guide (README_NATIVE_SETUP.md)
- Performance benchmarking and comparison
- MCP endpoint documentation
- Slug implementation details
- Decision rationale for native vs Docker

Cleanup:
- Removed old Streamlit setup files
- Consolidated setup scripts to single setup_native.sh
- Consolidated service management scripts
- Removed test artifacts and old analysis docs
- Ready for sharing with team

🚀 Production-ready for local team deployment

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:37:19 -05:00

42 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
# Start the MCP server natively on macOS with Metal GPU acceleration
echo "🚀 Starting Code-Forge 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 ""
# 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 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
cd mcp_server
python server.py