This repository was archived by the owner on Feb 27, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·44 lines (37 loc) · 1.28 KB
/
setup.sh
File metadata and controls
executable file
·44 lines (37 loc) · 1.28 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
#!/usr/bin/env bash
#
# setup.sh - Setup opencti-mcp for standalone use
#
# Usage: ./setup.sh
#
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "Setting up opencti-mcp..."
# Check Python version
python_version=$(python3 -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
required="3.10"
if [ "$(printf '%s\n' "$required" "$python_version" | sort -V | head -n1)" != "$required" ]; then
echo "Error: Python 3.10+ required (found $python_version)"
exit 1
fi
# Create virtual environment
if [[ ! -d ".venv" ]]; then
echo "Creating virtual environment..."
python3 -m venv .venv
else
echo "Virtual environment exists."
fi
# Install dependencies
echo "Installing dependencies..."
.venv/bin/pip install --upgrade pip || { echo "Error: pip upgrade failed"; exit 1; }
.venv/bin/pip install -e . || { echo "Error: dependency installation failed"; exit 1; }
# Verify installation
echo "Verifying installation..."
.venv/bin/python -c "from opencti_mcp import OpenCTIMCPServer; print('OK')"
echo ""
echo "Setup complete!"
echo "Add this server to your .claude/mcp.json configuration."
echo "See README.md for configuration details."
echo ""
echo "Note: You will need to configure OPENCTI_TOKEN for this server to work."