Files
momentry_core/test_qdrant_mcp.sh
Warren b54c2def30 feat: add migrations, test scripts, and utility tools
- Add database migrations (006-028) for face recognition, identity, file_uuid
- Add test scripts for ASR, face, search, processing
- Add portal frontend (Tauri)
- Add config, benchmark, and monitoring utilities
- Add model checkpoints and pretrained model references
2026-04-30 15:11:53 +08:00

89 lines
2.9 KiB
Bash
Executable File

#!/bin/bash
# Qdrant MCP Connection Test
# Tests Qdrant connectivity for MCP integration
echo "=== Qdrant MCP Connection Test ==="
echo ""
# Test 1: Basic connectivity
echo "Test 1: Basic Qdrant Connectivity"
if curl -s http://localhost:6333 >/dev/null; then
echo "✅ Qdrant service is reachable"
else
echo "❌ Qdrant service not reachable"
exit 1
fi
echo ""
# Test 2: Authentication test
echo "Test 2: Qdrant Authentication"
RESPONSE=$(curl -s -H "api-key: Test3200Test3200Test3200" http://localhost:6333/collections)
if echo "$RESPONSE" | grep -q "status.*ok"; then
echo "✅ Qdrant authentication successful"
echo " Collections: $(echo "$RESPONSE" | jq -r '.result.collections[].name' | tr '\n' ' ')"
else
echo "❌ Qdrant authentication failed"
echo " Response: $RESPONSE"
fi
echo ""
# Test 3: Collection health check
echo "Test 3: Collection Health"
for collection in "chunks_v3" "AccusysDB"; do
RESPONSE=$(curl -s -H "api-key: Test3200Test3200Test3200" "http://localhost:6333/collections/$collection")
if echo "$RESPONSE" | grep -q "status.*ok"; then
echo "✅ Collection '$collection' is healthy"
else
echo "⚠️ Collection '$collection' may have issues"
fi
done
echo ""
# Test 4: Environment variables check
echo "Test 4: Environment Variables"
echo "QDRANT_URL: ${QDRANT_URL:-Not set}"
echo "QDRANT_API_KEY: ${QDRANT_API_KEY:-Not set}"
echo "QDRANT_COLLECTION: ${QDRANT_COLLECTION:-Not set}"
echo ""
# Test 5: Momentry Qdrant connection
echo "Test 5: Momentry Qdrant Integration"
if grep -q "qdrant\|Qdrant" /Users/accusys/momentry/log/momentry_api.log 2>/dev/null; then
echo "✅ Momentry has Qdrant references in logs"
else
echo "⚠️ No Qdrant references found in Momentry logs"
fi
echo ""
# Test 6: Vector operations test
echo "Test 6: Vector Operations Test"
# Try to count vectors in chunks_v3 collection
COUNT_RESPONSE=$(curl -s -H "api-key: Test3200Test3200Test3200" \
-X POST "http://localhost:6333/collections/chunks_v3/points/count" \
-H "Content-Type: application/json" \
-d '{}' 2>/dev/null || echo "{}")
if echo "$COUNT_RESPONSE" | grep -q "result"; then
COUNT=$(echo "$COUNT_RESPONSE" | jq -r '.result.count // 0')
echo "✅ Vector count: $COUNT points in chunks_v3 collection"
else
echo "⚠️ Could not retrieve vector count"
fi
echo ""
echo "=== MCP Configuration Suggestions ==="
echo ""
echo "If MCP shows red light, check these configuration points:"
echo "1. Ensure Qdrant is running: /Users/accusys/.cargo/bin/qdrant"
echo "2. Set environment variables:"
echo " export QDRANT_URL=http://localhost:6333"
echo " export QDRANT_API_KEY=Test3200Test3200Test3200"
echo " export QDRANT_COLLECTION=chunks_v3"
echo "3. Verify MCP configuration file includes these variables"
echo "4. Restart MCP server after setting variables"
echo ""
echo "Current Qdrant status: ✅ OPERATIONAL"
echo "API Key: Test3200Test3200Test3200"
echo "Collections: chunks_v3, AccusysDB"