Switch MCP management to use OpenCode server API with version requirement >=1.0.137

This commit is contained in:
Chris Scott committed 2025-12-09 18:33:39 -05:00
1 parent 42149c4759
commit a00db28fa4
8 files changed
+547 -138

No files matched your search

+30 -4
View File
@@ -24,11 +24,37 @@ fi
echo "🔍 Checking OpenCode installation..."
MIN_OPENCODE_VERSION="1.0.137"
version_gte() {
printf '%s\n%s\n' "$2" "$1" | sort -V -C
}
if ! command -v opencode >/dev/null 2>&1; then
echo "⚠️ OpenCode not found in PATH"
else
OPENCODE_VERSION=$(opencode --version 2>&1 || echo "unknown")
echo "✅ OpenCode is installed (version: $OPENCODE_VERSION)"
echo "⚠️ OpenCode not found. Installing..."
curl -fsSL https://opencode.ai/install | bash
if ! command -v opencode >/dev/null 2>&1; then
echo "❌ Failed to install OpenCode. Exiting."
exit 1
fi
echo "✅ OpenCode installed successfully"
fi
OPENCODE_VERSION=$(opencode --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo "unknown")
echo "✅ OpenCode is installed (version: $OPENCODE_VERSION)"
if [ "$OPENCODE_VERSION" != "unknown" ]; then
if version_gte "$OPENCODE_VERSION" "$MIN_OPENCODE_VERSION"; then
echo "✅ OpenCode version meets minimum requirement (>=$MIN_OPENCODE_VERSION)"
else
echo "⚠️ OpenCode version $OPENCODE_VERSION is below minimum required version $MIN_OPENCODE_VERSION"
echo "🔄 Upgrading OpenCode..."
opencode upgrade || curl -fsSL https://opencode.ai/install | bash
OPENCODE_VERSION=$(opencode --version 2>&1 | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -1 || echo "unknown")
echo "✅ OpenCode upgraded to version: $OPENCODE_VERSION"
fi
fi
echo "🚀 Starting OpenCode WebUI Backend..."