Features: - Vector search with Pinecone + Vertex AI embeddings - Document relationships (link, unlink, related, graph) - Auto-link with LLM analysis - Intelligent merge with Gemini Modular structure: - clients/: Pinecone, Vertex AI - tools/: core, relations, stats - utils/: validation, logging Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
34 lines
1.1 KiB
Bash
Executable File
34 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# RAG MCP Server Deploy Script
|
|
|
|
HOST="root@10.253.100.107"
|
|
REMOTE_DIR="/root/rag-mcp"
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
echo "📦 Copying project files to rag-mcp..."
|
|
|
|
# Create directories
|
|
ssh ${HOST} "mkdir -p ${REMOTE_DIR}/{clients,tools,utils}"
|
|
|
|
# Copy files
|
|
scp "${SCRIPT_DIR}/server.py" "${SCRIPT_DIR}/config.py" "${SCRIPT_DIR}/pyproject.toml" ${HOST}:${REMOTE_DIR}/
|
|
scp "${SCRIPT_DIR}/clients/"*.py ${HOST}:${REMOTE_DIR}/clients/
|
|
scp "${SCRIPT_DIR}/tools/"*.py ${HOST}:${REMOTE_DIR}/tools/
|
|
scp "${SCRIPT_DIR}/utils/"*.py ${HOST}:${REMOTE_DIR}/utils/
|
|
|
|
echo "🔄 Restarting service..."
|
|
ssh ${HOST} << 'EOF'
|
|
cd /root/rag-mcp
|
|
PID=$(pgrep -f "uv run.*server.py" | head -1)
|
|
if [ -n "$PID" ]; then
|
|
kill $PID 2>/dev/null
|
|
sleep 2
|
|
fi
|
|
setsid uv run --with fastmcp --with pinecone --with python-dotenv --with requests python server.py </dev/null >/tmp/rag-mcp.log 2>&1 &
|
|
sleep 3
|
|
ps aux | grep "server.py" | grep -v grep && echo "✅ Service started" || echo "⚠️ Service not running"
|
|
echo ""
|
|
echo "📋 Recent logs:"
|
|
tail -15 /tmp/rag-mcp.log 2>/dev/null || echo "No logs yet"
|
|
EOF
|