-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·69 lines (55 loc) · 1.63 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·69 lines (55 loc) · 1.63 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
#!/bin/bash
# MySQL Query MCP Server Installation Script
# Author: Abou Koné
set -e
echo "=== MySQL Query MCP Server Installation ==="
echo ""
# Detect package manager
if command -v npm >/dev/null 2>&1; then
PKG_MANAGER="npm"
elif command -v yarn >/dev/null 2>&1; then
PKG_MANAGER="yarn"
else
echo "❌ Error: Neither npm nor yarn found. Please install Node.js and npm first."
exit 1
fi
echo "📦 Using $PKG_MANAGER for installation"
# Check Node.js version
NODE_VERSION=$(node -v | cut -d 'v' -f 2)
NODE_MAJOR=$(echo $NODE_VERSION | cut -d '.' -f 1)
if [ "$NODE_MAJOR" -lt 14 ]; then
echo "❌ Error: Node.js version 14 or higher is required."
echo "Current version: $NODE_VERSION"
echo "Please update your Node.js installation."
exit 1
fi
echo "✅ Node.js version $NODE_VERSION detected"
# Install the package
echo ""
echo "📥 Installing mysql-query-mcp-server..."
if [ "$PKG_MANAGER" = "npm" ]; then
npm install -g mysql-query-mcp-server
else
yarn global add mysql-query-mcp-server
fi
echo "✅ Installation complete!"
# Set up configuration
echo ""
echo "🔧 Setting up configuration..."
if [ ! -f .env ]; then
if [ -f .env.example ]; then
cp .env.example .env
echo "✅ Created .env file from template"
else
echo "⚠️ Warning: .env.example not found. Please create a .env file manually."
fi
else
echo "ℹ️ .env file already exists, skipping creation"
fi
echo ""
echo "🚀 MySQL Query MCP Server is ready!"
echo "ℹ️ Run 'mysql-query-mcp' to start the server"
echo ""
echo "For more information and documentation, visit:"
echo "https://github.com/devakone/mysql-query-mcp-server"
echo ""