-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·62 lines (51 loc) · 1.33 KB
/
install.sh
File metadata and controls
executable file
·62 lines (51 loc) · 1.33 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
#!/usr/bin/env bash
set -e
REPO="r33drichards/mcp-js"
INSTALL_DIR="/usr/local/bin"
# Detect latest version if not specified
if [ -z "$MCP_V8_VERSION" ]; then
MCP_V8_VERSION=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | grep '"tag_name":' | sed -E 's/.*"tag_name": "([^"]+)".*/\1/')
fi
if [ -z "$MCP_V8_VERSION" ]; then
echo "Could not determine latest release version. Set MCP_V8_VERSION env var to override."
exit 1
fi
echo "Installing mcp-v8 version: $MCP_V8_VERSION"
# Detect OS and ARCH
OS=$(uname -s)
ARCH=$(uname -m)
case "$OS" in
Linux)
PLATFORM="linux"
;;
Darwin)
if [ "$ARCH" = "arm64" ]; then
PLATFORM="macos-arm64"
else
PLATFORM="macos"
fi
;;
*)
echo "Unsupported OS: $OS"
exit 1
;;
esac
BINARY_NAME="server-mcp-v8-$PLATFORM"
BINARY_GZ="$BINARY_NAME.gz"
DOWNLOAD_URL="https://github.com/$REPO/releases/download/$MCP_V8_VERSION/$BINARY_GZ"
echo "Downloading $DOWNLOAD_URL"
curl -L -o "$BINARY_GZ" "$DOWNLOAD_URL"
echo "Extracting binary..."
gunzip -f "$BINARY_GZ"
# Find install dir
if [ -w "$INSTALL_DIR" ]; then
TARGET="$INSTALL_DIR/mcp-v8"
mv "$BINARY_NAME" "$TARGET"
chmod +x "$TARGET"
else
TARGET="$INSTALL_DIR/mcp-v8"
sudo mv "$BINARY_NAME" "$TARGET"
sudo chmod +x "$TARGET"
fi
echo "Installed mcp-v8 to $TARGET"
echo "You can now run: mcp-v8"