-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_mcp.sh
More file actions
43 lines (36 loc) Β· 1.24 KB
/
setup_mcp.sh
File metadata and controls
43 lines (36 loc) Β· 1.24 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
#!/bin/bash
echo "π Setting up Secure Notes MCP Server..."
# Check if Python 3.10+ is installed (Alpine/BusyBox compatible)
python_version=$(python3 --version 2>&1 | sed -n 's/Python \([0-9]\+\.[0-9]\+\).*/\1/p')
required_version="3.10"
# Use Python itself for version comparison (more reliable than sort -V in Alpine)
if python3 -c "import sys; exit(0 if sys.version_info >= (3, 10) else 1)" 2>/dev/null; then
echo "β
Python version: $python_version"
else
echo "β Python 3.10 or higher is required. Current version: $python_version"
exit 1
fi
# Check if OpenSSL is available
if command -v openssl >/dev/null 2>&1; then
echo "β
OpenSSL found"
else
echo "β οΈ OpenSSL not found. The server will use Python's secrets module as fallback."
fi
# Install dependencies
echo "π¦ Installing dependencies..."
pip3 install -r requirements.txt --user
if [ $? -eq 0 ]; then
echo "β
Dependencies installed successfully!"
else
echo "β Failed to install dependencies"
exit 1
fi
# Start the MCP server
echo "π¦ Starting the MCP server..."
python3 secure_note_mcp.py 2>&1
if [ $? -eq 0 ]; then
echo "β
MCP server started successfully!"
else
echo "β MCP server failed to start. See output above for details."
exit 1
fi