-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·144 lines (118 loc) · 3.54 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·144 lines (118 loc) · 3.54 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#!/bin/bash
set -e
# QMCP Installation Script
# This script installs qmcp-uvx and qmcp-npx wrapper scripts
INSTALL_DIR="$HOME/.local/bin"
REPO_URL="https://raw.githubusercontent.com/qforge-dev/qmcp/refs/heads/main"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# Print colored output
print_status() {
echo -e "${GREEN}[INFO]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARN]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Docker is installed
check_docker() {
if ! command -v docker &> /dev/null; then
print_error "Docker is not installed or not in PATH"
print_error "Please install Docker first: https://docs.docker.com/get-docker/"
exit 1
fi
# Check if Docker daemon is running
if ! docker info &> /dev/null; then
print_error "Docker daemon is not running"
print_error "Please start Docker and try again"
exit 1
fi
print_status "Docker is installed and running"
}
# Create install directory
create_install_dir() {
if [ ! -d "$INSTALL_DIR" ]; then
print_status "Creating install directory: $INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
fi
}
# Download and install wrapper script
install_wrapper() {
local script_name="$1"
local script_url="$REPO_URL/bin/$script_name"
local script_path="$INSTALL_DIR/$script_name"
print_status "Installing $script_name..."
if command -v curl &> /dev/null; then
curl -fsSL "$script_url" -o "$script_path"
elif command -v wget &> /dev/null; then
wget -q "$script_url" -O "$script_path"
else
print_error "Neither curl nor wget is available"
exit 1
fi
chmod +x "$script_path"
print_status "$script_name installed successfully"
}
# Check if install directory is in PATH
check_path() {
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
print_warning "$INSTALL_DIR is not in your PATH"
print_warning "Add the following line to your shell profile (.bashrc, .zshrc, etc.):"
echo ""
echo " export PATH=\"\$HOME/.local/bin:\$PATH\""
echo ""
print_warning "Or run: export PATH=\"\$HOME/.local/bin:\$PATH\" (for current session only)"
else
print_status "$INSTALL_DIR is already in your PATH"
fi
}
# Pull Docker images
pull_images() {
print_status "Pulling Docker images..."
if docker pull ghcr.io/qforge-dev/qmcp-uvx:latest; then
print_status "qmcp-uvx image pulled successfully"
else
print_warning "Failed to pull qmcp-uvx image - you may need to build it locally"
fi
if docker pull ghcr.io/qforge-dev/qmcp-npx:latest; then
print_status "qmcp-npx image pulled successfully"
else
print_warning "Failed to pull qmcp-npx image - you may need to build it locally"
fi
}
# Main installation process
main() {
echo "🐳 QMCP Installation Script"
echo "=========================="
echo ""
check_docker
create_install_dir
# Install wrapper scripts
install_wrapper "qmcp-uvx"
install_wrapper "qmcp-npx"
install_wrapper "qmcp"
check_path
pull_images
echo ""
print_status "Installation completed successfully!"
echo ""
echo "You can now use:"
echo " • qmcp-uvx instead of uvx for Python MCP servers"
echo " • qmcp-npx instead of npx for Node.js MCP servers"
echo " • qmcp for plain Docker images"
echo ""
echo "Example usage:"
echo " qmcp-uvx elevenlabs-mcp"
echo " qmcp-npx @example/mcp-server"
echo " qmcp ghcr.io/github/github-mcp-server"
echo ""
if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then
print_warning "Remember to add $INSTALL_DIR to your PATH!"
fi
}
main "$@"