Skip to content

Commit ccd8fff

Browse files
committed
feat: enhance installation script and testing tool with improved feature handling and protocol version validation
1 parent dea468f commit ccd8fff

File tree

2 files changed

+33
-8
lines changed

2 files changed

+33
-8
lines changed

install-codegraph-osx.sh

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,27 @@ echo " DYLD_LIBRARY_PATH: /opt/homebrew/opt/faiss/lib"
6060
echo " MACOSX_DEPLOYMENT_TARGET: 11.0"
6161
echo ""
6262

63-
# Install CodeGraph with all revolutionary features
64-
echo -e "${BLUE}🚀 Installing CodeGraph Universal AI Development Platform...${NC}"
65-
echo "⏱️ This may take 5-10 minutes depending on your system..."
63+
FEATURE_FLAGS="ai-enhanced,qwen-integration,embeddings,faiss,embeddings-ollama,codegraph-vector/onnx"
64+
INSTALL_DIR="${CODEGRAPH_INSTALL_DIR:-$HOME/.local/bin}"
65+
66+
echo -e "${BLUE}🚀 Building CodeGraph Universal AI Development Platform...${NC}"
67+
echo "⏱️ This may take a few minutes depending on your system..."
68+
echo " Features: ${FEATURE_FLAGS}"
6669
echo ""
6770

68-
cargo install --path crates/codegraph-mcp \
69-
--features "embeddings,codegraph-vector/onnx,faiss,embeddings-ollama,qwen-integration,ai-enhanced" \
70-
--force
71+
cargo build --release \
72+
--package codegraph-mcp \
73+
--bin codegraph \
74+
--features "${FEATURE_FLAGS}" || {
75+
echo ""
76+
echo -e "${RED}❌ Build failed. Please review the error log above.${NC}"
77+
exit 1
78+
}
79+
80+
echo -e "${BLUE}📦 Installing binary to ${INSTALL_DIR}${NC}"
81+
mkdir -p "${INSTALL_DIR}"
82+
cp -f "$(pwd)/target/release/codegraph" "${INSTALL_DIR}/codegraph"
83+
chmod +x "${INSTALL_DIR}/codegraph"
7184

7285
if [ $? -eq 0 ]; then
7386
echo ""
@@ -85,7 +98,8 @@ if [ $? -eq 0 ]; then
8598
echo " 1. Navigate to any project directory"
8699
echo " 2. Run: ${GREEN}codegraph init .${NC}"
87100
echo " 3. Run: ${GREEN}codegraph index .${NC} (auto-detects all 11 languages)"
88-
echo " 4. Use CodeGraph tools in Claude Code!"
101+
echo " 4. Ensure ${INSTALL_DIR} is on your PATH (e.g. export PATH=\"${INSTALL_DIR}:4PATH\")"
102+
echo " 5. Use CodeGraph tools in Claude Code!"
89103
echo ""
90104
echo -e "${BLUE}🔗 MCP Configuration:${NC}"
91105
echo " Global config works from any directory - no manual setup needed!"
@@ -125,4 +139,4 @@ else
125139
echo ""
126140
echo "Please resolve the issue and run this script again."
127141
exit 1
128-
fi
142+
fi

test_mcp_tools.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,17 @@ def run():
165165
pass
166166
sys.exit(1)
167167

168+
try:
169+
init_msg = json.loads(init_out.strip().splitlines()[-1])
170+
server_proto = init_msg.get("result", {}).get("protocolVersion")
171+
if server_proto and server_proto != PROTO_DEFAULT:
172+
print(
173+
f"⚠️ Server reported protocolVersion={server_proto} but expected {PROTO_DEFAULT}."
174+
" Ensure you are running a freshly-built CodeGraph binary with the updated protocol."
175+
)
176+
except Exception:
177+
pass
178+
168179
# 2) notifications/initialized (notification; no id)
169180
inited_note = {
170181
"jsonrpc": "2.0",

0 commit comments

Comments
 (0)