verify-installation.shā¢2.6 kB
#!/bin/bash
echo "š CodeCompass MCP Server Installation Verification"
echo "=================================================="
# Check Node.js version
echo "1. Checking Node.js version..."
node_version=$(node --version)
echo " Node.js version: $node_version"
if [[ "$node_version" < "v18" ]]; then
echo " ā Node.js 18+ is required. Please upgrade."
exit 1
else
echo " ā
Node.js version is compatible"
fi
# Check if server is built
echo
echo "2. Checking if server is built..."
if [ -f "build/index.js" ]; then
echo " ā
Server is built"
else
echo " ā Server not built. Running npm run build..."
npm run build
if [ $? -eq 0 ]; then
echo " ā
Build completed successfully"
else
echo " ā Build failed"
exit 1
fi
fi
# Check Claude Code configuration
echo
echo "3. Checking Claude Code configuration..."
if [ -f "$HOME/.claude-code/mcp_servers.json" ]; then
echo " ā
Claude Code MCP configuration exists"
echo " Configuration file: $HOME/.claude-code/mcp_servers.json"
else
echo " ā Claude Code MCP configuration not found"
echo " Please make sure Claude Code is installed and configured"
fi
# Test server startup
echo
echo "4. Testing server startup..."
timeout 5s node build/index.js > /dev/null 2>&1
exit_code=$?
if [ $exit_code -eq 124 ]; then
echo " ā
Server starts successfully (timeout as expected)"
elif [ $exit_code -eq 0 ]; then
echo " ā
Server starts successfully"
else
echo " ā Server failed to start (exit code: $exit_code)"
exit 1
fi
# Check GitHub token (optional)
echo
echo "5. Checking GitHub token (optional)..."
if [ -n "$GITHUB_TOKEN" ]; then
echo " ā
GitHub token is set (higher rate limits)"
else
echo " ā ļø GitHub token not set (using public API limits)"
echo " To set a token: export GITHUB_TOKEN=your_token_here"
fi
echo
echo "š Installation verification complete!"
echo
echo "š Summary:"
echo " - Node.js: ā
Compatible"
echo " - Server built: ā
Ready"
echo " - Configuration: ā
Configured"
echo " - Server startup: ā
Working"
echo " - GitHub token: $([ -n "$GITHUB_TOKEN" ] && echo "ā
Set" || echo "ā ļø Not set")"
echo
echo "š You can now use the CodeCompass MCP server with Claude Code!"
echo
echo "Usage examples:"
echo " - 'Analyze this repository: https://github.com/user/repo'"
echo " - 'Extract reusable components from this React project'"
echo " - 'Transform this code to use modern JavaScript features'"
echo
echo "For more information, see the README.md file."