-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsetup-graphistry-mcp.sh
More file actions
executable file
·68 lines (55 loc) · 2.09 KB
/
setup-graphistry-mcp.sh
File metadata and controls
executable file
·68 lines (55 loc) · 2.09 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
#!/bin/bash
# Setup script for Graphistry MCP server using uv/uvx
# This script sets up the environment and installs all dependencies
# for the Graphistry MCP server with fast installation via uv.
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
# Check if uv is installed, install if not
if ! command -v uv &> /dev/null; then
echo "Installing uv package manager..."
curl -LsSf https://astral.sh/uv/install.sh | sh
# Add uv to PATH for this session
export PATH="$HOME/.cargo/bin:$PATH"
# Check if installation was successful
if ! command -v uv &> /dev/null; then
echo "Failed to install uv. Please install manually: https://astral.sh/uv/install"
exit 1
fi
echo "✅ uv installed successfully"
fi
# Create a Python virtual environment if it doesn't exist
if [ ! -d ".venv" ]; then
echo "Creating virtual environment..."
uv venv .venv --python=python3.10
echo "✅ Virtual environment created"
else
echo "✅ Virtual environment already exists"
fi
# Activate the virtual environment
echo "Activating virtual environment..."
source .venv/bin/activate
# Install project in development mode with all dependencies
echo "Installing dependencies with uvx..."
uvx pip install -e ".[dev]"
# Install key packages explicitly to ensure they're available
echo "Installing key packages..."
uvx pip install "fastmcp>=2.2.6" "graphistry" "faiss-cpu" "pandas" "networkx" "uvicorn" "python-dotenv" "python-louvain" "pydantic" "psutil"
echo "Graphistry version:"
uvx python - << 'PY'
import graphistry
print(getattr(graphistry, '__version__', 'unknown'))
PY
# Make the start script executable
chmod +x start-graphistry-mcp.sh
echo "✅ Setup complete!"
echo "----------------------------"
echo "✨ You can now run the server using:"
echo "./start-graphistry-mcp.sh"
echo "Or for HTTP mode:"
echo "./start-graphistry-mcp.sh --http [port]"
echo ""
echo "📝 Remember to set your Graphistry credentials:"
echo "export GRAPHISTRY_USERNAME=your_username"
echo "export GRAPHISTRY_PASSWORD=your_password"
echo "----------------------------"