-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_mcp_connection.sh
More file actions
executable file
·133 lines (113 loc) · 4.51 KB
/
verify_mcp_connection.sh
File metadata and controls
executable file
·133 lines (113 loc) · 4.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
#!/bin/bash
echo "=== MCP Connection Verification Script ==="
echo ""
# Colors for output
GREEN='\033[0;32m'
RED='\033[0;31m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 1. Check if MCP server process is running
echo "1. Checking if KnowCode MCP server is running..."
if ps aux | grep -v grep | grep "knowcode mcp-server" > /dev/null; then
PID=$(ps aux | grep -v grep | grep "knowcode mcp-server" | awk '{print $2}')
echo -e " ${GREEN}✓${NC} MCP server is running (PID: $PID)"
# Check if it's running with correct path
FULL_CMD=$(ps aux | grep -v grep | grep "knowcode mcp-server" | head -1)
if echo "$FULL_CMD" | grep -q ".venv/bin"; then
echo -e " ${GREEN}✓${NC} Using virtual environment binary"
else
echo -e " ${YELLOW}⚠${NC} Not using expected venv path"
fi
else
echo -e " ${RED}✗${NC} MCP server is NOT running"
echo " This is expected if Antigravity hasn't been restarted yet."
fi
echo ""
# 2. Verify MCP configuration
echo "2. Verifying MCP configuration..."
MCP_CONFIG="/home/deeog/.gemini/antigravity/mcp_config.json"
if [ -f "$MCP_CONFIG" ]; then
echo -e " ${GREEN}✓${NC} Config file exists: $MCP_CONFIG"
# Check if it uses full path
if grep -q "/home/deeog/Desktop/KnowCode/.venv/bin/knowcode" "$MCP_CONFIG"; then
echo -e " ${GREEN}✓${NC} Using absolute path to knowcode binary"
else
echo -e " ${RED}✗${NC} Not using absolute path - may fail to start"
fi
else
echo -e " ${RED}✗${NC} Config file not found!"
fi
echo ""
# 3. Check knowledge store
echo "3. Checking knowledge store..."
STORE_PATH="/home/deeog/Desktop/KnowCode/knowcode_knowledge.json"
if [ -f "$STORE_PATH" ]; then
SIZE=$(du -h "$STORE_PATH" | cut -f1)
echo -e " ${GREEN}✓${NC} Knowledge store exists: $SIZE"
# Check if it's recent
MOD_TIME=$(stat -c %Y "$STORE_PATH")
CURRENT_TIME=$(date +%s)
AGE=$((CURRENT_TIME - MOD_TIME))
if [ $AGE -lt 86400 ]; then # Less than 24 hours
echo -e " ${GREEN}✓${NC} Store is recent (modified within 24 hours)"
else
DAYS=$((AGE / 86400))
echo -e " ${YELLOW}⚠${NC} Store is $DAYS days old - consider re-analyzing"
fi
else
echo -e " ${RED}✗${NC} Knowledge store not found!"
fi
echo ""
# 4. Check semantic index
echo "4. Checking semantic index..."
INDEX_PATH="/home/deeog/Desktop/KnowCode/knowcode_index"
if [ -d "$INDEX_PATH" ]; then
echo -e " ${GREEN}✓${NC} Semantic index directory exists"
# Check for key index files (updated to match latest implementation)
if [ -f "$INDEX_PATH/index_manifest.json" ]; then
echo -e " ${GREEN}✓${NC} Index manifest found (index_manifest.json)"
else
echo -e " ${RED}✗${NC} Index manifest missing!"
fi
if [ -f "$INDEX_PATH/chunks.json" ]; then
echo -e " ${GREEN}✓${NC} Chunk metadata found (chunks.json)"
else
echo -e " ${RED}✗${NC} Chunk metadata missing!"
fi
if [ -f "$INDEX_PATH/vectors.index" ]; then
echo -e " ${GREEN}✓${NC} FAISS vector index found (vectors.index)"
else
echo -e " ${RED}✗${NC} FAISS vector index missing!"
fi
else
echo -e " ${YELLOW}⚠${NC} Semantic index not found (will use lexical search)"
fi
echo ""
# 5. Test knowcode CLI
echo "5. Testing knowcode CLI availability..."
if [ -f "/home/deeog/Desktop/KnowCode/.venv/bin/knowcode" ]; then
echo -e " ${GREEN}✓${NC} knowcode binary exists in venv"
# Try to get version
VERSION=$(source /home/deeog/Desktop/KnowCode/.venv/bin/activate && knowcode --version 2>&1 || echo "unknown")
echo " Version: $VERSION"
else
echo -e " ${RED}✗${NC} knowcode binary not found in venv"
fi
echo ""
echo "=== Summary ==="
echo ""
echo "KnowCode MCP server provides the following tools:"
echo " 1. search_codebase - Lexical search for entities"
echo " 2. get_entity_context - Deep-dive into specific code items"
echo " 3. trace_calls - Map out dependencies"
echo " 4. retrieve_context_for_query - Primary RAG retrieval (unified task-aware context)"
echo ""
echo "To complete the setup:"
echo "1. ${YELLOW}Stop any manually-started MCP server${NC} (Ctrl+C)"
echo "2. ${YELLOW}Restart Antigravity IDE${NC}"
echo "3. ${YELLOW}Antigravity will auto-start the MCP server using the config${NC}"
echo ""
echo "Expected behavior after restart:"
echo " • All 4 KnowCode tools will be available in the IDE"
echo " • Agent rules in .agent/context.md will guide tool usage"
echo ""