-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·93 lines (85 loc) · 2.88 KB
/
install.sh
File metadata and controls
executable file
·93 lines (85 loc) · 2.88 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
#!/usr/bin/env bash
set -euo pipefail
echo "MakeMKV MCP Server Installer"
echo "================================"
# Check for Python 3.10+
PYTHON=""
for cmd in python3.12 python3.11 python3.10 python3; do
if command -v "$cmd" &>/dev/null; then
version=$("$cmd" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
major=$(echo "$version" | cut -d. -f1)
minor=$(echo "$version" | cut -d. -f2)
if [ "$major" -ge 3 ] && [ "$minor" -ge 10 ]; then
PYTHON="$cmd"
break
fi
fi
done
if [ -z "$PYTHON" ]; then
echo "Python 3.10+ is required. Please install Python first."
exit 1
fi
echo "Found $PYTHON ($version)"
# Check for makemkvcon
if command -v makemkvcon &>/dev/null; then
echo "Found makemkvcon"
else
echo "makemkvcon not found in PATH."
echo " Install MakeMKV from https://www.makemkv.com/"
echo " The server will still install but commands will fail until makemkvcon is available."
fi
# Install the package
echo ""
echo "Installing makemkv-mcp..."
$PYTHON -m pip install --user . 2>/dev/null || $PYTHON -m pip install --break-system-packages --user .
# Generate default config
echo ""
echo "Generating default config..."
$PYTHON -m makemkv_mcp.server --init-config
# Detect platform and offer service installation
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
echo ""
echo "Linux detected."
read -p "Install as systemd service? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
sudo cp systemd/makemkv-mcp.service /etc/systemd/system/
sudo sed -i "s|{USER}|$USER|g" /etc/systemd/system/makemkv-mcp.service
sudo sed -i "s|{PYTHON}|$(which $PYTHON)|g" /etc/systemd/system/makemkv-mcp.service
sudo systemctl daemon-reload
sudo systemctl enable makemkv-mcp
sudo systemctl start makemkv-mcp
echo "Service installed and started"
fi
elif [[ "$OSTYPE" == "darwin"* ]]; then
echo ""
echo "macOS detected."
read -p "Install as launchd service? [y/N] " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
PLIST_DIR="$HOME/Library/LaunchAgents"
mkdir -p "$PLIST_DIR"
cp launchd/com.hivementality.makemkv-mcp.plist "$PLIST_DIR/"
sed -i '' "s|{PYTHON}|$(which $PYTHON)|g" "$PLIST_DIR/com.hivementality.makemkv-mcp.plist"
launchctl load "$PLIST_DIR/com.hivementality.makemkv-mcp.plist"
echo "Service installed and started"
fi
fi
echo ""
echo "Installation complete!"
echo ""
echo "Quick start:"
echo " # Run with stdio (local):"
echo " makemkv-mcp"
echo ""
echo " # Run with HTTP (remote/network):"
echo " makemkv-mcp --transport streamable_http --port 8099"
echo ""
echo " # MCP client config (add to claude_desktop_config.json etc.):"
echo ' {'
echo ' "mcpServers": {'
echo ' "makemkv": {'
echo ' "url": "http://YOUR_IP:8099/mcp"'
echo ' }'
echo ' }'
echo ' }'