-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall_unix.sh
52 lines (45 loc) · 1.4 KB
/
install_unix.sh
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
#!/bin/bash
# Basic setup script for Python Notebook MCP on macOS/Linux
# Check for uv
if ! command -v uv &> /dev/null
then
echo "Error: 'uv' command not found. Please install uv first:"
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
echo "Make sure uv is added to your PATH (e.g., in ~/.zshrc or ~/.bashrc)"
exit 1
fi
# Create virtual environment
echo "Creating virtual environment (.venv)..."
uv venv
if [ $? -ne 0 ]; then
echo "Error: Failed to create virtual environment."
exit 1
fi
# Install dependencies into the virtual environment
echo "Installing dependencies from requirements.txt into .venv..."
# We use the python from the venv explicitly to be sure
./.venv/bin/python -m pip install -r requirements.txt
# Alternative using uv directly (should also work if uv detects .venv):
# uv pip install -r requirements.txt
if [ $? -ne 0 ]; then
echo "Error: Failed to install dependencies."
exit 1
fi
PYTHON_PATH="$(pwd)/.venv/bin/python"
SERVER_PATH="$(pwd)/server.py"
echo ""
echo "Setup successful!"
echo ""
echo "To configure your MCP client (e.g., Cursor's .cursor/mcp.json), use the following paths:"
echo " Python Executable ('command'): $PYTHON_PATH"
echo " Server Script ('args'): $SERVER_PATH"
echo ""
echo "Example mcp.json entry:"
echo "{
\"mcpServers\": {
\"jupyter\": {
\"command\": \"$PYTHON_PATH\",
\"args\": [\"$SERVER_PATH\"]
}
}
}"